RFR[9] 8160956: Runtime.Version.compareTo/compareToIgnoreOpt problem

Pavel Rappo pavel.rappo at oracle.com
Thu Mar 16 15:17:03 UTC 2017


Hello,

Please review the following trivial change for [1]:

  http://cr.openjdk.java.net/~prappo/8160956/webrev.00/

The code change fixes the implementation and makes it adhere to the
specification for Version comparison:

    /**
     * Compares this version to another.
     *
        ...
     * <p> A version without a build number is always less than one with a
     * build number; otherwise build numbers are compared numerically. </p>
        ...
     */
    @Override
    public int compareTo(Version ob)

The existing test was incorrectly testing these cases. So rather than bringing
the test case provided in the linked issue, I updating those existing cases.

The patch also fixes a bunch of javadoc typos.

P.S. While we are in this area, may I ask if anybody knows why exactly Version
class has lost its 'final' modifier while moving from 'jdk' package to
'java.lang' [2]?

Thanks,
-Pavel

--------------------------------------------------------------------------------
[1] https://bugs.openjdk.java.net/browse/JDK-8160956
[2] https://bugs.openjdk.java.net/browse/JDK-8144062



More information about the core-libs-dev mailing list