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

Incorrect integer comparison in version numbers

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 9
    • 9
    • core-libs
    • None
    • 9
    • b162

    Backports

      Description

                private int compareVersion(Version ob) {
                    int size = version.size();
                    int oSize = ob.version().size();
                    int min = Math.min(size, oSize);
                    for (int i = 0; i < min; i++) {
                        Integer val = version.get(i);
                        Integer oVal = ob.version().get(i);
                      if (val != oVal) <<<<<
                            return val - oVal;
                    }
                    if (size != oSize)
                        return size - oSize;
                    return 0;
                }

        Attachments

          Issue Links

            Activity

              People

                prappo Pavel Rappo
                prappo Pavel Rappo
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: