I am using the BCEL
library to analyze some code. I came across a method (getAllNames())
whose return type is List< Name >
. I want to be able to obtain the return type of this method.
I want to be able to obtain the full class of "Name".
I have tried using the < Instruction.getReturnType() >
method in my method visitor class but for this specific method I get the result "java.util.List". I want the generic type "com.instant.Name" instead.
The signature for the method is like so:
public List<Name> getAllNames() {
...
}
I also have a org.apache.bcel.generic.MethodGen object that I create before visiting the method using org.apache.bcel.classfile.Method
When I try to get return type it again gives "java.util.List"
I expect the output of MethodGen.getReturnType() to be "com.instant.Name" but the actual output is "java.util.List"