Skip to content

GROOVY-12146: order reflection calls to ensure Annotation members are ordered#2687

Merged
paulk-asert merged 1 commit into
apache:GROOVY_5_0_Xfrom
jdaugherty:GROOVY_5_0_X
Jul 11, 2026
Merged

GROOVY-12146: order reflection calls to ensure Annotation members are ordered#2687
paulk-asert merged 1 commit into
apache:GROOVY_5_0_Xfrom
jdaugherty:GROOVY_5_0_X

Conversation

@jdaugherty

Copy link
Copy Markdown
Contributor

Fixes https://issues.apache.org/jira/browse/GROOVY-12146 by canonicalizing at the source of the nondeterminism instead of at emission (the reverted 4.x approach also reordered source-compiled annotations, which stay in deterministic source order and don't need touching):

// Java8#configureAnnotation
declaredMethods = type.getDeclaredMethods();
Arrays.sort(declaredMethods, Comparator.comparing(Method::getName));

Annotation member methods cannot overload, so name gives a total order. Verified locally against GROOVY_5_0_X: the woven class emits a stable sorted order independent of the JVM, source-compiled annotations are unchanged, and TypeAnnotationsTest plus the trait transform suites pass.

@jdaugherty jdaugherty changed the title GROOVY-12146 - order reflection calls to ensure Annotation members are ordered GROOVY-12146: order reflection calls to ensure Annotation members are ordered Jul 10, 2026
@codecov-commenter

codecov-commenter commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.2962%. Comparing base (ee772e0) to head (89f59f9).
⚠️ Report is 2 commits behind head on GROOVY_5_0_X.

Additional details and impacted files

Impacted file tree graph

@@                  Coverage Diff                   @@
##             GROOVY_5_0_X      #2687        +/-   ##
======================================================
+ Coverage         67.2477%   67.2962%   +0.0484%     
+ Complexity          29571      29569         -2     
======================================================
  Files                1382       1382                
  Lines              116972     117185       +213     
  Branches            20539      20676       +137     
======================================================
+ Hits                78661      78861       +200     
- Misses              31788      31790         +2     
- Partials             6523       6534        +11     
Files with missing lines Coverage Δ
...in/java/org/codehaus/groovy/vmplugin/v8/Java8.java 78.5100% <100.0000%> (+0.0618%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@paulk-asert paulk-asert marked this pull request as ready for review July 11, 2026 04:19
@paulk-asert

Copy link
Copy Markdown
Contributor

LGTM

@paulk-asert paulk-asert merged commit ff64047 into apache:GROOVY_5_0_X Jul 11, 2026
27 checks passed
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.

3 participants