United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6205502 javap prints certain methods' signatures incorrectly
JDK-6205502 : javap prints certain methods' signatures incorrectly

Details
Type:
Bug
Submit Date:
2004-12-08
Status:
Resolved
Updated Date:
2010-05-10
Project Name:
JDK
Resolved Date:
2005-04-25
Component:
tools
OS:
generic
Sub-Component:
javap
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.4.2
Fixed Versions:
1.4.2_09 (b01)

Related Reports
Relates:

Sub Tasks

Description
The 1.4.2 version of javap prints signatures of certain methods incorrectly. The 1.4.1 and 1.5 versions of the tool function correctly.

To reproduce the problem, extract the attached jogl.jar (from http://jogl.dev.java.net) and run

javap -classpath jogl.jar net.java.games.jogl.GLU | grep gluProject

The incorrect output printed with the 1.4.2 javap is

    public abstract boolean gluProject(double,double,double,double[]);
    public abstract boolean gluProject(double,double,double,double[]);

The correct output printed with the 1.4.1 or 1.5 versions of javap is

    public abstract boolean gluProject(double, double, double, double[], double[], int[], double[], double[], double[]);
    public abstract boolean gluProject(double, double, double, double[], double[], int[], double[]);

This bug was reported by end users and is very confusing to them. The fix from the 1.5 workspace should be backported to a 1.4.2 update release.

###@###.### 2004-12-08 00:31:16 GMT

                                    

Comments
EVALUATION

This is fixed in jdk 5.0 (see 4949529).

###@###.### 2004-12-08 06:18:54 GMT
                                     
2004-12-08
SUGGESTED FIX

This is the fix from tiger-b30:

Index: src/share/classes/sun/tools/javap/TypeSignature.java
===========================================================
@@ -108,7 +108,7 @@
 		    
 		}
 	
-		int stotherparam = parameterdes.lastIndexOf("[")+1;
+		int stotherparam = param.lastIndexOf("[")+1;
 		
 		if(stotherparam < parameterdes.length()){
 		    componentType =  parameterdes.substring(stotherparam);

###@###.### 2004-12-08 06:18:55 GMT
                                     
2004-12-08



Hardware and Software, Engineered to Work Together