dimanche 17 mai 2015

Java8 reflection: not getting expected return type

Reflection not working as expected through command line but working as expected in eclipse. I started facing this problem after switching to Java8

Method method = <code_to_get_method_of_a_class>
Class<?> returnType = method.getReturnType();

// This method actually returns List but I am getting return type 
// as java.lang.Object when using reflection
public List<IOGLocation> get(IOGLocationLookupKey key) {...}





Aucun commentaire:

Enregistrer un commentaire