JDK-4670772 : tool: Crashes when test file of unnamed package included in source dir
  • Type: Bug
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: other
  • CPU: generic
  • Submitted: 2002-04-18
  • Updated: 2002-09-28
  • Resolved: 2002-09-28
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.
Other
1.4.2 mantisFixed
Description
Javadoc crash.

Our javadoc was working fine before we upgraded from 1.3.1 
to 1.4.0. Now it seems a lot of our test programs are all
getting the same error shown below. Since the test
programs are all java apps they are not in packages but
they do sit in package directories since they are designed
to test classes in a particular package. The jvm 1.4.0 javac
did not have any issue with these test programs. 
But now I have had to add a package statement to all of
them. And now we have to update all of our references to 
them to invoke them from the root of the classpath and 
to invoke them with the necessary package path as well.
So just wanted to confirm that there was some change 
made in javadoc 1.4.0 version from 1.3.x that would
explain this?
        thanks,

/usr/java1.4.0/bin/javadoc -classpath /vobs/sas/src/servlets:/vobs/sas/src:/sas/
packages/sslava/sslava.jar:/sas/packages/jrun/lib/ext/servlet.jar:/sas/packages/
ldap_jsdk/packages/ldapjdk.jar:/sas/packages/ldap_jsdk/packages/ldapfilt.jar:/at
t/oracle/app/oracle/product/8.1.6/jdbc/lib/jndi.zip:/att/oracle/app/oracle/produ
ct/8.1.6/jdbc/lib/classes12.zip:/usr/java1.4.0/lib/tools.jar:/vobs/sas/src/jars/
controlUI.jar \                                                                 
-J-Xmx64m \                                                                     
-nodeprecated \                                                                 
-version \                                                                      
-author \                                                                       
-windowtitle 'SAS Javadoc' \                                                    
-d /vobs/sas/build/docs/javadoc \                                               
-header "<H2>SAS Java Documentation</H2>" \                                     
-group "SAS Business Objects Package" "com.att.sas.bizobjs" \                   
-group "SAS Cookie Package" "com.att.sas.cookie" \                              
-group "SAS CSG Package" "com.att.sas.csg" \                                    
-group "SAS Database Package" "com.att.sas.db" \                                
-group "SAS DHCP Package" "com.att.sas.dhcp" \                                  
-group "SAS DHCP Log Package" "com.att.sas.dhcpdmn" \                           
-group "SAS ISP Package" "com.att.sas.isp" \                                    
-group "SAS JSP Utilities Package" "com.att.sas.jsputil" \                      
-group "SAS Java Utilities Package" "com.att.sas.javautil" -group "SAS Magnolia Client Package" "com.att.sas.magc" \                       
-group "SAS OA&M Package" "com.att.sas.oam" \                                   
-group "SAS OneComm Message Package" "com.att.sas.onecomm" \                    
-group "SAS Properties Package" "com.att.sas.properties" \                      
-group "SAS Process Queue Package" "com.att.sas.queue" \                        
-group "SAS Scope Management Package" "com.att.sas.scopes" \                    
-group "SAS Socket Package" "com.att.sas.socket" \                              
-group "SAS CableTel Package" "com.att.sas.tel" \                               
-group "SAS Utilities Package" "com.att.sas.utilities" \                        
/vobs/sas/src/com/att/sas/admin/ATTAdminServlet.java \                          
/vobs/sas/src/com/att/sas/auth/ATTAuthServlet.java \                            
/vobs/sas/src/com/att/sas/ispredirector/SasRedirector.java \                    
/vobs/sas/src/install/LoadDBsyserror.java \                                     
/vobs/sas/src/com/att/sas/bizobjs/CableTelAccount.java \                        
/vobs/sas/src/com/att/sas/bizobjs/HighSpeedDataAccount.java \                   
/vobs/sas/src/com/att/sas/bizobjs/ServicePackage.java \                         
/vobs/sas/src/com/att/sas/bizobjs/Policy.java \                                 
/vobs/sas/src/com/att/sas/bizobjs/Scope.java \                                  
/vobs/sas/src/com/att/sas/bizobjs/IspFeatPackage.java \                         
/vobs/sas/src/com/att/sas/bizobjs/DataFeatPackage.java \                        
com.att.sas.cookie \                                                            
com.att.sas.csg \                                                               
com.att.sas.db  \                                                               
com.att.sas.dhcp  \                                                             
com.att.sas.dhcpdmn \                                                           
com.att.sas.isp \                                                               
com.att.sas.jsputil \                                                           
com.att.sas.javautil \                                                          
com.att.sas.magc \                                                              
com.att.sas.oam \                                                               
com.att.sas.onecomm \                                                           
com.att.sas.properties \                                                        
com.att.sas.queue \                                                             
com.att.sas.scopes \                                                            
com.att.sas.socket \                                                            
com.att.sas.tel \                                                               
com.att.sas.utilities                                                           
Loading source file /vobs/sas/src/com/att/sas/admin/ATTAdminServlet.java...     
Loading source file /vobs/sas/src/com/att/sas/auth/ATTAuthServlet.java...       
Loading source file /vobs/sas/src/com/att/sas/ispredirector/SasRedirector.java..
.                                                                               
Loading source file /vobs/sas/src/install/LoadDBsyserror.java...                
Loading source file /vobs/sas/src/com/att/sas/bizobjs/CableTelAccount.java...   
Loading source file /vobs/sas/src/com/att/sas/bizobjs/HighSpeedDataAccount.java.
..                                                                              
Loading source file /vobs/sas/src/com/att/sas/bizobjs/ServicePackage.java...    
Loading source file /vobs/sas/src/com/att/sas/bizobjs/Policy.java...            
Loading source file /vobs/sas/src/com/att/sas/bizobjs/Scope.java...             
Loading source file /vobs/sas/src/com/att/sas/bizobjs/IspFeatPackage.java...    
Loading source file /vobs/sas/src/com/att/sas/bizobjs/DataFeatPackage.java...   
Loading source files for package com.att.sas.cookie...                          
Loading source files for package com.att.sas.csg...                             
Loading source files for package com.att.sas.db...                              
Loading source files for package com.att.sas.dhcp...                            
Loading source files for package com.att.sas.dhcpdmn...                         
Loading source files for package com.att.sas.isp...                             
Loading source files for package com.att.sas.jsputil...                         
Loading source files for package com.att.sas.javautil...                        
Loading source files for package com.att.sas.magc...                            
Loading source files for package com.att.sas.oam...                             
Loading source files for package com.att.sas.onecomm...                         
Loading source files for package com.att.sas.properties...                      
Loading source files for package com.att.sas.queue...                           
Loading source files for package com.att.sas.scopes...                          
Loading source files for package com.att.sas.socket...                          
Loading source files for package com.att.sas.tel...                             
Loading source files for package com.att.sas.utilities...                       
Constructing Javadoc information...                                             
javadoc: In doclet class com.sun.tools.doclets.standard.Standard,  method start 
has thrown an exception java.lang.reflect.InvocationTargetException             
com.sun.tools.javac.v8.code.ClassReader$BadClassFile: bad class file: /vobs/sas/
src/com/att/sas/csg/SSLTest.class                                               
class file contains wrong class: SSLTest                                        
Please remove or make sure it appears in the correct subdirectory of the classpa
th.                                                                             
    at com.sun.tools.javac.v8.code.ClassReader.badClassFile(ClassReader.java:248
)                                                                               
    at com.sun.tools.javac.v8.code.ClassReader.readClass(ClassReader.java:796)  
    at com.sun.tools.javac.v8.code.ClassReader.readClassFile(ClassReader.java:87
8)                                                                              
    at com.sun.tools.javac.v8.code.ClassReader.fillIn(ClassReader.java:1010)    
    at com.sun.tools.javac.v8.code.ClassReader.complete(ClassReader.java:977)   
    at com.sun.tools.javac.v8.code.Symbol.complete(Symbol.java:375)             
    at com.sun.tools.javac.v8.code.Symbol$ClassSymbol.complete(Symbol.java:697) 
    at com.sun.tools.javac.v8.code.Symbol$ClassSymbol.flags(Symbol.java:594)    
    at com.sun.tools.javadoc.ClassDocImpl.isSynthetic(ClassDocImpl.java:234)    
    at com.sun.tools.javadoc.PackageDocImpl.getClasses(PackageDocImpl.java:127) 
    at com.sun.tools.javadoc.PackageDocImpl.addAllClassesTo(PackageDocImpl.java:
142)                                                                            
    at com.sun.tools.javadoc.RootDocImpl.classes(RootDocImpl.java:168)          
    at com.sun.tools.doclets.standard.ConfigurationStandard.setSpecificDocletOpt
