Uploaded image for project: 'Maven Javadoc Plugin'
  1. Maven Javadoc Plugin
  2. MJAVADOC-488

Latest jdk9 version causes StringIndexOutOfBoundsException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.10.4
    • 3.0.0-M1, 3.0.0
    • None
    • None

    Description

      The latest jdk9 releases (9+176) from the Oracle early access program omits the -ea suffix which was present in previous releases (e.g. 9-ea+170). This is causing the javadoc plugin to throw a StringIndexOutOfBoundsException under org.apache.commons.lang.SystemUtils.<clinit>(). Here is the relevant exception backtrace:

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.4:jar (javadoc-jar) on project byteman-root: Execution javadoc-jar of goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.4:jar failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-javadoc-plugin:2.10.4:jar: java.lang.ExceptionInInitializerError: null
      
      [WARNING] Error injecting: org.apache.maven.plugin.javadoc.JavadocJar
      java.lang.ExceptionInInitializerError
              at org.apache.maven.plugin.javadoc.AbstractJavadocMojo.<clinit>(AbstractJavadocMojo.java:195)
              at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
              . . .
              at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
              at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
              at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
              at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      Caused by: java.lang.StringIndexOutOfBoundsException: begin 0, end 3, length 1
              at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3116)
              at java.base/java.lang.String.substring(String.java:1885)
              at org.apache.commons.lang.SystemUtils.getJavaVersionAsFloat(SystemUtils.java:1133)
              at org.apache.commons.lang.SystemUtils.<clinit>(SystemUtils.java:818)
              ... 58 more
      

      After stripping the +nnn suffix SystemUtils assumes it has at least 3 characters to play with (looking at the line number 1133 for the substring call this appears to be version 2.4 that is being linked). It seems that this worked by fluke when the string contained the "-ea" suffix but it is now thoroughly borked. Perhaps an upgrade to 2.6 might work?

      Attachments

        Issue Links

          Activity

            People

              rfscholte Robert Scholte
              adinn Andrew Dinn
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: