You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Matt Sicker (Jira)" <ji...@apache.org> on 2020/03/07 17:16:00 UTC

[jira] [Commented] (LOG4J2-1188) Allow plugin builders to be created without static factory method

    [ https://issues.apache.org/jira/browse/LOG4J2-1188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17054153#comment-17054153 ] 

Matt Sicker commented on LOG4J2-1188:
-------------------------------------

Interestingly enough, in LOG4J2-2803, I discovered that the {{@PluginBuilderFactory}} annotation is not only redundant, but it also confuses the dependency injection system by providing both a method-based producer of the plugin as well as builder-based producer of the plugin. Therefore, the simplification that can be done here will be to simply deprecate the annotation and remove the need for providing an annotated method to do so (the {{newBuilder()}} methods can remain since they're typically used by unit tests and such, but the annotation is unnecessary).

> Allow plugin builders to be created without static factory method
> -----------------------------------------------------------------
>
>                 Key: LOG4J2-1188
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1188
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Plugins
>            Reporter: Matt Sicker
>            Assignee: Matt Sicker
>            Priority: Major
>
> The use of the newBuilder() static method annotated with {{@PluginBuilderFactory}}, while convenient, is unnecessary when constructing plugins via configurations. This functionality should remain, but if a plugin class has an inner class that implements {{Builder<T>}}, then that class can be used without needing to specify it through another annotation.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)