When there is a path in the classpath that is a parent of another jar in the
classpath, no items are found by Reflections.
In my case, I had "somejar::anotherjar" in the classpath. Note the two colons.
That resolved to my current working dir (we'll say /foo), which has my jars a
few subdirectories deep.
Jar:
/foo/sub/dir/somejar.jar
Current working directory (in classpath):
/foo
getBaseUrl(url,baseUrls) does (in part):
//try to return the base url
for (URL baseUrl : baseUrls) {
String path2 = Vfs.normalizePath(baseUrl);
if (path1.startsWith(path2)) {
return baseUrl;
}
}
"/foo/sub/dir/somejar.jar".startsWith("/foo") returns true and the baseUrl
"/foo" is returned.
Subsequently no items are found by Reflections.
If I remove the /foo path (::) from the classpath, Reflections works normally.
I am using Reflections 0.9.5-RC2 on both Solaris and OSX.
Original issue reported on code.google.com by ericparu...@gmail.com on 2 Nov 2010 at 10:44
Original issue reported on code.google.com by
ericparu...@gmail.com
on 2 Nov 2010 at 10:44