File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 44
55import java .text .*;
66import java .util .*;
7- import java .util .logging .*;
87import java .util .regex .*;
98
109import org .bson .*;
1110import org .bson .types .*;
11+
1212import com .mongodb .*;
1313
1414public class JSONCallback extends BasicBSONCallback {
1515
16+ @ Override
1617 public BSONObject create (){
1718 return new BasicDBObject ();
1819 }
1920
20- public BSONObject create ( boolean array , List <String > path ){
21- if ( array )
22- return new BasicDBList ();
23- return new BasicDBObject ();
21+ @ Override
22+ protected BSONObject createList () {
23+ return new BasicDBList ();
2424 }
25-
25+
2626 public void objectStart (boolean array , String name ){
2727 _lastArray = array ;
2828 super .objectStart ( array , name );
Original file line number Diff line number Diff line change 33package org .bson ;
44
55import java .util .*;
6- import java .util .regex .* ;
6+ import java .util .regex .Pattern ;
77
88import org .bson .types .*;
99
@@ -17,14 +17,18 @@ public BSONObject create(){
1717 return new BasicBSONObject ();
1818 }
1919
20+ protected BSONObject createList () {
21+ return new BasicBSONList ();
22+ }
23+
2024 public BSONCallback createBSONCallback (){
2125 return new BasicBSONCallback ();
2226 }
2327
2428 public BSONObject create ( boolean array , List <String > path ){
2529 if ( array )
26- return new BasicBSONList ();
27- return new BasicBSONObject ();
30+ return createList ();
31+ return create ();
2832 }
2933
3034 public void objectStart (){
You can’t perform that action at this time.
0 commit comments