Source:
<code>private static void validateOwnIdAttribute(EntityType entityType, Map<String, Attribute> ownAllAttrMap) { Attribute ownIdAttr = entityType.getOwnIdAttribute(); if (ownIdAttr != null) { Attribute ownAttr = ownAllAttrMap.get(ownIdAttr.getIdentifier()); if (ownAttr == null) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] ID attribute [%s] is not part of the entity attributes", entityType.getId(), ownIdAttr.getName()))); } if (!AttributeUtils.isIdAttributeTypeAllowed(ownIdAttr)) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] ID attribute [%s] type [%s] is not allowed", entityType.getId(), ownIdAttr.getName(), ownIdAttr.getDataType().toString()))); } if (!ownIdAttr.isUnique()) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] ID attribute [%s] is not a unique attribute", entityType.getId(), ownIdAttr.getName()))); } if (ownIdAttr.isNillable()) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] ID attribute [%s] is not a non-nillable attribute", entityType.getId(), ownIdAttr.getName()))); } if (!ownIdAttr.isVisible() && entityType.getLabelAttribute() == null) { <START> throw new MolgenisValidationException(new ConstraintViolation( <END> format("The ID attribute of EntityType [%s] can not be hidden because there is no label attribute specified", entityType.getId()))); } } else { if (!entityType.isAbstract() && entityType.getIdAttribute() == null) { throw new MolgenisValidationException(new ConstraintViolation( format("Entity [%s] is missing required ID attribute", entityType.getId()))); } } }</code><technical_language>![MINOR](<LINK_2> 'Severity: MINOR') Remove this of "MolgenisValidationException"; is deprecated. [![rule](<LINK_1>](<LINK_0></technical_language>

Target:
static void validateOwnIdAttribute(EntityType entityType, Map<String, Attribute> ownAllAttrMap) { Attribute ownIdAttr = entityType.getOwnIdAttribute(); if (ownIdAttr != null) { Attribute ownAttr = ownAllAttrMap.get(ownIdAttr.getIdentifier()); if (ownAttr == null) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] ID attribute [%s] is not part of the entity attributes", entityType.getId(), ownIdAttr.getName()))); } if (!AttributeUtils.isIdAttributeTypeAllowed(ownIdAttr)) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] ID attribute [%s] type [%s] is not allowed", entityType.getId(), ownIdAttr.getName(), ownIdAttr.getDataType().toString()))); } if (!ownIdAttr.isUnique()) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] ID attribute [%s] is not a unique attribute", entityType.getId(), ownIdAttr.getName()))); } if (ownIdAttr.isNillable()) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] ID attribute [%s] is not a non-nillable attribute", entityType.getId(), ownIdAttr.getName()))); } } else { if (!entityType.isAbstract() && entityType.getIdAttribute() == null) { throw new MolgenisValidationException(new ConstraintViolation( format("EntityType [%s] is missing required ID attribute", entityType.getId()))); } } }