ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/ConcurrentHashMapTest.java
(Generate patch)

Comparing jsr166/src/test/tck/ConcurrentHashMapTest.java (file contents):
Revision 1.57 by jsr166, Sun Jan 7 22:59:18 2018 UTC vs.
Revision 1.58 by jsr166, Mon Jan 8 03:37:59 2018 UTC

# Line 56 | Line 56 | public class ConcurrentHashMapTest exten
56          return map;
57      }
58  
59    /** Re-implement Integer.compare for old java versions */
60    static int compare(int x, int y) {
61        return (x < y) ? -1 : (x > y) ? 1 : 0;
62    }
63
59      // classes for testing Comparable fallbacks
60      static class BI implements Comparable<BI> {
61          private final int value;
62          BI(int value) { this.value = value; }
63          public int compareTo(BI other) {
64 <            return compare(value, other.value);
64 >            return Integer.compare(value, other.value);
65          }
66          public boolean equals(Object x) {
67              return (x instanceof BI) && ((BI)x).value == value;
# Line 100 | Line 95 | public class ConcurrentHashMapTest exten
95                      break;
96              }
97              if (r == 0)
98 <                r = compare(size(), other.size());
98 >                r = Integer.compare(size(), other.size());
99              return r;
100          }
101          private static final long serialVersionUID = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines