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.32 by jsr166, Wed Jun 12 18:09:00 2013 UTC vs.
Revision 1.33 by jsr166, Sun Jul 14 21:41:06 2013 UTC

# Line 34 | Line 34 | public class ConcurrentHashMapTest exten
34          return map;
35      }
36  
37 +    /** Re-implement Integer.compare for old java versions */
38 +    static int compare(int x, int y) { return x < y ? -1 : x > y ? 1 : 0; }
39 +
40      // classes for testing Comparable fallbacks
41      static class BI implements Comparable<BI> {
42          private final int value;
43          BI(int value) { this.value = value; }
44          public int compareTo(BI other) {
45 <            return Integer.compare(value, other.value);
45 >            return compare(value, other.value);
46          }
47          public boolean equals(Object x) {
48              return (x instanceof BI) && ((BI)x).value == value;
# Line 73 | Line 76 | public class ConcurrentHashMapTest exten
76                      break;
77              }
78              if (r == 0)
79 <                r = Integer.compare(size(), other.size());
79 >                r = compare(size(), other.size());
80              return r;
81          }
82          private static final long serialVersionUID = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines