Is there a tool similar to javap that could display methods and fields with their original (non-erased) types?
I know that the type information is erased when source code is compiled. However, the compiler must know somehow, because it is able to determine if my calls to library methods match their signatures even if the library is already compiled into class files. So at least in theory, it should be possible to retrieve the type information.
I searched further and I found this answer: Where are generic types stored in java class files? which pointed me to getGeneric...() methods. So it looks to me that the type information is stored in class files in some complicated way, and these methods allow to obtain it. But so far I didn't find a (command line) tool that'd display this information.
A decompiler such as http://java.decompiler.free.fr/ will give you an approximation to the original source code, including the generic signatures.