File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,8 @@ public Object objectDone() {
114114 int type = (Integer ) b .get ("$type" );
115115 byte [] bytes = (new Base64Codec ()).decode ((String ) b .get ("$binary" ));
116116 o = new Binary ((byte ) type , bytes );
117+ } else if (b .containsField ("$numberLong" )) {
118+ o = Long .valueOf ((String ) b .get ("$numberLong" ));
117119 }
118120
119121 if (!isStackEmpty ()) {
Original file line number Diff line number Diff line change @@ -121,6 +121,12 @@ public void refParsing() {
121121 assertEquals (ref .getId (), new ObjectId ("01234567890123456789abcd" ).toHexString ());
122122 }
123123
124+ @ Test
125+ public void numberLongParsing () {
126+ Long number = (Long ) JSON .parse (("{ \" $numberLong\" : \" 123456\" }" ));
127+ assertEquals (number , Long .valueOf ("123456" ));
128+ }
129+
124130// No such concept in Java
125131// @Test
126132// public void undefinedParsing() {
You can’t perform that action at this time.
0 commit comments