Javadoc cross-compilation problem

Jonathan Gibbons jonathan.gibbons at oracle.com
Wed Apr 23 14:40:12 UTC 2014


Filed as JDK-8041628

https://bugs.openjdk.java.net/browse/JDK-8041628

-- Jon

On 04/23/2014 07:33 AM, Jonathan Gibbons wrote:
> Hmmm. That sounds like a bug.  Thanks for the report and the detailed 
> analysis.
>
> -- Jon
>
> On 04/23/2014 06:09 AM, Gilles Duboscq wrote:
>> Hello,
>>
>> When using jdk8 to generate javadoc for a 7 source base (some
>> paths/arguments replaced by ...):
>>
>> javadoc -J-Xmx2g -XDignore.symbol.file -classpath ... -quiet -d ...
>> -overview .../overview.html -sourcepath ... -source 1.7 -bootclasspath
>> /usr/java/jdk1.7.0_51/jre/lib/resources.jar:/usr/java/jdk1.7.0_51/jre/lib/rt.jar:/usr/java/jdk1.7.0_51/jre/lib/jsse.jar:/usr/java/jdk1.7.0_51/jre/lib/jce.jar:/usr/java/jdk1.7.0_51/jre/lib/charsets.jar:/usr/java/jdk1.7.0_51/jre/lib/jfr.jar 
>>
>> -extdirs /usr/java/jdk1.7.0_51/jre/lib/ext -tag test:X -tag run:X -tag
>> bug:X -tag summary:X -tag vmoption:X -XDignore.symbol.file
>> -windowtitle '...' ...
>>
>> I get the following error:
>>
>> javadoc: error -
>> com.sun.tools.doclets.internal.toolkit.util.DocletAbortException:
>> com.sun.tools.javac.code.Symbol$CompletionFailure: class file for
>> java.lang.FunctionalInterface not found
>>
>> The same sources compile fine on jdk7 and also generate javadoc fine
>> on jdk7. They also compile fine on jdk8 when setting -source 1.7,
>> -bootclasspath and -extdirs.
>>
>> I think the error is caused by the implementation of
>> RootDocImpl.isFunctionalInterface which calls toString on
>> env.syms.functionalInterfaceType which in turn calls
>> ClassType.getTypeArguments which calls complete().
>>
>> I tried to fix this by checking for env.source.allowLambda() before
>> doing the String comparison [1] and this fixed my problem. I tried
>> running javadoc on some other 8 and 7 source bases and didn't see any
>> problem with this patch.
>>
>> Regards,
>> -Gilles
>>
>> [1] http://cr.openjdk.java.net/~gdub/x-comp.patch
>



More information about the javadoc-dev mailing list