On Tue, Mar 20, 2018 at 08:51:32AM +0100, Ole Streicher wrote: Hello Ole,
> On 20.03.2018 05:20, tony mancill wrote: > > I'm in the midst of preparing an update for ant. Is there any context > > in which we want to add "--ignore-source-errors" to the ant javadoc > > task, or should this patch [1] be removed entirely? > > > > I am not familar with ant, so I can't recommend here. The failure seems > to not generally appear, but only on specific targets. > > This is the snippet that produces the error: > > <javadoc doclet="uk.ac.starlink.ttools.build.HtmlDoclet" > docletpathref="classpath" > failonerror="true" > public="true" > additionalparam="-headings" > destdir="${build.javadocs}" > sourcepath="${java.dir}" > packagenames="uk.ac.starlink.ttools.func" > classpathref="classpath" > encoding="cp1252"/> > > while this one (from another package, starjava-pal) works fine: > > <javadoc useexternalfile="yes" > destdir="${dist.javadocs}" > author="true" > version="true" > locale="en" > windowtitle="${Name} API" > doctitle="${Name}" > defaultexcludes="yes" > source="${source.version}" > classpathref="classpath"> > > So, it may have something to do with the doclet. You're definitely onto something here - thank you for the research. I enabled debug logging for maven and built checkstyle to get the full invocation of javadoc command that fails, and it also uses doclet. If I run those same command arguments sans the options related to doclet (-doclet, -docletpath, and -destfile), but still including --ignore-source-errors, and the javadoc invocation is successful. So, the bug seems to belong to the JDK and not to ant, very possibly in here [1]. I haven't tracked it down entirely yet, but I can reproduce the same behavior with --dump-on-error, which is another "HIDDEN" option. I think ToolOption.get() [2] probably returns null (because the option is hidden) and so we end up here [3], passing false for isToolOption to handleDocletOptions() when we need for it to be true. Perhaps the developer who added --ignore-source-errors and --dump-on-error didn't realize that the parser can't handle hidden options that don't start with '-XD'? In any event, that's all based on static analysis of the code. It'll take me a bit of time to verify and come up with a patch for the JDK. In the meantime, I don't know how many FTBFS problems it might cause if we reverted the --ignore-source-errors patch from ant, so I'm not sure whether we should change the current behavior or not. Cheers, tony [1] https://github.com/dmlloyd/openjdk/blob/zlib-bytebuffer-v9/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java#L795-L820 [2] https://github.com/dmlloyd/openjdk/blob/zlib-bytebuffer-v9/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java#L795-L796 [3] https://github.com/dmlloyd/openjdk/blob/zlib-bytebuffer-v9/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java#L819-L820
signature.asc
Description: PGP signature