nodeTypeManagerLock.writeLock().lock();
for (Location location : nodeTypeLocations) {
Node nodeTypeNode = nodeTypeSubgraph.getNode(location);
assert location.getPath() != null;
Name internalName = location.getPath().getLastSegment().getName();
if (internalName == null || internalName.getLocalName().length() == 0) {
throw new InvalidNodeTypeDefinitionException(JcrI18n.invalidNodeTypeName.text());
}
if (nodeTypes.containsKey(internalName)) {
throw new NodeTypeExistsException(internalName,
JcrI18n.nodeTypeAlreadyExists.text(internalName.getString(namespaces)));
}
List<JcrNodeType> supertypes = supertypesFor(nodeTypeNode, typesPendingRegistration);
// No need to re-parse the supertypes
JcrNodeType nodeType = nodeTypeFrom(nodeTypeSubgraph, location, supertypes);