unit test for [JACKSON-739]
diff --git a/src/test/org/codehaus/jackson/map/deser/TestOverloaded.java b/src/test/org/codehaus/jackson/map/deser/TestOverloaded.java index 487ef8d..d42d7f6 100644 --- a/src/test/org/codehaus/jackson/map/deser/TestOverloaded.java +++ b/src/test/org/codehaus/jackson/map/deser/TestOverloaded.java
@@ -2,6 +2,7 @@ import java.util.*; +import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.*; /** @@ -52,6 +53,18 @@ public void setValue(String str) { value = str; } } + // [JACKSON-739] + static class Overloaded739 + { + protected Object _value; + + @JsonProperty + public void setValue(String str) { _value = str; } + + // no annotation, should not be chosen: + public void setValue(Object o) { throw new UnsupportedOperationException(); } + } + /** * And then a Bean that is conflicting and should not work */ @@ -112,6 +125,15 @@ assertEquals("abc", bean.value); } + // for [JACKSON-739] + public void testConflictResolution() throws Exception + { + Overloaded739 bean = new ObjectMapper().readValue + ("{\"value\":\"abc\"}", Overloaded739.class); + assertNotNull(bean); + assertEquals("abc", bean._value); + } + /** * For genuine setter conflict, an exception is to be thrown. */