Skip to content

Commit 0832cd1

Browse files
committed
Fixed BSONTest.testUTF8 so that it compiles with Java 6.
1 parent 605a062 commit 0832cd1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/test/org/bson/BSONTest.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,14 @@ public void testOBBig1(){
164164
public void testUTF8() {
165165
for (int i = 1; i <= Character.MAX_CODE_POINT; i++) {
166166

167-
if (!Character.isValidCodePoint(i)) {
168-
continue;
169-
}
170-
171-
if (Character.isSurrogate((char) i)) {
167+
if (Character.getType(i) == Character.SURROGATE) {
172168
continue;
173169
}
174170

175171
String orig = new String(Character.toChars(i));
176172
BSONObject a = new BasicBSONObject(orig, orig);
177173
BSONObject b = BSON.decode(BSON.encode(a));
178-
assertEquals(a, b);
174+
assertEquals("Could not round trip code point " + i, a, b);
179175
}
180176
}
181177

0 commit comments

Comments
 (0)