jdk8 javadoc tool issue - IllegalStateException: endPosTable already set
Kumar Srinivasan
kumar.x.srinivasan at oracle.com
Sat Mar 15 01:10:41 UTC 2014
Hello Neon,
First of all thanks for the compact reproducer!, well done, nice
and neat.
It is not the same issue as JDK-8029145, therefore, I have filed an
issue for it:
https://bugs.openjdk.java.net/browse/JDK-8037484
I will fix this in the forthcoming weeks and back-port it to 8u-dev as
well.
Once again thanks for bringing this to our attention.
Kumar
On 3/14/2014 2:30 PM, Neon Ngo wrote:
> Sorry for the delay in getting this test case.
> I think the culprit might be a combo of my class (in default) package
> that has an inner class.
>
> Under Unix (e.g. Linux):
> 1. define JAVA_HOME system variable to point to JDK8
> 2. cd to extracted folder
> 3. run ./doit.sh (which just calls javadoc using full paths to
> current working directory)
>
> Here are the zip file contents (just in case the attachment gets blocked):
> .
> |-- doit.sh
> `-- test
> |-- InPackage.java
> `-- NotInPackageWithNestedClass.java
>
> === BEGIN contents of test/InPackage.java ===
> package test;
>
> /** a class in a package */
> public class InPackage {
>
> /** the main method */
> public static void main (String[] args) throws Exception {
> System.out.println("test javadoc bug (class in a package)");
> }
> }
> === END contents of test/InPackage.java ===
>
> === BEGIN contents of test/NotInPackageWithNestedClass.java ===
> import java.io.*;
>
> /**
> This class is in the default package (aka not in any package).
> */
> public final class NotInPackageWithNestedClass {
>
> public static void main (String[] args) throws Throwable {
> }
>
> //////////////////////////////////////////////////////////////////////////////
> // NESTED CLASS
> //////////////////////////////////////////////////////////////////////////////
> private static final class JarFilter implements FilenameFilter {
> public boolean accept(java.io.File dir, String name) {
> return name.endsWith(".jar");
> }
> } // end class JarFilter
>
> } // end class NotInPackage
> === END contents of test/NotInPackageWithNestedClass.java ===
>
> === BEGIN contents of doit.sh ===
> #!/bin/sh
>
> outputdir=${PWD}/outputdir
> cp1=${PWD}/test
> cp2=${PWD}
> JAVADOC_TOOL=${JAVA_HOME}/bin/javadoc
>
> # shows JDK8's javadoc tool issue with two classes in test directory:
> NotInPackage.java and InPackage.java)
> ${JAVADOC_TOOL} -classpath ${cp1}:${cp2} -d ${outputdir}
> ${PWD}/test/NotInPackageWithNestedClass.java test
>
> === END contents of doit.sh ===
>
> Regards,
>
> Neon
>
>
>
> On Mon, Feb 3, 2014 at 5:50 PM, Kumar Srinivasan
> <kumar.x.srinivasan at oracle.com <mailto:kumar.x.srinivasan at oracle.com>>
> wrote:
>
> Hi Neon,
>
> I spent some time trying to reproduce the problem, but could not.
> Can you provide me with a simple reproducer ?
>
> Thanks
> Kumar
>
>
> On 1/24/2014 7:31 AM, Neon Ngo wrote:
>
> Hi,
>
> we are seeing this error using JDK 8 EA b124 (b123, etc.)
> using the javadoc tool.
>
> java.lang.IllegalStateException: endPosTable already set
> at
> com.sun.tools.javac.util.DiagnosticSource.setEndPosTable(DiagnosticSource.java:136)
> at com.sun.tools.javac.util.Log.setEndPosTable(Log.java:350)
> at
> com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:643)
> at
> com.sun.tools.javadoc.JavadocTool.parsePackageClasses(JavadocTool.java:243)
> at
> com.sun.tools.javadoc.JavadocTool.getRootDocImpl(JavadocTool.java:180)
> at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:344)
> at com.sun.tools.javadoc.Start.begin(Start.java:219)
> at com.sun.tools.javadoc.Start.begin(Start.java:205)
> at com.sun.tools.javadoc.Main.execute(Main.java:64)
> at com.sun.tools.javadoc.Main.main(Main.java:54)
> javadoc: error - fatal exception
>
> ===
> it is similar to BUG JDK-8029145
> javadoc fails with java.lang.IllegalStateException:
> endPosTable already set
>
> but we are NOT using the -subpackages option
>
> I think our issue is b/c we have a directory (tools) that has
> a class NOT in that package and others in it,
> e.g.
>
> <my_project_dir>/tools/ClassInDefaultPackage.java (not in any
> package)
> <my_project_dir>/tools/ClassInToolsPackage.java (in tools package)
>
> then we run javaodc with -classpath
> <my_project_dir>/tools:<my_project_dir>
> <my_project_dir>/tools/ClassInDefaultPackage.java tools
>
> and it gets the above error (this works fine in ALL JDK
> versions (1.0 to 1.7) prior to JDK 8 EA.
>
> How do I submit a Bug for this issue are add comments to
> JDK-8029145 ?
>
> Regards,
>
> Neon
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/javadoc-dev/attachments/20140314/8b5feb81/attachment-0001.html>
More information about the javadoc-dev
mailing list