JDK-4767447 : Get a fatal error - "NullPointerException" when using Javadoc with "JFrame"
  • Type: Bug
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2002-10-23
  • Updated: 2014-05-05
  • Resolved: 2003-01-26
Related Reports
Duplicate :  
Description

Name: rmT116609			Date: 10/23/2002


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

FULL OPERATING SYSTEM VERSION : NT 4.0

A DESCRIPTION OF THE PROBLEM :
When I use "Javadoc" to generate documentation for my source code, I get a fatal error of "NullPointerException".  I discover that javadoc don't except "public class xxx extends JFrame" in my source code.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. run "javadoc TestJFrame.java" on the DOS-Prompt

EXPECTED VERSUS ACTUAL BEHAVIOR :
Should create a Java Documentation for this file.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Loading source file TestJFrame.java...
Constructing Javadoc information...
Standard Doclet version 1.4.0

Generating constant-values.html...
Building tree for all the packages and classes...
Building index for all the packages and classes...
Generating overview-tree.html...
Generating index-all.html...
Generating deprecated-list.html...
Building index for all classes...
Generating allclasses-frame.html...
Generating allclasses-noframe.html...
Generating index.html...
Generating packages.html...
Generating TestJFrame.html...
javadoc: In doclet class com.sun.tools.doclets.standard.Standard,  method start
has thrown an exception java.l
ang.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.tags(DocImpl.java:107)
        at com.sun.tools.doclets.standard.HtmlStandardWriter.serialDocInclude
(HtmlStandardWriter.java:1381)
        at com.sun.tools.doclets.standard.HtmlStandardWriter.serialInclude
(HtmlStandardWriter.java:1362)
        at com.sun.tools.doclets.standard.tags.SeeTaglet.toString
(SeeTaglet.java:105)
        at com.sun.tools.doclets.standard.HtmlStandardWriter.generateTagInfo
(HtmlStandardWriter.java:1494)
        at com.sun.tools.doclets.standard.ClassWriter.generateClassFile
(ClassWriter.java:234)
        at com.sun.tools.doclets.standard.ClassWriter.generate
(ClassWriter.java:95)
        at com.sun.tools.doclets.standard.Standard.generateClassCycle
(Standard.java:245)
        at com.sun.tools.doclets.standard.Standard.generateClassFiles
(Standard.java:195)
        at com.sun.tools.doclets.standard.Standard.startGeneration
(Standard.java:166)
        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)

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
/**
 * DESCRIPTION.
 *
 * <P>testing javadoc</P>
 *
 * @author Jessica Tong
 */
import javax.swing.*;

public class TestJFrame extends JFrame {

///////////////////////////////////////////////////////////////////////////////
// CONSTRUCTION & INITIALIZATION
	/**
	* Test JFrame in Javadoc
	*/
	public TestJFrame() {
		;
	}
	/**
	* Make the UI display
	*/
	public void display() {
		;
	}

}

---------- END SOURCE ----------
(Review ID: 163762) 
======================================================================

Comments
PUBLIC COMMENTS I cannot reproduce the bug using the given example in the bug report. I tried the example using javadoc 1.4.0 and 1.4.1. Both worked fine. I am pretty sure that the problem is being caused by something in the classpath. If you use "-classpath .", the tool should work without any problems. I have fixed this bug (4697113) in 1.4.1. If you upgrade your version of Javadoc, you will stop having this problem. ###@###.### 2003-01-26
26-01-2003

EVALUATION I don't know why this bug was assigned to the custom doclet catagory. It has not to do with custom doclets. I am marking this bug as a duplicate of: 4697113: jar files in classpath break javadoc. I cannot reproduce the bug using the given example in the bug report. I am pretty sure that the problem is being caused by something in the classpath. In previous versions of Javadoc, the tool would crash while trying to read package.html from a jar file in the classpath. I have fixed that problem. ###@###.### 2003-01-26
26-01-2003