Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8145793

Provide vendor-specific interpretation of a JDK version string

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 9
    • Fix Version/s: tbd
    • Component/s: core-libs
    • Labels:

      Description

      In the initial RFR for JDK-8072379 [0], an implementation of an Oracle-specific class, jdk.OracleVersion, was provided. The sole intent of jdk.OracleVersion was to provide interpretation of the fourth element of the version number. During review, it was determined that this class was unnecessary at this time.

      There may be a general need for a vendor-specific interpretation of a JDK version string. The following suggestion was provided as a potential solution to this problem:

      // API sketch
      public final class VendorVersion {
           public VendorVersion(String vendor, Version version, Comparator<Version> versionComp>) { ...}

           @Override
           public boolean equals(VendorVersion vv) {
               // Usual instance of checks
               return Objects.equals(vendor, vv.vendor()) && versionComp.version(), vv.version());
           }

           int compareVersion(VendorVersion vv) {
               if (!vendor.equals(vv.vendor()))
                   // throw an exception
               return versionComp(version, vv.version);
           }

           // ...
      }

      [0] http://mail.openjdk.java.net/pipermail/verona-dev/2015-November/000294.html

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                iris Iris Clark
                Reporter:
                iris Iris Clark
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: