Details
-
Bug
-
Resolution: Fixed
-
Major
-
1.1.7
Description
In logback 1.1.7, BeanDescriptionFactory was introduced in this commit.
BeanDescriptionFactory incorrectly prints the following warnings for classes containing bridge methods:
Warning: Class '%s' contains multiple setters for the same property '%s'. Warning: Class '%s' contains multiple adders for the same property '%s'.
BeanDescriptionFactory should ignore bridge methods.
This could be fixed easily by adding:
if (method.isBridge()) { continue; }
in the for loop, before the first if condition.
This can be reproduced by using a class with a bridge method in logback's configuration. For example:
public class ConfigFoo<T> { private T bar; public void setBar(T bar) { this.bar = bar; } } public class IntegerConfigFoo extends ConfigFoo<T> { public void setBar(Integer bar) { super.setBar(bar); // do something else } }
In this case IntegerConfigFoo will have a setBar(Object) bridge method AND a setBar(Integer) method. Logback should ignore the setBar(Object) bridge method.
This is causing issues for logstash-logback-encoder