Summary
#7182 (#7144) fixed CompositionChildren.refusesMasterDelete reading relationshipMasterDeleteRefused="false" as true by introducing a new helper ModelValues.bool(map, key). ModelValues.isTrue(map, key) already existed for exactly this purpose - its javadoc says "the model persists its flags as strings" - and is what every other .edm flag is read through (ModelParameterProcessor.java:310-317, 328, 824, 897: dataPrimaryKey, dataUnique, isRequiredProperty, widgetIsMajor, detailCalendar, ...).
components/ide/ide-template/src/main/java/org/eclipse/dirigible/components/ide/template/service/model/ModelValues.java:
static boolean isTrue(Map<String, Object> map, String key) { // line 118
Object value = map == null ? null : map.get(key);
return Boolean.TRUE.equals(value) || "true".equals(value);
}
static boolean bool(Map<String, Object> map, String key) { // line 137
Object value = map == null ? null : map.get(key);
if (value instanceof Boolean flag) { return flag; }
return value != null && Boolean.parseBoolean(value.toString().trim());
}
The new javadoc contrasts bool with truthy and never mentions isTrue. Result: two helpers for "is this string flag true", and relationshipMasterDeleteRefused is the one attribute in the whole model that honours "TRUE" / " true " while isRequiredProperty="TRUE" is still false. bool has exactly one caller (CompositionChildren).
Fix
Replace the call with isTrue(property, "relationshipMasterDeleteRefused") and delete bool - or, if case-insensitive parsing is wanted, make isTrue do it for every flag. One rule, one helper.
Found reviewing #7182.
Summary
#7182 (#7144) fixed
CompositionChildren.refusesMasterDeletereadingrelationshipMasterDeleteRefused="false"as true by introducing a new helperModelValues.bool(map, key).ModelValues.isTrue(map, key)already existed for exactly this purpose - its javadoc says "the model persists its flags as strings" - and is what every other.edmflag is read through (ModelParameterProcessor.java:310-317, 328, 824, 897:dataPrimaryKey,dataUnique,isRequiredProperty,widgetIsMajor,detailCalendar, ...).components/ide/ide-template/src/main/java/org/eclipse/dirigible/components/ide/template/service/model/ModelValues.java:The new javadoc contrasts
boolwithtruthyand never mentionsisTrue. Result: two helpers for "is this string flag true", andrelationshipMasterDeleteRefusedis the one attribute in the whole model that honours"TRUE"/" true "whileisRequiredProperty="TRUE"is still false.boolhas exactly one caller (CompositionChildren).Fix
Replace the call with
isTrue(property, "relationshipMasterDeleteRefused")and deletebool- or, if case-insensitive parsing is wanted, makeisTruedo it for every flag. One rule, one helper.Found reviewing #7182.