WenFAN / reflections

Automatically exported from code.google.com/p/reflections
Do What The F*ck You Want To Public License
0 stars 0 forks source link

Empty set returned when jar was processed (not even obfuscated) by proguard #138

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open the attached maven project
2. run "mvn package"
3. run the proguard processed jar file using "java -jar obftest-release.jar" 
and get no classes in return for reflections.getSubTypesOf(Test.class)
4. run the not processed "java -jar obftest.jar" and correctly the class "Bla" 
is listed.

The version of reflections is 0.9.8

I added a simple (hacked) solution that casts the ClassLoader to an 
UrlClassLoader and retrieves the urls if no urls were returned from 
ClasspathHelper - but I could not find out why the ClasspathHelper would not 
find any urls in the first place.

Of course you are allowed to use my solution in the code - but I guess there 
exists a better solution when it becomes clear why the ClassLoader behaves so 
differently on these two jars.

Original issue reported on code.google.com by darkblue...@googlemail.com on 2 Jan 2013 at 10:13

Attachments:

GoogleCodeExporter commented 8 years ago
use ClasspathHelper.forPackage() + ClasspathHelper.forClassLoader() instead.

Original comment by ronm...@gmail.com on 23 Nov 2013 at 12:35