You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ppkarwasz (via GitHub)" <gi...@apache.org> on 2024/09/10 09:08:45 UTC
Re: [I] Replace field injection with setter injection in `3.x` (logging-log4j2)
ppkarwasz commented on issue #2769:
URL: https://github.com/apache/logging-log4j2/issues/2769#issuecomment-2340100205
Removing field injection in `3.x` has an advantage for JPMS users: they no longer need to `open` the package to `org.apache.logging.log4j.plugins`, since setter injection only requires _public_ reflection. JPMS grants public reflection on all _exported_ packages.
Basically this feature request consists in replacing code like:
```java
public static class Builder implements Supplier<ConsoleAppender> {
@PluginBuilderAttribute
private boolean follow;
public Builder setFollow(boolean follow) {
this.follow = follow;
return this;
}
}
```
with
```java
public static class Builder implements Supplier<ConsoleAppender> {
private boolean follow;
public Builder setFollow(@PluginAttribute boolean follow) {
this.follow = follow;
return this;
}
}
```
so I would leave it as "good first issue". I believe that the process can be done automatically by writing an [OpenRewrite](https://docs.openrewrite.org/) rule.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org