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