JDK-8145793 : Provide vendor-specific interpretation of a JDK version string
  • Type: Enhancement
  • Component: core-libs
  • Affected Version: 9
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2015-12-18
  • Updated: 2018-09-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
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