Skip to content

Commit 69f6f52

Browse files
committed
Fix #1999
1 parent de6ca25 commit 69f6f52

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed

release-notes/CREDITS-2.x

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,3 +767,7 @@ roeltje25@github
767767
* Reported #1978: Using @JsonUnwrapped annotation in builderdeserializer hangs in
768768
infinite loop
769769
(2.9.5)
770+
771+
Ondrej Zizka (OndraZizk@github)
772+
* Reported #1999: "Duplicate property" issue should mention which class it complains about
773+
(2.9.6)

release-notes/VERSION-2.x

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Project: jackson-databind
1414
#1998: Removing "type" attribute with Mixin not taken in account if
1515
using ObjectMapper.copy()
1616
(reported by SBKila@github)
17+
#1999: "Duplicate property" issue should mention which class it complains about
18+
(reported by Ondrej Z)
1719

1820
2.9.5 (26-Mar-2018)
1921

src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ protected void _addDeserializerConstructors(DeserializationContext ctxt,
419419
BeanDescription beanDesc, VisibilityChecker<?> vchecker,
420420
AnnotationIntrospector intr, CreatorCollector creators,
421421
Map<AnnotatedWithParams,BeanPropertyDefinition[]> creatorParams)
422-
throws JsonMappingException
422+
throws JsonMappingException
423423
{
424424
// 25-Jan-2017, tatu: As per [databind#1501], [databind#1502], [databind#1503], best
425425
// for now to skip attempts at using anything but no-args constructor (see

src/main/java/com/fasterxml/jackson/databind/deser/impl/CreatorCollector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ public void addPropertyCreator(AnnotatedWithParams creator,
184184
Integer old = names.put(name, Integer.valueOf(i));
185185
if (old != null) {
186186
throw new IllegalArgumentException(String.format(
187-
"Duplicate creator property \"%s\" (index %s vs %d)",
188-
name, old, i));
187+
"Duplicate creator property \"%s\" (index %s vs %d) for type %s ",
188+
name, old, i, ClassUtil.nameOf(_beanDesc.getBeanClass())));
189189
}
190190
}
191191
}

src/test/java/com/fasterxml/jackson/databind/deser/creators/TestCreators2.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ public void testCreatorWithDupNames() throws Exception
261261
fail("Should have caught duplicate creator parameters");
262262
} catch (JsonMappingException e) {
263263
verifyException(e, "duplicate creator property \"bar\"");
264+
verifyException(e, "for type `com.fasterxml.jackson.databind.");
265+
verifyException(e, "$BrokenCreatorBean`");
264266
}
265267
}
266268

0 commit comments

Comments
 (0)