refactor: migrate Xtend to Java - com.avaloq.tools.ddk.check.core#1452
Draft
joaodinissf wants to merge 3 commits into
Draft
refactor: migrate Xtend to Java - com.avaloq.tools.ddk.check.core#1452joaodinissf wants to merge 3 commits into
joaodinissf wants to merge 3 commits into
Conversation
joaodinissf
force-pushed
the
migrate/xtend-to-java/check-core
branch
2 times, most recently
from
July 6, 2026 11:37
0f48915 to
72b635e
Compare
Pure git mv of the 8 remaining .xtend sources to .java, content unchanged, so the rename edge has 100% similarity and git log --follow and git blame permanently traverse the migration boundary. This intermediate commit intentionally does not compile; the translation follows in the next commit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
In-place translation of the 8 renamed sources, faithful to the Xtend compiler's own xtend-gen output (fresh ground-truth build). The three byte-critical emitters (CheckGeneratorExtensions, CheckGenerator, CheckJvmModelInferrer) keep the exact StringConcatenation call sequences incl. two-arg append(value, indent) and newLineIfNotEmpty. Notable per-file points: - CheckJvmModelInferrer: Xtend's JvmTypesBuilder '+=' silently skips null elements; the plain Iterables.addAll translation let null JvmMembers reach the type resolver (IllegalArgumentException: element: null, reproduced by the CheckValidationTest severity-range stubs). The two affected call sites are wrapped in IterableExtensions.filterNull like every sibling site. - CheckGeneratorExtensions.getContents: two deliberate output-neutral hardenings (explicit UTF-8; IllegalStateException wrapping of checked exceptions), documented in the PR. - splitCamelCase uses .formatted() per repo convention (behavior-identical to the String.format xtend-gen emitted). - CheckGeneratorNaming/CheckGenerator: Javadoc completed with @param/@return where originals carried plain block comments (checkstyle JavadocMethod gate). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The module is fully off Xtend: remove the xtend-gen source folder from build.properties and .classpath, the xtextBuilder/xtextNature from .project, and the xtend-gen directory marker — matching the other fully migrated modules. No Require-Bundle change needed (the module declares no Xtend bundles; xtend2.lib/xbase.lib resolve transitively for the StringConcatenation-based generators). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
joaodinissf
force-pushed
the
migrate/xtend-to-java/check-core
branch
from
July 19, 2026 11:17
72b635e to
2fa945b
Compare
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.
What
Migrates the remaining 8
.xtendfiles ofcom.avaloq.tools.ddk.check.coreto Java 21 (generator, generator-extensions, generator-naming, JVM model inferrer, formatter, scope provider, type computer, generator-config), and drops the module's Xtend build infrastructure. Commit structure follows the skill: puregit mvrename → in-place translate → infrastructure cleanup.How it was validated
Beyond the standard build, this migration was independently re-migrated blind (a second migration produced from the
.xtendsources + a freshly builtxtend-genground truth, without looking at this branch's Java) and then three-way reconciled — blind vs this branch vs thextend-gencompiler output as arbiter:CheckTypeComputer,CheckGeneratorNaming,CheckScopeProvider) — mutual validation.xtend-genand held up: the UTF-8 charset ingetContents(PMDRelianceOnDefaultCharsetrequires an explicit charset), thefilterNullwrappers in the inferrer (load-bearing — they reproduceJvmTypesBuilder.operator_add's null-skipping semantics that a bareaddAllwould lose), the faithful throwing dispatcher, and thenewLineIfNotEmptyhandling ingenerateServiceRegistry.The one change vs the pre-rebase branch is a
// CPD-OFF … // CPD-ONmarker around thecreateCheckExecution/createCheckCallertoMethod skeleton inCheckJvmModelInferrer— a pre-existing, faithful duplication (both methods emit the sametoMethod(ctx, name, typeRef("void"), …)shape, as the original Xtend did) that only surfaces now because the branch rebased onto master's stricterpmd.cpd.min=100. Same treatment and rationale as the migrated ANTLR generators.Verification
ddk-parent:mvn -T 3C clean verify checkstyle:check pmd:check pmd:cpd-check spotbugs:check→ BUILD SUCCESS, 358 tests / 0 failures / 0 errors, all static analysis clean.CheckValidationTest,CheckQuickfixTest, generator/scoping tests) passes; the reconciliation confirmed byte- or behavior-equivalence to thextend-genground truth across all 8 files.🤖 Generated with Claude Code