refactor: migrate Xtend to Java - com.avaloq.tools.ddk.check.core - #1452
Open
joaodinissf wants to merge 4 commits into
Open
refactor: migrate Xtend to Java - com.avaloq.tools.ddk.check.core#1452joaodinissf wants to merge 4 commits into
joaodinissf wants to merge 4 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
joaodinissf
force-pushed
the
migrate/xtend-to-java/check-core
branch
from
July 19, 2026 11:17
72b635e to
2fa945b
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>
joaodinissf
force-pushed
the
migrate/xtend-to-java/check-core
branch
from
August 2, 2026 05:36
2fa945b to
f43aba0
Compare
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). - Comments preserve the originals' exact state: block comments stay block comments, and no Javadoc is invented (checkstyle only validates Javadoc that exists; it does not require any). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <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: org.eclipse.xtext.xbase.lib stays as a direct dependency because the migrated sources still use IterableExtensions/ListExtensions/ StringExtensions and StringConcatenation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Post-verification style pass, kept separate from the faithful translation commit for clean revertability: - adopt Java 21 pattern matching in the hand-written dispatchers (CheckTypeComputer, CheckScopeProvider, CheckGeneratorExtensions, CheckFormatter — 62 branches) - CheckFormatter: rename the generic dispatcher parameter xlistliteral to element, collapse the tail's impossible final else (provably unreachable: requires x == null and x != null both false), drop the dead Arrays import, restore final on loop variables - CheckGenerator: fix misspelled local formattedCateogryDescription - CheckGeneratorExtensions: build the splitCamelCase regex from named compile-time String constants folded by the compiler instead of a runtime .formatted() call Behavior is identical by construction; verified against the fresh xtend-gen ground truth as part of the migration verification. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
joaodinissf
force-pushed
the
migrate/xtend-to-java/check-core
branch
from
August 2, 2026 05:52
f43aba0 to
74444ba
Compare
joaodinissf
marked this pull request as ready for review
August 2, 2026 05:52
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: puregit mvrename → in-place translate → infrastructure cleanup → separate style pass (Java 21 pattern matching in the hand-written dispatchers, kept out of the faithful translation commit for clean revertability).How it was validated
Two independent lines of evidence, both against the authoritative ground truth — a freshly built
xtend-gen/(what the Xtend compiler itself produced from these sources, built off current master):.xtendsources without sight of this branch, then reconciled file-by-file against this branch withxtend-genas arbiter. The two migrations converged on identical semantics at every contested site (dispatcher contracts,filterNullnull-skip preservation, issue-code sort order, template whitespace, sentinel returns).xtend-gen(every one-arg vs two-argappend,newLineIfNotEmptyoccurrence, null-handling quirk, iteration order, and exception surface), with each candidate finding subjected to a refutation pass. Two real defects were found and fixed on this branch: fabricated Javadoc in the generator files (now restored to the originals' exact comment state) and a malformed.classpathfrom the infra cleanup (now xmllint-valid).Deliberate, output-neutral divergences from
xtend-gen, kept and documented: explicit UTF-8 ingetContents(PMDRelianceOnDefaultCharset), checked-exception wrapping inIllegalStateException, and theCPD-OFFmarker around the faithfultoMethodduplication inCheckJvmModelInferrer(master's stricterpmd.cpd.min=100).Verification
Full local gate from
ddk-parent(verify checkstyle:check pmd:check spotbugs:check, check.core + test bundle + upstream deps): BUILD SUCCESS, test suite green, all static analysis clean. CI green on the pushed stack.🤖 Generated with Claude Code