NodeTypes nodeTypes = session().nodeTypes();
final SiblingCounter siblingCounter = SiblingCounter.create(node, cache);
if (childPrimaryNodeTypeName != null) {
if (INTERNAL_NODE_TYPE_NAMES.contains(childPrimaryNodeTypeName)) {
int numExistingSns = siblingCounter.countSiblingsNamed(childName);
String workspaceName = workspaceName();
String childPath = readable(session.pathFactory().create(path(), childName, numExistingSns + 1));
String msg = JcrI18n.unableToCreateNodeWithInternalPrimaryType.text(childPrimaryNodeTypeName, childPath,
workspaceName);
throw new ConstraintViolationException(msg);