File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -161,18 +161,22 @@ public void testOBBig1(){
161161 }
162162
163163 @ Test
164- public void testUTF8 (){
165- for ( int i = 1 ; i <= Character .MAX_CODE_POINT ; i ++ ) {
166-
167- if ( ! Character .isValidCodePoint ( i ) )
164+ public void testUTF8 () {
165+ for (int i = 1 ; i <= Character .MAX_CODE_POINT ; i ++) {
166+
167+ if (! Character .isValidCodePoint (i )) {
168168 continue ;
169-
170- String orig = new String ( Character .toChars ( i ) );
171- BSONObject a = new BasicBSONObject ( orig , orig );
172- BSONObject b = BSON .decode ( BSON .encode ( a ) );
173- assertEquals ( a , b );
174- }
169+ }
175170
171+ if (Character .isSurrogate ((char ) i )) {
172+ continue ;
173+ }
174+
175+ String orig = new String (Character .toChars (i ));
176+ BSONObject a = new BasicBSONObject (orig , orig );
177+ BSONObject b = BSON .decode (BSON .encode (a ));
178+ assertEquals (a , b );
179+ }
176180 }
177181
178182 @ Test
You can’t perform that action at this time.
0 commit comments