ions(ConfigurationStandard.java:268)                                            
    at com.sun.tools.doclets.Configuration.setOptions(Configuration.java:246)   
    at com.sun.tools.doclets.standard.Standard.startGeneration(Standard.java:72)
    at com.sun.tools.doclets.standard.Standard.start(Standard.java:44)          
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)              
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
:39)                                                                            
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI
mpl.java:25)                                                                    
    at java.lang.reflect.Method.invoke(Method.java:324)                         
    at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:196)       
    at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:95)         
    at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:288)
    at com.sun.tools.javadoc.Start.begin(Start.java:114)  
    at com.sun.tools.javadoc.Main.execute(Main.java:44)   
    at com.sun.tools.javadoc.Main.main(Main.java:34)      
1 error                                                   

His email reply to a request for more info...

And finally more info on the crash.
Believe it would be simple for you to reproduce
based on my fix. 

Take any working class in a package.
Now create a test java app that calls it and put it
in same dir but dont have any package statement in it.
Now run javadoc from classpath root and give it the
package dir to process. When it hits the test program
in that dir you should see error above.

And to answer your crash questions.
The Makefile is run in the package dir
(/vobs/sas/src/com/att/sas/csg), and produces the
SSLTest.class file in that dir from the SSLTest.java file in 
that dir. When javadoc is run we feed it our standard 
classpath so that includes the classpath root dir 
(/vobs/sas/src) but not the packages dirs.
Then we feed it all package dirs to process, so in this
case it blew up while trying to process com/att/sas/csg.

Let me know if this isnt clear.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mantis FIXED IN: mantis INTEGRATED IN: mantis mantis-b03
14-06-2004

PUBLIC COMMENTS ...
10-06-2004

EVALUATION I replied to the submitter about the requirement to put the source file in a directory named after the package. I also asked him to provide a test case and more information, such as in what directory the test .class files are located. ###@###.### 2002-04-18
18-04-2002