choigv / 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

Methods are not returned from the class classloader when calling getMethodFromDescriptor #146

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a different classloader that is not a child of the current one that 
contains a class with a method.
2. use Utils.getMethodFromDescriptor(String descriptor, ClassLoader... 
classLoaders) to get the method from the defined class in the external 
classloader
3. you get the ReflectionsException "Can't resolve method named: " + method Name

What is the expected output? What do you see instead?
 You expect to get the method, but you get the exception

What version of the product are you using? On what operating system?
 Versions 0.9.8, 0.9.9-RC1. Haven't tested other versions.

Please provide any additional information below.

The fix is (for sources on 0.9.9-RC1) at line 70 in the 
org.reflections.util.Utils class, the parameter list is loaded from the current 
classloader instead of the one that comes as parameter. So, the solution is to 
call ReflectionUtils.forName(className1, classLoaders) instead of the current 
call. (Similar to line 75)

Original issue reported on code.google.com by lucianje...@gmail.com on 25 Apr 2013 at 12:58

GoogleCodeExporter commented 9 years ago

Original comment by ronm...@gmail.com on 21 Dec 2013 at 9:32