Skip to content

Commit ffcdaad

Browse files
committed
trying to reproduce #2395
1 parent 3098e90 commit ffcdaad

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -1236,9 +1236,8 @@ else if (type instanceof WildcardType) {
12361236
// sanity check
12371237
throw new IllegalArgumentException("Unrecognized Type: "+((type == null) ? "[null]" : type.toString()));
12381238
}
1239-
/* 21-Feb-2016, nateB/tatu: as per [databind#1129] (applied for 2.7.2),
1240-
* we do need to let all kinds of types to be refined, esp. for Scala module.
1241-
*/
1239+
// 21-Feb-2016, nateB/tatu: as per [databind#1129] (applied for 2.7.2),
1240+
// we do need to let all kinds of types to be refined, esp. for Scala module.
12421241
if (_modifiers != null) {
12431242
TypeBindings b = resultType.getBindings();
12441243
if (b == null) {

src/test/java/com/fasterxml/jackson/databind/module/TestTypeModifiers.java

+15-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,21 @@ public void testMapLikeTypeConstruction() throws Exception
230230
assertNotNull(param);
231231
assertSame(Integer.class, param.getRawClass());
232232
}
233-
233+
234+
// [databind#2395] Can trigger problem this way too
235+
// NOTE: oddly enough, seems to ONLY fail
236+
public void testTypeResolutionForRecursive() throws Exception
237+
{
238+
ObjectMapper mapper = new ObjectMapper();
239+
mapper.registerModule(new SimpleModule() {
240+
@Override
241+
public void setupModule(SetupContext context) {
242+
context.addTypeModifier(new MyTypeModifier());
243+
}
244+
});
245+
assertNotNull(mapper.readTree("{}"));
246+
}
247+
234248
public void testCollectionLikeTypeConstruction() throws Exception
235249
{
236250
ObjectMapper mapper = new ObjectMapper();

0 commit comments

Comments
 (0)