@Override public RefinedObjectClassDefinition getRefinedDefinition( ShadowKindType kind, Collection<String> intents) throws SchemaException { RefinedObjectClassDefinition found = null; for (RefinedObjectClassDefinition acctDef : getRefinedDefinitions(kind)) { RefinedObjectClassDefinition foundCurrent = null; if (intents == null || intents.isEmpty()) { if (acctDef.isDefault()) { foundCurrent = acctDef; } } else { if (intents.contains(acctDef.getIntent())) { foundCurrent = acctDef; } } if (foundCurrent != null) { if (found != null) { if (!QNameUtil.match(found.getTypeName(), foundCurrent.getTypeName())) { throw new SchemaException( "More than one ObjectClass found for kind " + kind + ", intents: " + intents + ": " + found.getTypeName() + ", " + foundCurrent.getTypeName()); } } else { found = foundCurrent; } } } return found; }