refactor: migrate all Xtend files to Java 21#1274
Draft
joaodinissf wants to merge 23 commits intodsldevkit:masterfrom
Draft
refactor: migrate all Xtend files to Java 21#1274joaodinissf wants to merge 23 commits intodsldevkit:masterfrom
joaodinissf wants to merge 23 commits intodsldevkit:masterfrom
Conversation
rubenporras
reviewed
Mar 2, 2026
| * @return the model stub string | ||
| */ | ||
| public String modelWithGrammar() { | ||
| StringBuilder builder = new StringBuilder(512); |
Collaborator
Author
There was a problem hiding this comment.
Good catch, I'll try to get it to clean this up later today.
5881e1c to
3d2312f
Compare
Convert all 8 Xtend source files in com.avaloq.tools.ddk.check.core to plain Java 21, eliminating the org.eclipse.xtend2.lib dependency: - CheckGeneratorConfig: @accessors → manual getter/setter - CheckTypeComputer: override → @OverRide, typeof → .class - CheckGeneratorNaming: static utilities, explicit types - CheckScopeProvider: dispatch methods → if-instanceof dispatcher - CheckGeneratorExtensions: 4 dispatch families, switch expressions - CheckFormatter: dispatch _format methods, extension→explicit calls - CheckGenerator: template expressions → StringBuilder (no StringConcatenation) - CheckJvmModelInferrer: extension fields, JvmTypesBuilder lambdas Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Xtend doesn't enforce checked exceptions, but Java does. Moved file.getContents() call inside try-with-resources block to properly handle CoreException. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate 28 Xtend files across 14 modules to idiomatic Java 21. All files are Trivial/Easy complexity (≤100 lines each). Modules touched: check.core.test, check.test.runtime, check.test.runtime.tests, check.ui, checkcfg.core, checkcfg.core.test, sample.helloworld.ui.test, xtext.check.generator, xtext.expression, xtext.format, xtext.format.ide, xtext.format.test, xtext.format.ui, xtext.generator Progress: 36/94 files migrated (38%) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate 13 Xtend files across 8 modules: - check.core.test: CheckApiAccessValidationsTest, ProjectBasedTests, IssueCodeValueTest, BasicModelTest - check.test.runtime.tests: CheckExecutionEnvironmentProjectTest - sample.helloworld.ui.test: CheckExecutionEnvironmentProjectTest - checkcfg.core: PropertiesInferenceHelper - checkcfg.core.test: CheckCfgScopeProviderTest, CheckCfgContentAssistTest, CheckCfgSyntaxTest - xtext.export.generator: ExportFragment2 - xtext.scope.generator: ScopingFragment2 - xtext.test.core: Tag Progress: 49/94 files migrated (52%). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate all 9 remaining Xtend files in the xtext.export module to idiomatic Java 21, completing the module. Includes template expressions converted to StringBuilder, dispatch methods with Java 21 pattern matching, and @Inject extension rewrites. Files: ResourceDescriptionConstantsGenerator, ExportFeatureExtensionGenerator, ResourceDescriptionManagerGenerator, ExportedNamesProviderGenerator, FragmentProviderGenerator, ExportGenerator, FingerprintComputerGenerator, ExportGeneratorX, ResourceDescriptionStrategyGenerator. Progress: 58/94 files migrated (62%). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate 10 Xtend files across 5 modules: xtext.expression (3), xtext.scope (4), xtext.test.core (1), xtext.ui (1), xtext.ui.test (1). Heavy use of dispatch methods (ExpressionExtensionsX, GenModelUtilX, CodeGenerationX, ScopeNameProviderGenerator, ScopeProviderX, ScopeProviderGenerator) converted to Java 21 pattern matching dispatchers. Template expressions converted to StringBuilder. Modules fully migrated: xtext.expression, xtext.scope, xtext.test.core, xtext.ui, xtext.ui.test. Progress: 68/94 files migrated (72%). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mplete! All 94 Xtend source files have been migrated to Java 21. Zero .xtend files remain in src/ directories. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove all xtend-gen references from .classpath, build.properties, pom.xml (xtend-maven-plugin, xtend.version property, PMD exclude, clean plugin fileset), PMD ruleset, Checkstyle config, and .gitignore. Remove org.eclipse.xtend.lib from MANIFEST.MF where no longer needed (kept in xtext.generator, check.core.test, sample.helloworld.ui, and xtext.test.core which still use xtend2.lib runtime classes or xtend.lib annotations). Remove migration section from AGENTS.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix ~396 violations across 12 files in 5 modules (xtext.expression, xtext.format, xtext.ui, xtext.ui.test, xtext.check.generator): - Suppress dispatch method naming and unused params at class level - Rename underscore-prefixed fields and lambda parameters - Use char literals in StringBuilder.append for single characters - Add StringBuilder capacity, extract string constants, fix Javadoc - Simplify boolean returns, fix loose coupling, remove unnecessary boxing - Extract long lambdas into private methods, fix varargs array creation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove superfluous instanceof check in CodeGenerationX - Simplify inferConstants boolean return in FormatJvmModelInferrer - Add @OverRide on infer() dispatch method - Cast null to Object[] to clarify varargs intent in test Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nd export modules Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolve ~600 PMD and Checkstyle violations across all modules affected by the Xtend-to-Java migration: check.core, check.core.test, check.ui, check.ui.test, checkcfg.core, checkcfg.core.test, format.generator, export.generator, generator.test, and generator. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… MissingOverride, LooseCoupling) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…t blocks Replace StringBuilder.append() chains with more readable alternatives: - Text blocks with String.format() for file skeleton generators (CheckNewProject, CheckQuickfixProvider, CheckProjectFactory, ExportGenerator) - String.format() for toString() methods in scope classes and resource descriptions - Simple string concatenation for trivial cases (EObjectUtil, AbstractLabelProvider, ClasspathBasedChecks, DirectLinkingResourceStorageLoadable) - String.join() for loop-based string building (ScopeTrace) Also widens toClient() parameter from StringBuilder to CharSequence in StandaloneBuilderIntegrationFragment2 and LspBuilderIntegrationFragment2, and removes unused INITIAL_BUFFER_CAPACITY constants. 18 files changed, net -106 lines removed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rces Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
84de93f to
76087e2
Compare
… simple concatenation Replace StringBuilder.append() chains with Java 21 text blocks, String.format(), and simple concatenation across 11 files where the pattern was a mechanical artifact of the Xtend-to-Java migration. Remaining StringBuilder instances (74 across 20 files) are intentionally kept where loops, interleaved conditionals, or dispatch group consistency make them the better choice. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Migrate all 88 Xtend (.xtend) source files to Java 21, leveraging modern language features (text blocks, enhanced switch, pattern matching, records). This eliminates the Xtend compilation step, significantly improving build times.
What's included
String.format()and text blocks, convert string concatenation to text blocks in test DSL sources@SuppressWarnings("nls")added to suppress non-externalized string literal warningsBuild impact
Clean Eclipse build ~2.8x faster: from 14.44s down to 5.13s (measured on MacBook).
Test plan
🤖 Generated with Claude Code