United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4870651 : javap should recognize generics, varargs, enums

Details
Type:
Enhancement
Submit Date:
2003-05-28
Status:
Closed
Updated Date:
2012-01-13
Project Name:
JDK
Resolved Date:
2012-01-13
Component:
tools
OS:
solaris_8,solaris_nevada
Sub-Component:
javap
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
5.0,5.0u1
Fixed Versions:

Related Reports

Sub Tasks

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

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
EVALUATION

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



Hardware and Software, Engineered to Work Together