From 167688eabdd10ad91143cb0baf113e2288b2b408 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 28 Oct 2013 08:53:22 -0500 Subject: [PATCH] Teach SystemClassLoader#getResources to not stop at the first match The getResources method can be used to find all matches in the class path for a given path, e.g. to seek out all the META-INF/MANIFEST.MF files contained in all of the .jar files in the class path. We just taught the findResources() method to return all matches (rather than only the first), so let's use that method to get all the matches from the current class loader's class path elements. Signed-off-by: Johannes Schindelin --- classpath/avian/SystemClassLoader.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/classpath/avian/SystemClassLoader.java b/classpath/avian/SystemClassLoader.java index afdee82ed3..ce9cdcd7a3 100644 --- a/classpath/avian/SystemClassLoader.java +++ b/classpath/avian/SystemClassLoader.java @@ -107,9 +107,9 @@ public class SystemClassLoader extends ClassLoader { } } - URL url = findResource(name); - if (url != null) { - urls.add(url); + Enumeration urls2 = findResources(name); + while (urls2.hasMoreElements()) { + urls.add(urls2.nextElement()); } return Collections.enumeration(urls);