Skip to content

Commit bc91126

Browse files
committed
Fix #2109 with tests
1 parent bc5e138 commit bc91126

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

release-notes/CREDITS

+4
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,10 @@ Guixiong Wu (吴桂雄)
638638
* Reported #2032: Blacklist another serialization gadget (ibatis)
639639
(2.8.11.2)
640640

641+
svarzee@github
642+
* Reported #2109, suggested fix: Canonical string for reference type is built incorrectly
643+
(2.8.11.3 / 2.9.7)
644+
641645
Connor Kuhn (ckuhn@github)
642646
* Contributed #1341: FAIL_ON_MISSING_EXTERNAL_TYPE_ID_PROPERTY
643647
(2.9.0)

release-notes/VERSION

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ Project: jackson-databind
33
=== Releases ===
44
------------------------------------------------------------------------
55

6+
2.8.11.3 (not yet released)
7+
8+
#2109: Canonical string for reference type is built incorrectly
9+
(reported by svarzee@github)
10+
611
2.8.11.2 (08-Jun-2018)
712

813
#1941: `TypeFactory.constructFromCanonical()` throws NPE for Unparameterized

src/main/java/com/fasterxml/jackson/databind/type/ReferenceType.java

+1
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ protected String buildCanonicalName()
166166
sb.append(_class.getName());
167167
sb.append('<');
168168
sb.append(_referencedType.toCanonical());
169+
sb.append('>');
169170
return sb.toString();
170171
}
171172

src/test/java/com/fasterxml/jackson/databind/type/TestTypeFactory.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,14 @@ public void testCanonicalNames()
232232
can);
233233
assertEquals(t, tf.constructFromCanonical(can));
234234

235-
// [databind#1941]: allow "raw" types too
235+
// [databind#2109]: also ReferenceTypes
236+
t = tf.constructType(new TypeReference<AtomicReference<Long>>() { });
237+
can = t.toCanonical();
238+
assertEquals("java.util.concurrent.atomic.AtomicReference<java.lang.Long>",
239+
can);
240+
assertEquals(t, tf.constructFromCanonical(can));
236241

242+
// [databind#1941]: allow "raw" types too
237243
t = tf.constructFromCanonical("java.util.List");
238244
assertEquals(List.class, t.getRawClass());
239245
assertEquals(CollectionType.class, t.getClass());

0 commit comments

Comments
 (0)