diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index 5abc81b374..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) diff --git a/src/main/java/com/fasterxml/jackson/databind/type/TypeFactory.java b/src/main/java/com/fasterxml/jackson/databind/type/TypeFactory.java index 321f2b17bd..e8a57c1f8c 100644 --- a/src/main/java/com/fasterxml/jackson/databind/type/TypeFactory.java +++ b/src/main/java/com/fasterxml/jackson/databind/type/TypeFactory.java @@ -1638,8 +1638,12 @@ protected JavaType _fromWellKnownClass(ClassStack context, Class rawType, Typ // example, is a weak, tag-on type). They may be detectable in future. // 23-May-2023, tatu: As of 2.16 we do, however, recognized certain `IterationType`s. if (rawType == Iterator.class || rawType == Stream.class - // 18-Apr-2024, tatu: [databind#4443] allow exact `Iterable` - || 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); } if (BaseStream.class.isAssignableFrom(rawType)) { diff --git a/src/test/java/com/fasterxml/jackson/databind/type/JavaTypeTest.java b/src/test/java/com/fasterxml/jackson/databind/type/JavaTypeTest.java index 7e60ce0cdb..e53a97f99e 100644 --- a/src/test/java/com/fasterxml/jackson/databind/type/JavaTypeTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/type/JavaTypeTest.java @@ -324,8 +324,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/com/fasterxml/jackson/databind/type/TypeFactoryTest.java b/src/test/java/com/fasterxml/jackson/databind/type/TypeFactoryTest.java index 9b992d7ebb..f63a214ada 100644 --- a/src/test/java/com/fasterxml/jackson/databind/type/TypeFactoryTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/type/TypeFactoryTest.java @@ -165,19 +165,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