Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1384

NPE from SystemUtils.isJavaVersionAtLeast under Java 11 EA

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.7
    • 3.8
    • None
    • None
    • Java 11 EA

    Description

      Calling, for example, SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_7); under the Java 11 early access release causes a NPE:

      java.lang.NullPointerException
      at org.apache.commons.lang3.SystemUtils.isJavaVersionAtLeast(SystemUtils.java:1654)
      

      This is:

      return JAVA_SPECIFICATION_VERSION_AS_ENUM.atLeast(requiredVersion);
      

      ... which implies that JAVA_SPECIFICATION_VERSION_AS_ENUM hasn't been resolved properly, although it looks like the code in JavaVersion intends to return JAVA_RECENT in the case of unknown versions.

      The java.specification.version system property is "11" in this environment.

      $ java -version
      java version "11-ea" 2018-09-18
      Java(TM) SE Runtime Environment 18.9 (build 11-ea+2)
      Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11-ea+2, mixed mode)

      Attachments

        Activity

          People

            erans Gilles Sadowski
            iay Ian Young
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: