United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4697113 : empty jarfile in classpath breaks javadoc

Details
Type:
Bug
Submit Date:
2002-06-04
Status:
Resolved
Updated Date:
2014-05-05
Project Name:
JDK
Resolved Date:
2002-09-02
Component:
tools
OS:
windows_nt,linux
Sub-Component:
javadoc(tool)
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.2.0,1.4.0
Fixed Versions:
1.4.2 (mantis)

Related Reports
Duplicate:
Duplicate:

Sub Tasks

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


                                     
2004-06-14
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.
                                     
2002-06-04
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
                                     
2002-06-04



Hardware and Software, Engineered to Work Together