Skip to content

Commit daf612d

Browse files
committed
Last minor tweaks
1 parent d218c8f commit daf612d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/impl/SimpleValueReader.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,15 @@ public Object read(JSONReader reader, JsonParser p) throws IOException
152152
return p.getValueAsLong();
153153

154154
case SER_NUMBER_BIG_DECIMAL:
155+
if (p.hasToken(JsonToken.VALUE_NULL)) {
156+
return null;
157+
}
155158
return p.getDecimalValue();
156159

157160
case SER_NUMBER_BIG_INTEGER:
161+
if (p.hasToken(JsonToken.VALUE_NULL)) {
162+
return null;
163+
}
158164
return p.getBigIntegerValue();
159165

160166
// Other scalar types:

jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/ReadSimpleTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,6 @@ public void testMiscScalarFail() throws Exception {
208208
/**********************************************************************
209209
*/
210210

211-
// 07-Jul-2020, tatu: Should be able to check but as of 2.11 same reader used
212-
// for wrapper and primitives.
213-
/*
214211
public void testNullForMiscNumbers() throws Exception {
215212
assertNull(JSON.std.beanFrom(Integer.class," null "));
216213
assertNull(JSON.std.beanFrom(Long.class," null "));
@@ -219,7 +216,6 @@ public void testNullForMiscNumbers() throws Exception {
219216
assertNull(JSON.std.beanFrom(BigInteger.class," null "));
220217
assertNull(JSON.std.beanFrom(BigDecimal.class," null "));
221218
}
222-
*/
223219

224220
public void testNullForMiscScalars() throws Exception {
225221
assertNull(JSON.std.beanFrom(Date.class," null "));

0 commit comments

Comments
 (0)