Skip to content

GROOVY-12158: @AutoImplement generates methods in hash order, not the…#2703

Merged
paulk-asert merged 1 commit into
apache:masterfrom
paulk-asert:groovy12158
Jul 13, 2026
Merged

GROOVY-12158: @AutoImplement generates methods in hash order, not the…#2703
paulk-asert merged 1 commit into
apache:masterfrom
paulk-asert:groovy12158

Conversation

@paulk-asert

Copy link
Copy Markdown
Contributor

… order they are found

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.1054%. Comparing base (86c6648) to head (cd6aaa1).

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##               master      #2703        +/-   ##
==================================================
- Coverage     69.1077%   69.1054%   -0.0023%     
  Complexity      34235      34235                
==================================================
  Files            1537       1537                
  Lines          129356     129356                
  Branches        23503      23503                
==================================================
- Hits            89395      89392         -3     
- Misses          31941      31942         +1     
- Partials         8020       8022         +2     
Files with missing lines Coverage Δ
...oovy/transform/AutoImplementASTTransformation.java 88.0597% <100.0000%> (ø)

... and 5 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.

@testlens-app

testlens-app Bot commented Jul 13, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: cd6aaa1
▶️ Tests: 103801 executed
⚪️ Checks: 31/31 completed


Learn more about TestLens at testlens.app.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ensures @AutoImplement emits generated methods deterministically in the order they are discovered (rather than HashMap iteration order), improving reproducibility of generated classfiles and joint-compilation stubs.

Changes:

  • Switch getAllCorrectedMethodsMap to an insertion-ordered LinkedHashMap so downstream .values() iteration is stable.
  • Add a regression test that compiles a simple interface + @AutoImplement implementation and asserts generated method order via ASM bytecode inspection.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/main/java/org/codehaus/groovy/transform/AutoImplementASTTransformation.java Uses LinkedHashMap to preserve discovery order when generating methods/stubs.
src/test/groovy/org/codehaus/groovy/transform/AutoImplementMethodOrderTest.groovy Adds regression coverage asserting bytecode method emission order matches declaration order.

@paulk-asert paulk-asert merged commit 0a16e3e into apache:master Jul 13, 2026
32 checks passed
@paulk-asert paulk-asert deleted the groovy12158 branch July 13, 2026 23:48
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