Copilot commented on code in PR #2913:
URL: https://github.com/apache/groovy/pull/2913#discussion_r3968797986
##########
build-logic/src/main/groovy/org/apache/groovy/gradle/RepackageJarTask.groovy:
##########
@@ -223,10 +233,11 @@ abstract class RepackageJarTask extends ShadowJar {
// rewritten to groovyjarjaropenbeans the lookup no-ops.
Type/descriptor
// remapping is unaffected (skipStringConstants only gates LDC
strings).
// See GROOVY-12199 / Bucket 4a.
- if (shouldSkipStringConstants(prefix)) {
- relocate(prefix, destination) { it.skipStringConstants = true }
- } else {
- relocate(prefix, destination)
+ List<String> untouched = relocationExcludes[pattern] ?: []
+ boolean skipStrings = shouldSkipStringConstants(prefix)
+ relocate(prefix, destination) { relocator ->
+ if (skipStrings) relocator.skipStringConstants = true
+ untouched.each { relocator.exclude(it) }
}
Review Comment:
`relocator.exclude(it)` is receiving entries like `java.beans.Transient`
(per the new API doc). To avoid silent “exclusion didn’t apply” scenarios, it
would help to (a) normalize/document the expected format explicitly (dot-name
vs internal-name vs glob patterns), and/or (b) validate/transform the provided
names into whatever the relocator actually matches against (e.g.,
`java/beans/Transient` or class resource path). Without this, a format mismatch
would negate the purpose of GROOVY-12391 while still appearing configured
correctly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]