Skip to content

Commit 71ab784

Browse files
committed
Removed use of Integer.compare and Long.compare, which are not available in Java 6.
1 parent 47c000b commit 71ab784

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

bson/src/main/org/bson/types/BsonInt32.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public BsonInt32(final int value) {
4141

4242
@Override
4343
public int compareTo(final BsonInt32 o) {
44-
return Integer.compare(value, o.value);
44+
return (value < o.value) ? -1 : ((value == o.value) ? 0 : 1);
4545
}
4646

4747
@Override

bson/src/main/org/bson/types/BsonInt64.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public BsonInt64(final long value) {
3939

4040
@Override
4141
public int compareTo(final BsonInt64 o) {
42-
return Long.compare(value, o.value);
42+
return (value < o.value) ? -1 : ((value == o.value) ? 0 : 1);
4343
}
4444

4545
@Override

0 commit comments

Comments
 (0)