We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 857b6b5 commit 8b595d7Copy full SHA for 8b595d7
1 file changed
src/main/com/mongodb/util/JSON.java
@@ -2,6 +2,7 @@
2
3
package com.mongodb.util;
4
5
+import java.lang.reflect.*;
6
import java.text.*;
7
import java.util.*;
8
import java.util.regex.*;
@@ -166,13 +167,11 @@ public static void serialize( Object o , StringBuilder buf ){
166
167
}
168
169
if ( o.getClass().isArray() ){
- Object[] arr = (Object[])o;
170
-
171
buf.append( "[ " );
172
173
- for ( int i=0; i<arr.length; i++) {
+ for ( int i=0; i<Array.getLength( o ); i++) {
174
if ( i > 0 ) buf.append( " , " );
175
- serialize( arr[i] , buf );
+ serialize( Array.get( o , i ) , buf );
176
177
178
buf.append( "]" );
0 commit comments