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() {
114
114
int type = (Integer ) b .get ("$type" );
115
115
byte [] bytes = (new Base64Codec ()).decode ((String ) b .get ("$binary" ));
116
116
o = new Binary ((byte ) type , bytes );
117
+ } else if (b .containsField ("$numberLong" )) {
118
+ o = Long .valueOf ((String ) b .get ("$numberLong" ));
117
119
}
118
120
119
121
if (!isStackEmpty ()) {
Original file line number Diff line number Diff line change @@ -121,6 +121,12 @@ public void refParsing() {
121
121
assertEquals (ref .getId (), new ObjectId ("01234567890123456789abcd" ).toHexString ());
122
122
}
123
123
124
+ @ Test
125
+ public void numberLongParsing () {
126
+ Long number = (Long ) JSON .parse (("{ \" $numberLong\" : \" 123456\" }" ));
127
+ assertEquals (number , Long .valueOf ("123456" ));
128
+ }
129
+
124
130
// No such concept in Java
125
131
// @Test
126
132
// public void undefinedParsing() {
You can’t perform that action at this time.
0 commit comments