Skip to content

fix: baseline CPD duplications in migrated ANTLR generators#1467

Merged
joaodinissf merged 1 commit into
dsldevkit:masterfrom
joaodinissf:fix/cpd-baseline-migrated-antlr-generators
Jul 13, 2026
Merged

fix: baseline CPD duplications in migrated ANTLR generators#1467
joaodinissf merged 1 commit into
dsldevkit:masterfrom
joaodinissf:fix/cpd-baseline-migrated-antlr-generators

Conversation

@joaodinissf

Copy link
Copy Markdown
Collaborator

What

Baselines 4 CPD duplications in three migrated ANTLR generators with file-scoped CPD-OFF markers, restoring a green cpd-check on master.

  • AnnotationAwareAntlrContentAssistGrammarGenerator.java
  • AnnotationAwareAntlrGrammarGenerator.java
  • AnnotationAwareXtextAntlrGeneratorFragment2.java

Why master went red

Two recently-merged PRs interacted in a way neither's CI could see on its own:

Merged together, master has CPD enabled and #1429's un-baselined migrated Java, so the snapshot full scan fails at cpd-check with 4 intra-file duplications. Rebase-merge does not re-run a PR's CI, so the combination first surfaced on master.

Approach

These are faithful Xtend→Java migrations (the duplicated structure is inherited from the original Xtend's polymorphic dispatch — parallel rule-emission methods differing only in rule type, argument order, or a literal). They are baselined with file-scoped CPD-OFF, consistent with the treatment of the analogous FormatJvmModelInferrer in #1397.

Verification

Local, on com.avaloq.tools.ddk.xtext.generator: pmd:cpd-check, checkstyle:check, and pmd:check all green (CPD duplications 4 → 0).

🤖 Generated with Claude Code

Enabling CPD (dsldevkit#1397, pmd.cpd.min 100000->100) and migrating the
AnnotationAware ANTLR generators to Java (dsldevkit#1429) each passed CI in
isolation, but their combination on master surfaced 4 intra-file
duplications in the migrated generators that neither PR's build saw:
CPD was still effectively disabled when dsldevkit#1429's checks ran, and dsldevkit#1397's
baseline predated dsldevkit#1429's Java. The snapshot full scan caught it,
leaving master red at cpd-check.

These are faithfully migrated Xtend generators with parallel
rule-emission structure, baselined with file-scoped CPD-OFF markers
consistent with dsldevkit#1397's treatment of the analogous FormatJvmModelInferrer.

Verified locally: pmd:cpd-check / checkstyle:check / pmd:check all green
on com.avaloq.tools.ddk.xtext.generator.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@joaodinissf joaodinissf marked this pull request as ready for review July 13, 2026 09:06
@joaodinissf joaodinissf requested a review from rubenporras July 13, 2026 09:06
@joaodinissf joaodinissf merged commit a68a240 into dsldevkit:master Jul 13, 2026
4 checks passed
@joaodinissf joaodinissf deleted the fix/cpd-baseline-migrated-antlr-generators branch July 13, 2026 09:23
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.

2 participants