Skip to content

GROOVY-12156: chooseBestMethod returns candidates in identity-hash or…#2701

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

GROOVY-12156: chooseBestMethod returns candidates in identity-hash or…#2701
paulk-asert merged 1 commit into
apache:masterfrom
paulk-asert:groovy12156

Conversation

@paulk-asert

@paulk-asert paulk-asert commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

…der, making static-compilation output path-dependent

see: https://issues.apache.org/jira/browse/GROOVY-12156

…der, making static-compilation output path-dependent
@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 (1dee245).

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##               master      #2701        +/-   ##
==================================================
- Coverage     69.1077%   69.1054%   -0.0023%     
- Complexity      34235      34236         +1     
==================================================
  Files            1537       1537                
  Lines          129356     129356                
  Branches        23503      23503                
==================================================
- Hits            89395      89392         -3     
+ Misses          31941      31939         -2     
- Partials         8020       8025         +5     
Files with missing lines Coverage Δ
...roovy/transform/stc/StaticTypeCheckingSupport.java 82.1152% <100.0000%> (ø)

... and 7 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: 1dee245
▶️ Tests: 103693 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

Fixes GROOVY-12156 by making StaticTypeCheckingSupport.chooseBestMethod return deterministic candidate ordering (avoiding JVM identity-hash-dependent iteration order that can leak into static-compilation output).

Changes:

  • Replace HashSet with LinkedHashSet in chooseBestMethod to preserve insertion order of selected candidates.
  • Add a regression test that exercises union-type candidate ordering across varying identity-hash allocation histories.

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/stc/StaticTypeCheckingSupport.java Preserve method-candidate ordering deterministically by using LinkedHashSet for bestMethods.
src/test/groovy/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupportTest.groovy Add regression coverage ensuring union-type candidate order remains stable and matches delegate order.

@paulk-asert paulk-asert merged commit 5ca3ac4 into apache:master Jul 13, 2026
32 checks passed
@paulk-asert paulk-asert deleted the groovy12156 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