Modernize property code generation and validate generated Java 馃 - #3238
Merged
Merged
Conversation
Convert the 27 tools Xtend sources to maintained Java 21 and replace collection helpers with JDK APIs. Remove obsolete Xtend source paths, builders, and runtime dependencies from the three tools bundles. Emit Java with var, pattern matching, expression lambdas, Optional.isEmpty, and Stream.toList, and keep generated blank lines empty. Generated list extraction now returns unmodifiable lists, including nested lists. Add an opt-in Maven tools profile and compile all 26 existing output-test fixtures with --release 21. Add six runtime tests using validated AADL models to exercise generated getters, constants, modes, lists, units, enums, ranges, and nested record round-tripping. Fixes #3237
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.
Fixes #3237
Summary
The property generator used Xtend, had no Maven build, and tested its generated Java only through source-string comparisons. Convert all 27 Xtend sources in the generator, UI handler, and tests to idiomatic Java 21 with JDK collections, and remove obsolete Xtend/Guava collection dependencies and Eclipse wiring.
Modernize the emitted Java with
var, pattern matching, expression lambdas,Optional.isEmpty(), andStream.toList(). Generated blank lines are empty. Add POMs for the three bundles and atoolsprofile in both aggregators so normal root builds continue to exclude the tools.All 26 existing exact-output tests now compile their generated sources and imported property sets with
--release 21. Six additional tests use the validatedmodels/generatedjavaAADL project to load and execute freshly compiled classes, checking:The tests use standard Eclipse Xtext testing APIs. Temporary generated source/classes and class loaders are cleaned up after each test.
Validation
git diff --cached --checkpassed.toolsprofile; the full root reactor was not used for final PR validation.Compatibility and dependencies
Generated code targets Java 21. The deliberate behavior change is that
Stream.toList()returns unmodifiable lists, including nested lists; callers that need to mutate them must make mutable copies. Exact-output expectations and runtime assertions cover this change. The UI handler compiles, but interactive UI behavior was not exercised.Based directly on
master, with no prerequisite PR or merge-order dependency. The migration is kept in one commit because the source ownership, build wiring, and updated output expectations form one coherent change.