JDK-4870651 : javap should recognize generics, varargs, enums
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javap
  • Affected Version: 5.0,5.0u1
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_8,solaris_nevada
  • CPU: generic
  • Submitted: 2003-05-28
  • Updated: 2012-01-13
  • Resolved: 2012-01-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b30Fixed
Description
When using javap on the class file of a generic program, javap should print
the types with their generic signatures.  Currently javap prints the erasure.
Similarly javap should understand varargs and enums.

==========$ cat -n T.java
     1  class T<X> {
     2      X f(X x) { return null; }
     3      <Z> Z g(Class<Z> z) { return null; }
     4  }
==========$ newjavac -source 1.5 T.java 
+ exec /usr/java1.5/bin/javac -source 1.5 T.java
==========$ /usr/java1.5/bin/javap T
Compiled from "T.java"
class T extends java.lang.Object{
    T();
    java.lang.Object f(java.lang.Object);
    java.lang.Object g(java.lang.Class);
}

==========$ 

Comments
EVALUATION Mostly covered by new javap. Does not currently take class file version into account.
2007-11-01

EVALUATION A reasonable request. Presumably javap would need to 1. exmaine the class file version information to see if these features are supported. 2. query whatever additional attributes are in the class file which mark a class as an enum or a generic type. ###@###.### 2003-05-28 Won't be delivered until after 1.5. Too risky and late to provide now ###@###.### 2003-11-07
2003-05-28