Emmanuel Bourg pushed to branch master at Debian Java Maintainers / groovy
Commits: cbd39385 by Emmanuel Bourg at 2026-11-13T13:34:01+01:00 Resolve the Groovydoc type references in a reproducible way - - - - - 3 changed files: - debian/changelog - + debian/patches/25_GROOVY-11954.patch - debian/patches/series Changes: ===================================== debian/changelog ===================================== @@ -1,3 +1,10 @@ +groovy (2.5.23-2) unstable; urgency=medium + + * Team upload. + * Resolve the Groovydoc type references in a reproducible way + + -- Emmanuel Bourg <[email protected]> Fri, 13 Nov 2026 13:33:49 +0100 + groovy (2.5.23-1) unstable; urgency=medium * Team upload. ===================================== debian/patches/25_GROOVY-11954.patch ===================================== @@ -0,0 +1,48 @@ +Description: Resolve the Groovydoc type references in a reproducible way + The type resolution cache shared by all the classes was filled with the short + names resolved in the context of the first class processed, the links to the + nested classes thus depended on the order of the source files. +Origin: backport, https://github.com/apache/groovy/commit/9df1d739d376280d2db2e4366f18eca3050902ff +Bug: https://issues.apache.org/jira/browse/GROOVY-11954 +Author: Paul King <[email protected]> +--- a/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyClassDoc.java ++++ b/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyClassDoc.java +@@ -87,6 +87,7 @@ + private final List<GroovyClassDoc> nested; + private final List<LinkArgument> links; + private final Map<String, Class<?>> resolvedExternalClassesCache; ++ private final Map<String, GroovyClassDoc> localResolvedClasses = new HashMap<>(); + private GroovyClassDoc superClass; + private GroovyClassDoc outer; + private String superClassName; +@@ -555,14 +556,22 @@ + + private GroovyClassDoc resolveClass(GroovyRootDoc rootDoc, String name) { + if (isPrimitiveType(name)) return null; +- Map<String, GroovyClassDoc> resolvedClasses = rootDoc.getResolvedClasses(); +- GroovyClassDoc groovyClassDoc = resolvedClasses.get(name); +- if (groovyClassDoc != null) { +- return groovyClassDoc; +- } +- groovyClassDoc = doResolveClass(rootDoc, name); +- resolvedClasses.put(name, groovyClassDoc); +- return groovyClassDoc; ++ if (rootDoc == null) return doResolveClass(rootDoc, name); ++ ++ // Short names resolve against this class's imports/aliases/package, ++ // so caching them on the shared root-level map (GROOVY-11954) lets ++ // the first resolver's context poison every later resolver. Fully ++ // qualified names (containing '/') bypass import resolution and are ++ // safe to share globally. ++ Map<String, GroovyClassDoc> cache = name.indexOf('/') >= 0 ++ ? rootDoc.getResolvedClasses() ++ : localResolvedClasses; ++ GroovyClassDoc cached = cache.get(name); ++ if (cached != null) return cached; ++ ++ GroovyClassDoc resolved = doResolveClass(rootDoc, name); ++ if (resolved != null) cache.put(name, resolved); ++ return resolved; + } + + private GroovyClassDoc doResolveClass(final GroovyRootDoc rootDoc, final String name) { ===================================== debian/patches/series ===================================== @@ -13,3 +13,4 @@ failOnError.patch 22_reproducible_groovydoc_inherited.patch 23_jarjar_compatibility.patch 24_groovy_all_jar.patch +25_GROOVY-11954.patch View it on GitLab: https://salsa.debian.org/java-team/groovy/-/commit/cbd393858067928801fbd753bc2da71a925a6d1b -- View it on GitLab: https://salsa.debian.org/java-team/groovy/-/commit/cbd393858067928801fbd753bc2da71a925a6d1b You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
_______________________________________________ pkg-java-commits mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-java-commits

