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

Issues with DottedVersion class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 23
    • 23
    • tools
    • b26
    • generic
    • generic

      "!=" operator is used to compare two BigInteger-s instead of BigInteger#equails() at [1].

      Fixing the issue made unit tests fail. So the unit tests need to be updated.

      DottedVersion implements Comparable<String> interface. That is wrong, it should be Comparable<DottedVersion>.

      If it implements Comparable, it should also override Object#equals. DottedVersion has "greedy" field that makes implementation of DottedVersion#equals ambiguous.

      DottedVersion doesn't allow capturing unrecognizable remainder of the version string. This will be handy when parsing WiX4 version string which is "4.0.5+b9b2f1b4"

      A lot of issues with the class implementation and supported functionality.

      [1] https://github.com/openjdk/jdk/blob/ec88c6a872a97cee1cde8844f5ee6834023a10c6/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DottedVersion.java#L137

            asemenyuk Alexey Semenyuk
            asemenyuk Alexey Semenyuk
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: