[
https://issues.apache.org/jira/browse/MJAVADOC-152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17957544#comment-17957544
]
Olivier Lamy commented on MJAVADOC-152:
---------------------------------------
This project has moved from Jira to GitHub Issues. This issue was migrated to
[apache/maven-javadoc-plugin#542|https://github.com/apache/maven-javadoc-plugin/issues/542].
> Javadoc plugin fails when -J-fullversion returns localized version string
> -------------------------------------------------------------------------
>
> Key: MJAVADOC-152
> URL: https://issues.apache.org/jira/browse/MJAVADOC-152
> Project: Maven Javadoc Plugin (Moved to GitHub Issues)
> Issue Type: Bug
> Affects Versions: 2.2
> Environment: FreeBSD
> Reporter: Matt Whitlock
> Assignee: Siveton Vincent
> Priority: Major
> Attachments: AbstractJavadocMojo.java.patch
>
>
> On Mac OS X:
> $ javadoc -J-fullversion
> java full version "1.5.0_07-164"
> On FreeBSD:
> > javadoc -J-fullversion
> java full version "diablo-1.5.0-b01"
> The difference causes this exception:
> java.lang.NumberFormatException: For input string: "dial"
> at
> sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224)
> at java.lang.Float.parseFloat(Float.java:394)
> at
> org.apache.maven.plugin.javadoc.AbstractJavadocMojo.getJavadocVersion(AbstractJavadocMojo.java:2966)
> ...
> See attached patch for a more robust way of parsing the output from 'javadoc
> -J-fullversion'.
> Do note that both the original code and the patched code will have problems
> with Java versions like 1.10.0 or 1.6.10. The original code will fail with
> an exception, while the patched code will return a somewhat nonsensical value
> from the getJavadocVersion method. The Java version logically should not be
> expressed as a float because semantically it is not a floating-point number
> but rather an integer vector. A more appropriate return type for the
> getJavadocVersion method would be int[].
--
This message was sent by Atlassian Jira
(v8.20.10#820010)