Skip to content

Commit bce92b0

Browse files
committed
Merge branch '2.10' into 2.11
2 parents 40edd60 + 6138286 commit bce92b0

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

release-notes/CREDITS-2.x

+4
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,10 @@ Richard Wise (Woodz@github)
995995
* Reported #2519: Serializing `BigDecimal` values inside containers ignores shape override
996996
(2.10.1)
997997
998+
Mark Schäfer (mark--@github)
999+
* Reported #2520: Sub-optimal exception message when failing to deserialize non-static inner classes
1000+
(2.10.1)
1001+
9981002
Ville Koskela (vjkoskela@github)
9991003
* Contributed #2487: BeanDeserializerBuilder Protected Factory Method for Extension
10001004
(2.11.0)

release-notes/VERSION-2.x

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Project: jackson-databind
2929
(reported by Johan H)
3030
#2519: Serializing `BigDecimal` values inside containers ignores shape override
3131
(reported by Richard W)
32+
#2520: Sub-optimal exception message when failing to deserialize non-static inner classes
33+
(reported by Mark S)
3234

3335
2.10.0 (26-Sep-2019)
3436

src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerBase.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,7 @@ protected Object deserializeFromObjectUsingNonDefault(JsonParser p,
12921292
Class<?> raw = _beanType.getRawClass();
12931293
if (ClassUtil.isNonStaticInnerClass(raw)) {
12941294
return ctxt.handleMissingInstantiator(raw, null, p,
1295-
"can only instantiate non-static inner class by using default, no-argument constructor");
1295+
"non-static inner classes like this can only by instantiated using default, no-argument constructor");
12961296
}
12971297
return ctxt.handleMissingInstantiator(raw, getValueInstantiator(), p,
12981298
"cannot deserialize from Object value (no delegate- or property-based Creator)");

src/test/java/com/fasterxml/jackson/databind/deser/creators/InnerClassCreatorTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ public void testIssue1501() throws Exception
6363
try {
6464
MAPPER.readValue(ser, Something1501.class);
6565
fail("Should not pass");
66-
} catch (JsonMappingException e) {
66+
} catch (MismatchedInputException e) {
6767
verifyException(e, "Cannot construct instance");
6868
verifyException(e, "InnerSomething1501");
69-
verifyException(e, "can only instantiate non-static inner class by using default");
69+
verifyException(e, "non-static inner classes like this can only by instantiated using default");
7070
}
7171
}
7272

@@ -76,10 +76,10 @@ public void testIssue1502() throws Exception
7676
try {
7777
MAPPER.readValue(ser, Something1502.class);
7878
fail("Should not pass");
79-
} catch (JsonMappingException e) {
79+
} catch (MismatchedInputException e) {
8080
verifyException(e, "Cannot construct instance");
8181
verifyException(e, "InnerSomething1502");
82-
verifyException(e, "can only instantiate non-static inner class by using default");
82+
verifyException(e, "non-static inner classes like this can only by instantiated using default");
8383
}
8484
}
8585

0 commit comments

Comments
 (0)