You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Log4j plugin should either have a builder annotated with @PluginBuilderFactory or a factory method annotated with @PluginFactory. As it turns out, some of them have both, for example PatternLayout:
@ppkarwasz, agreed that one should be present, but since PBF was introduced after PF, it is inevitable that some classes have both, and I don't know of a way to fix this without breaking backward compatibility. Do you?
@ppkarwasz, agreed that one should be present, but since PBF was introduced after PF, it is inevitable that some classes have both, and I don't know of a way to fix this without breaking backward compatibility. Do you?
I am not suggesting removing the factory methods, just the annotations (this is a MICRO change AFAIK). Having two annotations on the same class might lead to non deterministic behavior.
Log4j plugin should either have a builder annotated with
@PluginBuilderFactory
or a factory method annotated with@PluginFactory
. As it turns out, some of them have both, for examplePatternLayout
:logging-log4j2/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
Lines 301 to 303 in f786b51
logging-log4j2/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
Lines 624 to 625 in f786b51
This rule should probably be enforced by the annotation processor.
The text was updated successfully, but these errors were encountered: