} catch (NodeTypeConflictException ntce) {
throw new ConstraintViolationException(ntce.getMessage());
}
// get applicable definition for this node using new primary type
NodeDefId defId;
try {
NodeImpl parent = (NodeImpl) getParent();
defId = parent.getApplicableChildNodeDefinition(getQName(), ntName).unwrap().getId();
} catch (RepositoryException re) {
String msg = this + ": no applicable definition found in parent node's node type";
log.debug(msg);
throw new ConstraintViolationException(msg, re);
}
if (!defId.equals(state.getDefinitionId())) {
onRedefine(defId);
}
Set<ItemDef> oldDefs = new HashSet<ItemDef>(Arrays.asList(entOld.getAllItemDefs()));
Set<ItemDef> newDefs = new HashSet<ItemDef>(Arrays.asList(entNew.getAllItemDefs()));