boolean multipleReferencesAllowed) throws CASAdminException {
// assert(featureName != null);
// assert(domainType != null);
// assert(rangeType != null);
if (this.locked) {
throw new CASAdminException(CASAdminException.TYPE_SYSTEM_LOCKED);
}
Feature f = domainType.getFeatureByBaseName(featureName);
if (f != null && f.getRange().equals(rangeType)) {
return f;
}
if (domainType.isFeatureFinal()) {
CASAdminException e = new CASAdminException(CASAdminException.TYPE_IS_FEATURE_FINAL);
e.addArgument(domainType.getName());
throw e;
}
checkFeatureNameSyntax(featureName);
final int featCode = this.addFeature(featureName, ((TypeImpl) domainType).getCode(),
((TypeImpl) rangeType).getCode(), multipleReferencesAllowed);