Skip to content

GROOVY-11954: groovydoc: short-name type resolution cache makes doc o…#2484

Merged
paulk-asert merged 1 commit intoapache:masterfrom
paulk-asert:groovy11954
Apr 22, 2026
Merged

GROOVY-11954: groovydoc: short-name type resolution cache makes doc o…#2484
paulk-asert merged 1 commit intoapache:masterfrom
paulk-asert:groovy11954

Conversation

@paulk-asert
Copy link
Copy Markdown
Contributor

…utput order-dependent and non-reproducible

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.0504%. Comparing base (f148316) to head (4e3fb66).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...s/groovy/tools/groovydoc/SimpleGroovyClassDoc.java 80.0000% 0 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##               master      #2484        +/-   ##
==================================================
- Coverage     67.0520%   67.0504%   -0.0016%     
- Complexity      31524      31526         +2     
==================================================
  Files            1451       1451                
  Lines          122408     122408                
  Branches        21948      21949         +1     
==================================================
- Hits            82077      82075         -2     
- Misses          33253      33256         +3     
+ Partials         7078       7077         -1     
Files with missing lines Coverage Δ
...s/groovy/tools/groovydoc/SimpleGroovyClassDoc.java 80.0856% <80.0000%> (ø)

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

Copy link
Copy Markdown

Copilot AI left a comment

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-11954 in groovy-groovydoc by preventing short-name type resolution from being incorrectly shared across classes (which made generated docs order-dependent and non-reproducible when different classes import different types with the same simple name).

Changes:

  • Introduce a per-SimpleGroovyClassDoc cache for resolving short (unqualified) type names, while keeping the existing shared root cache for fully-qualified (slashed) names.
  • Add regression fixtures that import conflicting Date types (java.util.Date vs java.sql.Date).
  • Add an integration-style test that renders both fixtures in the same doc run and asserts correct link targets for each class.

Reviewed changes

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

File Description
subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyClassDoc.java Fixes the caching strategy in resolveClass to avoid cross-class short-name cache poisoning.
subprojects/groovy-groovydoc/src/test/groovy/org/codehaus/groovy/tools/groovydoc/GroovyDocToolTest.java Adds a regression test ensuring per-class imports are honored when resolving short names in one run.
subprojects/groovy-groovydoc/src/test/groovy/org/codehaus/groovy/tools/groovydoc/testfiles/AmbiguousDateUtil.groovy Test fixture importing java.util.Date and using simple name Date.
subprojects/groovy-groovydoc/src/test/groovy/org/codehaus/groovy/tools/groovydoc/testfiles/AmbiguousDateSql.groovy Test fixture importing java.sql.Date and using simple name Date.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@paulk-asert paulk-asert merged commit 9df1d73 into apache:master Apr 22, 2026
27 checks passed
@paulk-asert paulk-asert deleted the groovy11954 branch April 22, 2026 20:06
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