private void checkImmutableFieldsCorrespond(FieldType userFieldType, FieldType latestFieldType)
throws FieldTypeUpdateException {
if (!userFieldType.getValueType().equals(latestFieldType.getValueType())) {
throw new FieldTypeUpdateException("Changing the valueType of a fieldType '" + latestFieldType.getId() +
"' (current name: " + latestFieldType.getName() + ") is not allowed; old '" +
latestFieldType.getValueType() + "' new '" + userFieldType.getValueType() + "'");
}
if (!userFieldType.getScope().equals(latestFieldType.getScope())) {
throw new FieldTypeUpdateException("Changing the scope of a fieldType '" + latestFieldType.getId() +
"' (current name: " + latestFieldType.getName() + ") is not allowed; old '" +
latestFieldType.getScope() + "' new '" + userFieldType.getScope() + "'");
}
}