Skip to content

style: drop Xtend-compiler boilerplate in migrated check.core files - #1491

Open
joaodinissf wants to merge 2 commits into
dsldevkit:masterfrom
joaodinissf:migrate/xtend-to-java/check-core-step-2
Open

style: drop Xtend-compiler boilerplate in migrated check.core files#1491
joaodinissf wants to merge 2 commits into
dsldevkit:masterfrom
joaodinissf:migrate/xtend-to-java/check-core-step-2

Conversation

@joaodinissf

@joaodinissf joaodinissf commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Removes the boilerplate the Xtend compiler always emits from the remaining check.core files migrated in #1452, matching the cleanup applied to CheckScopeProvider during that PR's review:

  • 57 explicit generic type witnesses (EcoreUtil2.<Context> getContainerOfType(…), Iterables.<Check>concat(…), …) — Java's inference resolves every site to the same type.
  • 109 explicit lambda parameter types ((final JvmGenericType it) ->it ->).
  • 5 imports orphaned by the removals.

Touches CheckFormatter, CheckJvmModelInferrer, CheckGenerator and CheckGeneratorExtensions. No semantic change: single-overload extension methods throughout, so inference cannot pick a different target; compile plus clean PMD/Checkstyle/SpotBugs gates verify it.

🤖 Generated with Claude Code

@joaodinissf
joaodinissf force-pushed the migrate/xtend-to-java/check-core-step-2 branch from f2846d4 to c68ec00 Compare August 14, 2026 15:50
@joaodinissf
joaodinissf marked this pull request as ready for review August 14, 2026 15:50
@joaodinissf
joaodinissf enabled auto-merge (rebase) August 14, 2026 15:59
…ore files

Extend the boilerplate cleanup from the dsldevkit#1452 review to the remaining
migrated files: remove explicit generic type witnesses (57) and explicit
lambda parameter types (109) that the Xtend compiler always emits, plus
the five imports orphaned by the removals. Java's inference resolves
every site to the same types; the compiler and the untouched gates are
the proof.

CheckFormatter, CheckJvmModelInferrer, CheckGenerator and
CheckGeneratorExtensions; no semantic change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@joaodinissf
joaodinissf force-pushed the migrate/xtend-to-java/check-core-step-2 branch from c68ec00 to 6c66a56 Compare August 14, 2026 16:18
Replace the six-append assembly of the ImmutableMap builder head with a
single formatted() statement:

  builder.append("ImmutableMap.<String, String>builderWithExpectedSize(%d)\n"
      .formatted(sortedUniqueQualifiedIssueCodeNamesAndLabels.entrySet().size()));

All three simplifications are output-identical by construction:
- the getSimpleName() calls always produce "ImmutableMap"/"String"
  (top-level classes; rename safety already lives in the field's
  typeRef, which also supplies the generated file's import);
- the trailing newLineIfNotEmpty() provably always fired (the line ends
  with a static ")"), so an unconditional newline is equivalent, and
  StringConcatenation.append(String) normalizes the embedded \n to the
  builder's own delimiter;
- the generation tests pin the emitted output either way.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@joaodinissf
joaodinissf force-pushed the migrate/xtend-to-java/check-core-step-2 branch from e109329 to ecf695f Compare August 14, 2026 20:29
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.

1 participant