Skip to content

Commit d3a715a

Browse files
committed
Fix #2060 (... again... was missing another path)
1 parent 13e8375 commit d3a715a

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

release-notes/VERSION-2.x

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ Project: jackson-databind
44
=== Releases ===
55
------------------------------------------------------------------------
66

7+
2.9.7 (not yet released)
8+
9+
#2060: `UnwrappingBeanPropertyWriter` incorrectly assumes the found serializer is
10+
of type `UnwrappingBeanSerializer`
11+
(reported by Petar T)
12+
713
2.9.6 (12-Jun-2018)
814

915
#955: Add `MapperFeature.USE_BASE_TYPE_AS_DEFAULT_IMPL` to use declared base type
@@ -52,9 +58,6 @@ Project: jackson-databind
5258
(reported by Guixiong Wu)
5359
#2058: CVE-2018-12023: Block polymorphic deserialization of types from Oracle JDBC driver
5460
(reported by Guixiong Wu)
55-
#2060: `UnwrappingBeanPropertyWriter` incorrectly assumes the found serializer is
56-
of type `UnwrappingBeanSerializer`
57-
(reported by Petar T)
5861

5962
2.9.5 (26-Mar-2018)
6063

src/main/java/com/fasterxml/jackson/databind/ser/impl/UnwrappingBeanPropertyWriter.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,11 @@ protected JsonSerializer<Object> _findAndAddDynamic(PropertySerializerMap map,
213213
serializer = provider.findValueSerializer(type, this);
214214
}
215215
NameTransformer t = _nameTransformer;
216-
if (serializer.isUnwrappingSerializer()) {
217-
t = NameTransformer.chainedTransformer(t, ((UnwrappingBeanSerializer) serializer)._nameTransformer);
216+
if (serializer.isUnwrappingSerializer()
217+
// as per [databind#2060], need to also check this, in case someone writes
218+
// custom implementation that does not extend standard implementation:
219+
&& (serializer instanceof UnwrappingBeanSerializer)) {
220+
t = NameTransformer.chainedTransformer(t, ((UnwrappingBeanSerializer) serializer)._nameTransformer);
218221
}
219222
serializer = serializer.unwrappingSerializer(t);
220223

0 commit comments

Comments
 (0)