@@ -661,18 +661,10 @@ private static class BeanMapper<T> {
661
661
+ method .getName ());
662
662
}
663
663
664
- // OK to add since existingPropertyName == propertyName.
665
- properties .put (propertyName .toLowerCase (Locale .US ), propertyName );
666
-
667
- // Handle `setter` update.
668
664
Method existingSetter = setters .get (propertyName );
669
- if (existingSetter == null ) {
670
- method .setAccessible (true );
671
- setters .put (propertyName , method );
672
- applySetterAnnotations (method );
673
- } else if (!isSetterOverride (method , existingSetter )) {
674
- // We require that setters with conflicting property names are
675
- // overrides from a base class
665
+
666
+ // Raise exception if a conflict between setters is found.
667
+ if (existingSetter != null && !isSetterOverride (method , existingSetter )) {
676
668
if (currentClass == clazz ) {
677
669
// TODO: Should we support overloads?
678
670
throw new RuntimeException (
@@ -692,6 +684,13 @@ private static class BeanMapper<T> {
692
684
+ ")" );
693
685
}
694
686
}
687
+
688
+ // Make it accessible and process annotations if not yet.
689
+ if (existingSetter == null ) {
690
+ method .setAccessible (true );
691
+ setters .put (propertyName , method );
692
+ applySetterAnnotations (method );
693
+ }
695
694
}
696
695
697
696
for (Field field : currentClass .getDeclaredFields ()) {
0 commit comments