if (!index.hasChildNode("acPrincipalName")) {
IndexUtils.createIndexDefinition(index, "acPrincipalName", true, false,
ImmutableList.<String>of(REP_PRINCIPAL_NAME),
ImmutableList.<String>of(NT_REP_DENY_ACE, NT_REP_GRANT_ACE, NT_REP_ACE));
}
<BUG>NodeBuilder permissionStore = root.child(JCR_SYSTEM).child(REP_PERMISSION_STORE);
</BUG>
if (!permissionStore.hasProperty(JCR_PRIMARYTYPE)) {
permissionStore.setProperty(JCR_PRIMARYTYPE, NT_REP_PERMISSION_STORE, Type.NAME);
}

if (!index.hasChildNode("acPrincipalName")) {
IndexUtils.createIndexDefinition(index, "acPrincipalName", true, false,
ImmutableList.<String>of(REP_PRINCIPAL_NAME),
ImmutableList.<String>of(NT_REP_DENY_ACE, NT_REP_GRANT_ACE, NT_REP_ACE));
}
NodeBuilder permissionStore = builder.child(JCR_SYSTEM).child(REP_PERMISSION_STORE);
if (!permissionStore.hasProperty(JCR_PRIMARYTYPE)) {
permissionStore.setProperty(JCR_PRIMARYTYPE, NT_REP_PERMISSION_STORE, Type.NAME);
}
