ide-template: collapse ModelValues.bool into isTrue so every .edm flag obeys one rule (#7231) - #7273
Merged
delchev merged 1 commit intoSep 10, 2026
Conversation
…g obeys one rule (eclipse-dirigible#7231) eclipse-dirigible#7182 (eclipse-dirigible#7144) fixed CompositionChildren.refusesMasterDelete misreading relationshipMasterDeleteRefused="false" as true by adding a new helper, ModelValues.bool - but ModelValues.isTrue already existed for exactly this ("the model persists its flags as strings") and is what every other flag is read through (dataUnique, isRequiredProperty, widgetIsMajor, detailCalendar, ...). The result was two helpers for "is this string flag true": relationshipMaster- DeleteRefused honoured "TRUE" / " true " while isRequiredProperty="TRUE" stayed false. bool had exactly one caller. Case-insensitive parsing is the wanted behaviour here - eclipse-dirigible#7182 deliberately locked it with tests (CompositionChildrenTest.aWrittenOutTrueIsTheRefusal / aWrittenOutFalseIsTheCascade) because the flag guards a destructive cascade, so a hand-authored "True" must refuse, not silently delete the children. So this makes isTrue the single robust reader rather than dropping to a presence/lowercase test: - ModelValues.isTrue now parses the value (Boolean.parseBoolean, trimmed, any case) - the exact body bool had - so every .edm flag is read the same way. - ModelValues.bool is deleted; CompositionChildren routes through isTrue. - New ModelValuesTest pins the single rule directly at the helper (lowercase/ uppercase/padded true, written-out false in any case, absent key/map, Boolean). The change is lenient-only for the other flags (the modeler always emits lowercase "true"/"false"), so generated output is byte-identical. Verified: mvn formatter:validate (BUILD SUCCESS, cache wiped); ide-template unit suite green (125 tests, incl. new ModelValuesTest and the unchanged CompositionChildrenTest); ModelGenerationIT green (1/1). Fixes eclipse-dirigible#7231 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cause
#7182 (#7144) fixed
CompositionChildren.refusesMasterDeletemisreadingrelationshipMasterDeleteRefused="false"as true by introducing a new helper,ModelValues.bool. ButModelValues.isTruealready existed for exactly this purpose - its javadoc says "the model persists its flags as strings" - and is what every other.edmflag is read through (dataUnique,isRequiredProperty,widgetIsMajor,detailCalendar,dataPrimaryKey, …). The result was two helpers for "is this string flag true", andrelationshipMasterDeleteRefusedbecame the one attribute in the whole model that honoured"TRUE"/" true "whileisRequiredProperty="TRUE"stayed false.boolhad exactly one caller.Change — one rule, one helper (the case-insensitive one)
Case-insensitive parsing is the behaviour that is wanted here: #7182 deliberately locked it with tests (
CompositionChildrenTest.aWrittenOutTrueIsTheRefusal/aWrittenOutFalseIsTheCascade) because this flag guards a destructive cascade (whenMasterDeleted: refuse, #7100/#7143) - a hand-authored"True"must refuse, not silently delete the master's children. So rather than dropping to a lowercase/presence test, this promotesisTrueto the single robust reader:ModelValues.isTruenow parses the value (Boolean.parseBoolean, trimmed, any case) - the exact bodyboolhad - so every.edmflag is read one way.ModelValues.boolis deleted;CompositionChildrenroutes throughisTrue.ModelValuesTestpins the single rule directly at the helper (lowercase/uppercase/paddedtrue, written-outfalsein any case, absent key/map, aBooleanvalue).The change is lenient-only for the other flags (the modeler always emits lowercase
"true"/"false"), so generated output is byte-identical; every existingCompositionChildrenTestcase passes unchanged.Verification
mvn formatter:validateafter wiping the formatter cache - BUILD SUCCESS.ide-templateunit suite - green (125 tests, incl. the newModelValuesTestand the unchangedCompositionChildrenTest).ModelGenerationIT(the model-generation regression harness) - green (1/1).Not run: the full IT suite (pure refactor with byte-identical output; CI covers it).
Fixes #7231