JDK-4697113 : empty jarfile in classpath breaks javadoc
  • Type: Bug
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 1.2.0,1.4.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux,windows_nt
  • CPU: x86
  • Submitted: 2002-06-04
  • Updated: 2014-05-05
  • Resolved: 2002-09-02
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
Related Reports
Duplicate :  
Duplicate :  
Description

Name: nt126004			Date: 06/04/2002


FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)


FULL OPERATING SYSTEM VERSION :
generic

ADDITIONAL OPERATING SYSTEMS :

Linux draught.bbn.com 2.4.19-pre8 #1 SMP Tue May 21 14:23:08
EDT 2002 i686 unknown

A DESCRIPTION OF THE PROBLEM :
I am actually submitting several bug reports on different
problems I encountered trying to produce a minimal test
case.  I've used jar to package a single set of files as
examples for all the associated bug reports.

When running javadoc in a large autobuild process, I see a
number of messages like:
  server.jar: Body tag missing from HTML
  1 error

  To further narrow the scope of the problem, I tried removing
all the classfiles from my jar file, leaving only a
"package.html" file.  The result is in "empty.jar".  This
causes javadoc to throw an exception.

  Bug 5: an empty jar file on the classpath will break
javadoc, even if the jar has nothing that the javadoc run
requires.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
The minimal examples may be found at:
http://www.alpine.bbn.com/~mthome/javadocbug.jar
grab the the above file and unpack it into a clean directory
of your choosing.  It contains some .java files and some
.jar files used in the various "steps to reproduce" sections.
% cd /tmp/foo
% jar xf /tmp/javadocbug.jar
% mkdir api
# test 1
% javadoc -classpath server.jar -quiet -d api -sourcepath
src org.cougaar
Loading source files for package org.cougaar...
Constructing Javadoc information...
server.jar: Body tag missing from HTML
1 error

# test 5 (tests 2-4 is not relevant for this report)
% rm -rf api; mkdir api
% javadoc -classpath empty.jar -quiet -d api -sourcepath src
org.cougaarLoading source files for package org.cougaar...
Constructing Javadoc information...
javadoc: In doclet class
com.sun.tools.doclets.standard.Standard,
method start has thrown an exception
java.lang.reflect.InvocationTargetException
java.lang.NullPointerException
        at
java.util.zip.ZipFile.getInputStream(ZipFile.java:176)
...
(see the rest of the exception below)


EXPECTED VERSUS ACTUAL BEHAVIOR :
Actual:
see above

Expected:
test 5 should complete without error - there is nothing
wrong with a jar which contains only a perfectly legal
pacakge.html, even if were required by this javadoc run (and
it isn't).

ERROR MESSAGES/STACK TRACES THAT OCCUR :
test 1:
server.jar: Body tag missing from HTML

test 5:
javadoc: In doclet class com.sun.tools.doclets.standard.Standard,
method start has thrown an exception
java.lang.reflect.InvocationTargetException
java.lang.NullPointerException
        at java.util.zip.ZipFile.getInputStream(ZipFile.java:176)
        at
com.sun.tools.javadoc.PackageDocImpl.documentation(PackageDocImpl.java:76)
        at com.sun.tools.javadoc.DocImpl.comment(DocImpl.java:77)
        at com.sun.tools.javadoc.DocImpl.commentText(DocImpl.java:87)
        at com.sun.tools.javadoc.DocImpl.firstSentenceTags(DocImpl.java:124)
        at
com.sun.tools.doclets.standard.HtmlStandardWriter.printSummaryComment(HtmlStandardWriter.java:1528)
        at
com.sun.tools.doclets.standard.AbstractIndexWriter.printDescription(AbstractIndexWriter.java:113)
        at
com.sun.tools.doclets.standard.AbstractIndexWriter.generateContents(AbstractIndexWriter.java:94)
        at
com.sun.tools.doclets.standard.SingleIndexWriter.generateIndexFile(SingleIndexWriter.java:78)
        at
com.sun.tools.doclets.standard.SingleIndexWriter.generate(SingleIndexWriter.java:52)
        at
com.sun.tools.doclets.standard.Standard.startGeneration(Standard.java:120)
        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(DelegatingMethodAccessorImpl.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


This bug can be reproduced always.

---------- BEGIN SOURCE ----------
not relevant.  The source code used in the example can be anything at all to
generate the same error.
---------- END SOURCE ----------
(Review ID: 146963) 
======================================================================

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

EVALUATION Will be fixed for mantis. ###@###.### 2002-06-04 I have fixed this bug. The bug fix is pending review. ###@###.### 2002-07-08 This bug fix has passed approval.
04-06-2002

PUBLIC COMMENTS My testing shows that javadoc does not properly read package.html files from jar files. I will fix this bug asap. ###@###.### 2002-06-04 This bug has been fixed. ###@###.### 2002-07-15
04-06-2002