Skip to content

ide-template: collapse ModelValues.bool into isTrue so every .edm flag obeys one rule (#7231) - #7273

Merged
delchev merged 1 commit into
eclipse-dirigible:masterfrom
NicoleNG18:issue-7231-one-bool-helper
Sep 10, 2026
Merged

ide-template: collapse ModelValues.bool into isTrue so every .edm flag obeys one rule (#7231)#7273
delchev merged 1 commit into
eclipse-dirigible:masterfrom
NicoleNG18:issue-7231-one-bool-helper

Conversation

@NicoleNG18

Copy link
Copy Markdown
Contributor

Cause

#7182 (#7144) fixed CompositionChildren.refusesMasterDelete misreading relationshipMasterDeleteRefused="false" as true by introducing a new helper, ModelValues.bool. But ModelValues.isTrue 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 (dataUnique, isRequiredProperty, widgetIsMajor, detailCalendar, dataPrimaryKey, …). The result was two helpers for "is this string flag true", and relationshipMasterDeleteRefused became the one attribute in the whole model that honoured "TRUE" / " true " while isRequiredProperty="TRUE" stayed false. bool had 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 promotes isTrue to the single robust reader:

  • ModelValues.isTrue now parses the value (Boolean.parseBoolean, trimmed, any case) - the exact body bool had - so every .edm flag is read one 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, a Boolean value).

The change is lenient-only for the other flags (the modeler always emits lowercase "true"/"false"), so generated output is byte-identical; every existing CompositionChildrenTest case passes unchanged.

Verification

  • mvn formatter:validate after wiping the formatter cache - BUILD SUCCESS.
  • ide-template unit suite - green (125 tests, incl. the new ModelValuesTest and the unchanged CompositionChildrenTest).
  • 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

…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>
@delchev
delchev merged commit 522a0d0 into eclipse-dirigible:master Sep 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ide-template: ModelValues.bool duplicates ModelValues.isTrue - one .edm flag is now read case-insensitively, every other one is not

2 participants