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

Incorrect integer comparison in version numbers

XMLWordPrintable

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

                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;
                }

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

                Created:
                Updated:
                Resolved: