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

JavaVersion is not consistent with JEP-223

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.6
    • None
    • lang.*
    • None

    Description

      JEP 223: New Version-String Syntax introduces a new syntax for version strings.
      This syntax is sort-of not incompatible with JavaVersion in 3.5, but this is likely to change as soon as someone finds a bug in JDK 9 after it's released. There is a third specified version number component for security releases. Unlike the rest of the full version string, this component is significant for ordering, and cannot reliably be mapped to float.

      JEP 223 defines some regular expressions. It also defines an api class (java.lang.Runtime.Version). This class can't be used directly (since it's new with JDK-9), and the API can't be directly emulated, as it requires java.lang.Optional. However, it's not rocket science (it is however regular expressions, so now you have problems 2.0).

      I'll take a crack at a class implementing JEP-223 Versions and try to get them to play with JavaVersion.

      The existing mapping to float is unsuited to minor versions, so there has to be some new hackery for java 9 even for two components. ( JDK 9.11 should be > JDK 9.2 )

      Since there's no java minor releases yet, there's a bit of freedom. If the range of minor and patch versions is restricted to values between 0 and 99 there should be a way to make things work.

      Ideally the floaty stuff can be deprecated for removal before that matters.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sesuncedu Simon Spero
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: