Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Though only one entry is found within META-INF, e.g. META-INF/groovy/org.codehaus.groovy.source.Extensions, two entries are retrieved via getResources method.
def loader = this.class.classLoader def r = loader.getResources("META-INF/groovy/org.codehaus.groovy.source.Extensions").toList() println r
Output:
[jar:file:/D:/_DEV/Groovy/groovy-4.0.14/lib/groovy-4.0.14.jar!/META-INF/groovy/org.codehaus.groovy.source.Extensions, jar:file:/D:/_DEV/Groovy/groovy-4.0.14/lib/groovy-4.0.14.jar!/META-INF/groovy/org.codehaus.groovy.source.Extensions]
As a result, Groovy processes them repeatedly, which is meaningless and should be avoided.