United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6587786 Javap throws error : "ERROR:Could not find <classname>" for JRE classes
JDK-6587786 : Javap throws error : "ERROR:Could not find " for JRE classes

Details
Type:
Bug
Submit Date:
2007-08-01
Status:
Closed
Updated Date:
2011-05-18
Project Name:
JDK
Resolved Date:
2011-05-18
Component:
tools
OS:
windows_2000
Sub-Component:
javap
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports

Sub Tasks

Description
FULL PRODUCT VERSION :
C:\Program Files\Java\jdk1.6.0_02\bin>java -version
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b06)
Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
C:\Program Files\Java\jdk1.6.0_02\bin>ver

Microsoft Windows 2000 [Version 5.00.2195]

EXTRA RELEVANT SYSTEM CONFIGURATION :
  Bug also reproduces on a GNU/Linux box.

A DESCRIPTION OF THE PROBLEM :
javap is supposed to be able to handle miltiple class-names as its argument-list. However, for certain jre classes, the order seems to matter, as demonstrated below. The first time it works, whereas, with the same two class-names given in the other order, it reports an incorrect error.


C:\Program Files\Java\jdk1.6.0_02\bin>javap com.sun.image.codec.jpeg.ImageFormatException com.sun.crypto.provider.ai
Compiled from "ImageFormatException.java"
public class com.sun.image.codec.jpeg.ImageFormatException extends java.lang.RuntimeException{
    public com.sun.image.codec.jpeg.ImageFormatException();
    public com.sun.image.codec.jpeg.ImageFormatException(java.lang.String);
}

Compiled from "DashoA13*.."
final class com.sun.crypto.provider.ai extends javax.crypto.SealedObject{
    static final long serialVersionUID;
    com.sun.crypto.provider.ai(javax.crypto.SealedObject);
    java.lang.Object readResolve()       throws java.io.ObjectStreamException;
}


C:\Program Files\Java\jdk1.6.0_02\bin>javap com.sun.crypto.provider.ai com.sun.image.codec.jpeg.ImageFormatException
ERROR:Could not find com.sun.image.codec.jpeg.ImageFormatException

This bug seems to be there since, at-least, 1.4.2_12:

[vivek@laptop phd]$ /usr/java/j2sdk1.4.2_12/bin/javap sun.text.resources.DateFormatZoneData_th
Compiled from "DateFormatZoneData_th.java"
public final class sun.text.resources.DateFormatZoneData_th extends sun.text.resources.DateFormatZoneData{
public sun.text.resources.DateFormatZoneData_th();
public java.lang.Object[][] getContents();
}
[vivek@laptop phd]$ /usr/java/j2sdk1.4.2_12/bin/javap sun.text.resources.DateFormatZoneData_tr
Compiled from "DateFormatZoneData_tr.java"
public final class sun.text.resources.DateFormatZoneData_tr extends sun.text.resources.DateFormatZoneData{
public sun.text.resources.DateFormatZoneData_tr();
public java.lang.Object[][] getContents();
}
[vivek@laptop phd]$ /usr/java/j2sdk1.4.2_12/bin/javap sun.text.resources.DateFormatZoneData_tr sun.text.resources.DateFormatZoneData_th
Compiled from "DateFormatZoneData_tr.java"
public final class sun.text.resources.DateFormatZoneData_tr extends sun.text.resources.DateFormatZoneData{
public sun.text.resources.DateFormatZoneData_tr();
public java.lang.Object[][] getContents();
}
Compiled from "DateFormatZoneData_th.java"
public final class sun.text.resources.DateFormatZoneData_th extends sun.text.resources.DateFormatZoneData{
public sun.text.resources.DateFormatZoneData_th();
public java.lang.Object[][] getContents();
}
[vivek@laptop phd]$ /usr/java/j2sdk1.4.2_12/bin/javap sun.text.resources.DateFormatZoneData_th sun.text.resources.DateFormatZoneData_tr
ERROR:Could not find sun.text.resources.DateFormatZoneData_tr
 
Similarly, the bug has been verified with 1.5.0_08, with the same arguments as for 1.6.0_02. The bug was originally detected on a GNU/linux (Fedora distribution) machine, and reconfirmed on a Windows platform.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See description above.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
All invocations of javap in the description above should pass, whereas only some of them pass, whereas some others fail with an error that is not appropriate.
ACTUAL -
See description above.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
See description above.

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Swap arguments !

                                    

Comments
EVALUATION

The bug has been reproduced, exactly as described, on Linux/Ubuntu Gutsy Gibbon.
However, the bug does does manifest itself with the new javap, which is not surprising, since the front end has been changed to use the javac FileManager (and not the old ad hoc code.

Therefore the bug is deemed trivially fixed.
                                     
2008-02-17



Hardware and Software, Engineered to Work Together