Skip to content

refactor(expression): take the segments of a Java type name as varargs - #1562

Merged
joaodinissf merged 1 commit into
masterfrom
refactor/java-name-varargs
Sep 30, 2026
Merged

joaodinissf merged 1 commit into
masterfrom
refactor/java-name-varargs

Conversation

@joaodinissf

Copy link
Copy Markdown
Collaborator

Why the change

Follows up on Ruben's suggestion in #1556: three of the four callers of javaName split a string into an array and wrapped it in a list only to pass it on, so the method now takes the segments as varargs.

Special things to note

  • The fourth caller, addExpressionTypeNames, starts from the identifier's List<String> and converts it with toArray(String[]::new).
  • No behaviour change; the fix(export,scope): record the Java types a model names as dependencies #1556 tests cover all four paths.
  • After 19.3.0 is released, xtext.expression, xtext.export and xtext.scope need a version bump for the release version check, since their content changes against that baseline.

Change outline

 xtext.expression/.../AbstractExpressionModelResourceDescriptionManager.java
-  javaName(final List<String> segments)      segments.stream()
+  javaName(final String... segments)         Arrays.stream(segments)
 xtext.export/.../ExportResourceDescriptionManager.java   javaName(List.of(x.split("::")))  → javaName(x.split("::"))
 xtext.scope/.../ScopeResourceDescriptionManager.java     same, for extensions and inject types

🤖 Generated with Claude Code

Three of the callers of javaName split a string into an array and wrapped
it in a list only to pass it on, so the method now takes the segments as
varargs; the identifier path converts its list once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joaodinissf
joaodinissf marked this pull request as ready for review September 30, 2026 14:28
@joaodinissf
joaodinissf merged commit 0f75838 into master Sep 30, 2026
4 checks passed
@joaodinissf
joaodinissf deleted the refactor/java-name-varargs branch September 30, 2026 14:32
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