diff --git a/src/main/java/com/fasterxml/jackson/databind/introspect/POJOPropertyBuilder.java b/src/main/java/com/fasterxml/jackson/databind/introspect/POJOPropertyBuilder.java index cc8bc70e1b..23963e1cde 100644 --- a/src/main/java/com/fasterxml/jackson/databind/introspect/POJOPropertyBuilder.java +++ b/src/main/java/com/fasterxml/jackson/databind/introspect/POJOPropertyBuilder.java @@ -40,9 +40,9 @@ public class POJOPropertyBuilder protected final PropertyName _internalName; protected Linked _fields; - + protected Linked _ctorParameters; - + protected Linked _getters; protected Linked _setters; @@ -316,9 +316,9 @@ public AnnotatedMethod getSetter() continue; } } - - throw new IllegalArgumentException("Conflicting setter definitions for property \""+getName()+"\": " - +curr.value.getFullName()+" vs "+next.value.getFullName()); + throw new IllegalArgumentException(String.format( + "Conflicting setter definitions for property \"%s\": %s vs %s", + getName(), curr.value.getFullName(), next.value.getFullName())); } // One more thing; to avoid having to do it again... _setters = curr.withoutNext(); diff --git a/src/test/java/com/fasterxml/jackson/failing/SkipInjectableIntrospection962Test.java b/src/test/java/com/fasterxml/jackson/failing/SkipInjectableIntrospection962Test.java index f91e2e0dbc..cb37a5cacb 100644 --- a/src/test/java/com/fasterxml/jackson/failing/SkipInjectableIntrospection962Test.java +++ b/src/test/java/com/fasterxml/jackson/failing/SkipInjectableIntrospection962Test.java @@ -11,9 +11,7 @@ static class InjectMe { private String a; - public void setA(String a) { - this.a = a; - } + public InjectMe(boolean dummy) { } public void setA(Integer a) { this.a = a.toString(); @@ -42,20 +40,16 @@ public String getB() { } } - public void testInjected() + // 14-Jun-2016, tatu: For some odd reason, this test sometimes fails, other times not... + // possibly related to unstable ordering of properties? + public void testInjected() throws Exception { - InjectMe im = new InjectMe(); - ObjectMapper sut = new ObjectMapper() + InjectMe im = new InjectMe(true); + ObjectMapper mapper = new ObjectMapper() .setInjectableValues(new InjectableValues.Std().addValue(InjectMe.class, im)); String test = "{\"b\":\"bbb\"}"; - Injectee actual = null; - try { - actual = sut.readValue(test, Injectee.class); - } - catch (Exception e) { - fail("failed to deserialize: "+e); - } + Injectee actual = mapper.readValue(test, Injectee.class); assertEquals("bbb", actual.getB()); } }