diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index 3dfbaf8e6e..49c950c1e1 100644 --- a/release-notes/VERSION-2.x +++ b/release-notes/VERSION-2.x @@ -6,8 +6,6 @@ Project: jackson-databind 2.18.0 (not yet released) -#4443: Add `Iterable` as recognized `IterationType` instance (along with - `Iterable`, `Stream`) #4453: Allow JSON Integer to deserialize into a single-arg constructor of parameter type `double` (contributed by David M) @@ -42,15 +40,14 @@ Project: jackson-databind #4450: Empty QName deserialized as `null` (reported by @winfriedgerlach) #4471: Reconsider deprecation of `JsonNode.asText(defaultValue)` - (requested by @aerisnju) - (fix by Joo-Hyuk K) + (requested by @aerisnju) + (fix by Joo-Hyuk K) #4481: Unable to override `DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL` with `JsonFormat.Feature.READ_UNKNOWN_ENUM_VALUES_AS_NULL` (reported by @luozhenyu) #4489: Unable to override `DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE` with `JsonFormat.Feature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE` - (reported by Joo-Hyuk K) - (fix by Joo-Hyuk K) + (fix by Joo-Hyuk K) 2.17.0 (12-Mar-2024) diff --git a/src/main/java/tools/jackson/databind/type/TypeFactory.java b/src/main/java/tools/jackson/databind/type/TypeFactory.java index 1676f01f2b..30e00f24f4 100644 --- a/src/main/java/tools/jackson/databind/type/TypeFactory.java +++ b/src/main/java/tools/jackson/databind/type/TypeFactory.java @@ -1437,7 +1437,12 @@ protected JavaType _fromWellKnownClass(ClassStack context, Class rawType, Typ return _referenceType(rawType, bindings, superClass, superInterfaces); } if (rawType == Iterator.class || rawType == Stream.class - || rawType == Iterable.class) { + // 27-Apr-2024, tatu: Tried to do [databind#4443] for 2.18 but that caused + // regression so cannot add "Iterable.class" without figuring out issue + // with HPPC `ObjectArrayList`s type hierarchy first + // + // || rawType == Iterable.class + ) { return _iterationType(rawType, bindings, superClass, superInterfaces); } // 23-May-2023, tatu: [databind#3950] IterationTypes diff --git a/src/test/java/tools/jackson/databind/type/JavaTypeTest.java b/src/test/java/tools/jackson/databind/type/JavaTypeTest.java index 870a5251d6..a5e9fc7882 100644 --- a/src/test/java/tools/jackson/databind/type/JavaTypeTest.java +++ b/src/test/java/tools/jackson/databind/type/JavaTypeTest.java @@ -313,8 +313,6 @@ public void testIterationTypesDirect() throws Exception Iterator.class, Object.class); _verifyIteratorType(tf.constructType(Stream.class), Stream.class, Object.class); - _verifyIteratorType(tf.constructType(Iterable.class), - Iterable.class, Object.class); // Then generic but direct JavaType t = _verifyIteratorType(tf.constructType(new TypeReference>() { }), diff --git a/src/test/java/tools/jackson/databind/type/TypeFactoryTest.java b/src/test/java/tools/jackson/databind/type/TypeFactoryTest.java index 4cd83ca245..4610c25e8b 100644 --- a/src/test/java/tools/jackson/databind/type/TypeFactoryTest.java +++ b/src/test/java/tools/jackson/databind/type/TypeFactoryTest.java @@ -166,19 +166,6 @@ public void testIterator() assertNull(t.containedType(1)); } - // [databind#4443] - @Test - public void testIterable() - { - TypeFactory tf = TypeFactory.defaultInstance(); - JavaType t = tf.constructType(new TypeReference>() { }); - assertEquals(IterationType.class, t.getClass()); - assertTrue(t.isIterationType()); - assertSame(Iterable.class, t.getRawClass()); - assertEquals(1, t.containedTypeCount()); - assertEquals(tf.constructType(String.class), t.containedType(0)); - assertNull(t.containedType(1)); - } /** * Test for verifying that parametric types can be constructed * programmatically