if (primaryTypeName != null) {
primaryType = nodeTypes().getNodeType(primaryTypeName);
if (primaryType == null) {
Path pathForChild = pathFactory.create(node.getPath(), name, numSns + 1);
I18n msg = JcrI18n.unableToCreateNodeWithPrimaryTypeThatDoesNotExist;
throw new NoSuchNodeTypeException(msg.text(primaryTypeName, pathForChild, workspaceName()));
}
} else {
primaryType = (JcrNodeType)definition.getDefaultPrimaryType();
if (primaryType == null) {
// There is no default primary type ...