Skip to content

Commit 916cc53

Browse files
committed
Merge branch '2.19'
2 parents dc04bdd + dcab137 commit 916cc53

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/main/java/tools/jackson/databind/deser/bean/BeanAsArrayDeserializer.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,8 @@ public Object deserialize(JsonParser p, DeserializationContext ctxt, Object bean
254254
return _deserializeFromNonArray(p, ctxt);
255255
}
256256

257-
/* No good way to verify that we have an array... although could I guess
258-
* check via JsonParser. So let's assume everything is working fine, for now.
259-
*/
257+
// No good way to verify that we have an array... although could I guess
258+
// check via JsonParser. So let's assume everything is working fine, for now.
260259
if (_injectables != null) {
261260
injectValues(ctxt, bean);
262261
}
@@ -354,7 +353,7 @@ protected Object _deserializeNonVanilla(JsonParser p, DeserializationContext ctx
354353
p.skipChildren();
355354
}
356355
// Ok; extra fields? Let's fail, unless ignoring extra props is fine
357-
if (!_ignoreAllUnknown) {
356+
if (!_ignoreAllUnknown && ctxt.isEnabled(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)) {
358357
ctxt.reportWrongTokenException(this, JsonToken.END_ARRAY,
359358
"Unexpected JSON values; expected at most %d properties (in JSON Array)",
360359
propCount);

src/test/java/tools/jackson/databind/struct/TestPOJOAsArray.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,8 @@ public void testUnknownExtraProp() throws Exception
308308
.without(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
309309
.readValue(json);
310310
assertNotNull(v);
311-
// note: +1 for both so
312-
assertEquals(v.value.x, 42);
313-
assertEquals(v.value.y, 13);
311+
assertEquals(42, v.value.x);
312+
assertEquals(13, v.value.y);
314313
assertTrue(v.value.complete);
315314
assertEquals("Foobar", v.value.name);
316315
}

0 commit comments

Comments
 (0)