GROOVY-11954: groovydoc: short-name type resolution cache makes doc o…#2484
Merged
paulk-asert merged 1 commit intoapache:masterfrom Apr 22, 2026
Merged
GROOVY-11954: groovydoc: short-name type resolution cache makes doc o…#2484paulk-asert merged 1 commit intoapache:masterfrom
paulk-asert merged 1 commit intoapache:masterfrom
Conversation
…utput order-dependent and non-reproducible
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ 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
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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-
SimpleGroovyClassDoccache for resolving short (unqualified) type names, while keeping the existing shared root cache for fully-qualified (slashed) names. - Add regression fixtures that import conflicting
Datetypes (java.util.Datevsjava.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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…utput order-dependent and non-reproducible