Skip to content

Commit 2657ff3

Browse files
committed
Add test for #609
1 parent b7edca6 commit 2657ff3

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,7 @@ public ObjectMapper disable(DeserializationFeature first,
16931693
public boolean isEnabled(JsonParser.Feature f) {
16941694
return _deserializationConfig.isEnabled(f, _jsonFactory);
16951695
}
1696-
1696+
16971697
/**
16981698
* Method for changing state of specified {@link com.fasterxml.jackson.core.JsonParser.Feature}s
16991699
* for parser instances this object mapper creates.

src/test/java/com/fasterxml/jackson/failing/TestJavaType76.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
import java.util.*;
44

5-
import com.fasterxml.jackson.databind.BaseMapTest;
6-
import com.fasterxml.jackson.databind.JavaType;
5+
import com.fasterxml.jackson.databind.*;
76
import com.fasterxml.jackson.databind.type.TypeFactory;
87

98
/**
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.fasterxml.jackson.failing;
2+
3+
import com.fasterxml.jackson.databind.*;
4+
5+
/**
6+
* Failing test related to [databind#609]
7+
*/
8+
public class TestLocalType609 extends BaseMapTest
9+
{
10+
static class EntityContainer {
11+
RuleForm entity;
12+
13+
@SuppressWarnings("unchecked")
14+
public <T extends RuleForm> T getEntity() { return (T) entity; }
15+
public <T extends RuleForm> void setEntity(T e) { entity = e; }
16+
}
17+
18+
static class RuleForm {
19+
public int value;
20+
21+
public RuleForm() { }
22+
public RuleForm(int v) { value = v; }
23+
}
24+
25+
public void testLocalPartialType609() throws Exception {
26+
ObjectMapper mapper = new ObjectMapper();
27+
28+
EntityContainer input = new EntityContainer();
29+
input.entity = new RuleForm(12);
30+
String json = mapper.writeValueAsString(input);
31+
32+
EntityContainer output = mapper.readValue(json, EntityContainer.class);
33+
assertEquals(12, output.getEntity().value);
34+
}
35+
}
36+

0 commit comments

Comments
 (0)