Skip to content

Commit 44a8547

Browse files
committed
Merge branch '2.11' into 2.12
2 parents 37413a7 + 1473b03 commit 44a8547

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

release-notes/CREDITS-2.x

+8-6
Original file line numberDiff line numberDiff line change
@@ -1117,19 +1117,21 @@ Michael Cramer (BigMichi1@github)
11171117
fails randomly
11181118
(2.11.1)
11191119

1120-
Oleg Chtchoukine (oshatrk@github)
1121-
* Reported #2759: Rearranging of props when property-based generator is in use leads
1122-
to incorrect output
1120+
Frank Schmager (fschmager@github)
1121+
* Reported #2757: "Conflicting setter definitions for property" exception for `Map`
1122+
subtype during deserialization
11231123
(2.11.1)
11241124

11251125
Johannes Kuhn (DasBrain@github)
1126+
* Reported #2758: Fail to deserialize local Records
1127+
(2.11.1)
11261128
* Reported #2760: Jackson doesn't respect `CAN_OVERRIDE_ACCESS_MODIFIERS=false` for
11271129
deserializer properties
11281130
(2.11.1)
11291131
1130-
Frank Schmager (fschmager@github)
1131-
* Reported #2757: "Conflicting setter definitions for property" exception for `Map`
1132-
subtype during deserialization
1132+
Oleg Chtchoukine (oshatrk@github)
1133+
* Reported #2759: Rearranging of props when property-based generator is in use leads
1134+
to incorrect output
11331135
(2.11.1)
11341136
11351137
Mike Gilbode (gilbode@github)

release-notes/VERSION-2.x

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Project: jackson-databind
5050
#2757: "Conflicting setter definitions for property" exception for `Map`
5151
subtype during deserialization
5252
(reported by Frank S)
53+
#2758: Fail to deserialize local Records
54+
(reported by Johannes K)
5355
#2759: Rearranging of props when property-based generator is in use leads
5456
to incorrect output
5557
(reported by Oleg C)

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -908,9 +908,8 @@ protected boolean isPotentialBeanType(Class<?> type)
908908
if (ClassUtil.isProxyType(type)) {
909909
throw new IllegalArgumentException("Cannot deserialize Proxy class "+type.getName()+" as a Bean");
910910
}
911-
/* also: can't deserialize some local classes: static are ok; in-method not;
912-
* other non-static inner classes are ok
913-
*/
911+
// also: can't deserialize some local classes: static are ok; in-method not;
912+
// other non-static inner classes are ok
914913
typeStr = ClassUtil.isLocalType(type, true);
915914
if (typeStr != null) {
916915
throw new IllegalArgumentException("Cannot deserialize Class "+type.getName()+" (of type "+typeStr+") as a Bean");

src/main/java/com/fasterxml/jackson/databind/util/ClassUtil.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -184,19 +184,23 @@ public static String isLocalType(Class<?> type, boolean allowNonStatic)
184184
{
185185
/* As per [JACKSON-187], GAE seems to throw SecurityExceptions
186186
* here and there... and GAE itself has a bug, too
187-
* (see []). Bah. So we need to catch some wayward exceptions on GAE
187+
* Bah. So we need to catch some wayward exceptions on GAE
188188
*/
189189
try {
190+
final boolean isStatic = Modifier.isStatic(type.getModifiers());
191+
190192
// one more: method locals, anonymous, are not good:
191-
if (hasEnclosingMethod(type)) {
193+
// 23-Jun-2020, tatu: [databind#2758] With JDK14+ should allow
194+
// local Record types, however
195+
if (!isStatic && hasEnclosingMethod(type)) {
192196
return "local/anonymous";
193197
}
194198
/* But how about non-static inner classes? Can't construct
195199
* easily (theoretically, we could try to check if parent
196200
* happens to be enclosing... but that gets convoluted)
197201
*/
198202
if (!allowNonStatic) {
199-
if (isNonStaticInnerClass(type)) {
203+
if (!isStatic && getEnclosingClass(type) != null) {
200204
return "non-static member class";
201205
}
202206
}

0 commit comments

Comments
 (0)