diff options
author | Tatu Saloranta <tatu.saloranta@iki.fi> | 2018-08-15 07:13:38 -0700 |
---|---|---|
committer | Tatu Saloranta <tatu.saloranta@iki.fi> | 2018-08-15 07:13:38 -0700 |
commit | bc91126c55dc513735a2a95ace4c00a6021c76f4 (patch) | |
tree | 48f223b92a2b08b766e1651982283b1b3dc10387 | |
parent | bc5e138dfaf572ea519cbfefe36a9bec8b017365 (diff) | |
download | jackson-databind-bc91126c55dc513735a2a95ace4c00a6021c76f4.tar.gz |
Fix #2109 with tests
-rw-r--r-- | release-notes/CREDITS | 4 | ||||
-rw-r--r-- | release-notes/VERSION | 5 | ||||
-rw-r--r-- | src/main/java/com/fasterxml/jackson/databind/type/ReferenceType.java | 1 | ||||
-rw-r--r-- | src/test/java/com/fasterxml/jackson/databind/type/TestTypeFactory.java | 8 |
4 files changed, 17 insertions, 1 deletions
diff --git a/release-notes/CREDITS b/release-notes/CREDITS index cf0ad6952..fcfc2ba68 100644 --- a/release-notes/CREDITS +++ b/release-notes/CREDITS @@ -638,6 +638,10 @@ Guixiong Wu (吴桂雄) * Reported #2032: Blacklist another serialization gadget (ibatis) (2.8.11.2) +svarzee@github + * Reported #2109, suggested fix: Canonical string for reference type is built incorrectly + (2.8.11.3 / 2.9.7) + Connor Kuhn (ckuhn@github) * Contributed #1341: FAIL_ON_MISSING_EXTERNAL_TYPE_ID_PROPERTY (2.9.0) diff --git a/release-notes/VERSION b/release-notes/VERSION index b87cf7b23..2f72cd322 100644 --- a/release-notes/VERSION +++ b/release-notes/VERSION @@ -3,6 +3,11 @@ Project: jackson-databind === Releases === ------------------------------------------------------------------------ +2.8.11.3 (not yet released) + +#2109: Canonical string for reference type is built incorrectly + (reported by svarzee@github) + 2.8.11.2 (08-Jun-2018) #1941: `TypeFactory.constructFromCanonical()` throws NPE for Unparameterized diff --git a/src/main/java/com/fasterxml/jackson/databind/type/ReferenceType.java b/src/main/java/com/fasterxml/jackson/databind/type/ReferenceType.java index 4add34ee0..e8c69628c 100644 --- a/src/main/java/com/fasterxml/jackson/databind/type/ReferenceType.java +++ b/src/main/java/com/fasterxml/jackson/databind/type/ReferenceType.java @@ -166,6 +166,7 @@ public class ReferenceType extends SimpleType sb.append(_class.getName()); sb.append('<'); sb.append(_referencedType.toCanonical()); + sb.append('>'); return sb.toString(); } diff --git a/src/test/java/com/fasterxml/jackson/databind/type/TestTypeFactory.java b/src/test/java/com/fasterxml/jackson/databind/type/TestTypeFactory.java index d543454dd..ab0ff60bf 100644 --- a/src/test/java/com/fasterxml/jackson/databind/type/TestTypeFactory.java +++ b/src/test/java/com/fasterxml/jackson/databind/type/TestTypeFactory.java @@ -232,8 +232,14 @@ public class TestTypeFactory can); assertEquals(t, tf.constructFromCanonical(can)); - // [databind#1941]: allow "raw" types too + // [databind#2109]: also ReferenceTypes + t = tf.constructType(new TypeReference<AtomicReference<Long>>() { }); + can = t.toCanonical(); + assertEquals("java.util.concurrent.atomic.AtomicReference<java.lang.Long>", + can); + assertEquals(t, tf.constructFromCanonical(can)); + // [databind#1941]: allow "raw" types too t = tf.constructFromCanonical("java.util.List"); assertEquals(List.class, t.getRawClass()); assertEquals(CollectionType.class, t.getClass()); |