prathappalukuru / doclava

Automatically exported from code.google.com/p/doclava
Apache License 2.0
0 stars 0 forks source link

Converter dies on a particular class #46

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
doclava dies on a particular class, org.apache.felix.framework.ServiceRegistry.

What steps will reproduce the problem?
1. Unzip the attached Maven project 
2. Run 'mvn javadoc:javadoc'
3. Have a sad :(

What is the expected output? What do you see instead?
The error is:

Exit code: 1 - javadoc: error - In doclet class com.google.doclava.Doclava,  
method start has thrown an exception java.lang.reflect.InvocationTargetException
java.lang.NullPointerException
    at com.sun.tools.javadoc.ClassDocImpl.getClassName(ClassDocImpl.java:341)
    at com.sun.tools.javadoc.ClassDocImpl.qualifiedName(ClassDocImpl.java:298)
    at com.google.doclava.ProjectBuilder.docToInfo(ProjectBuilder.java:288)
    at com.google.doclava.ProjectBuilder.obtainClass(ProjectBuilder.java:274)
    at com.google.doclava.ProjectBuilder.convertClasses(ProjectBuilder.java:218)
    at com.google.doclava.ProjectBuilder.initClass(ProjectBuilder.java:157)
    at com.google.doclava.ProjectBuilder.build(ProjectBuilder.java:70)
    at com.google.doclava.Doclava.start(Doclava.java:246)
    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:597)
    at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:269)
    at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:143)
    at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
    at com.sun.tools.javadoc.Start.begin(Start.java:128)
    at com.sun.tools.javadoc.Main.execute(Main.java:41)
    at com.sun.tools.javadoc.Main.main(Main.java:31)

What version of the product are you using? On what operating system?
This happens on doclava 1.0.3 and later.

Ubuntu 11.04 (also confirmed on OS X 10.7)

$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

Please provide any additional information below.

Debugging reveals com.google.doclava.Converter, line 86 as the problem:

cl.init3(Converter.convertTypes(c.typeParameters()), 
Converter.convertClasses(c.innerClasses(false)));

When ServiceRegistry hits this line, c.innerClasses(false) returns at first 
three inner class references, one of which is null. Dereferencing that null 
causes the problem. If I call c.innerClasses(false) *twice*, the first call 
returns the three inner class refs (including the null one), while the second 
call returns two valid inner class refs and the program goes happily on its way.

As the standard doclet has no trouble with this class, I assume it's something 
wrong in doclava, but I don't know what. 

It's also worth mentioning that on Oracle's Java 7, this problem is not extant 
-- c.innerClasses(false) returns only the two valid inner class references.

Original issue reported on code.google.com by ben.spea...@gmail.com on 11 Oct 2011 at 11:37

Attachments: