JWT007 opened a new issue, #3368:
URL: https://github.com/apache/logging-log4j2/issues/3368

   **Log4j 2.24**
   
   _Not technically a bug??? But not a feature-request either...just pointing 
it out...if no interest in changing this from L4J team go ahead and close it_ 
   
   The appender Builders (ConsoleAppender.Builder, FileAppender.Builder, etc) 
have been generically defiined.
   
   For example:
   
   ```
       /**
        * Builds ConsoleAppender instances.
        * @param <B> The type to build
        */
       public static class Builder<B extends Builder<B>> 
               extends AbstractOutputStreamAppender.Builder<B>
               implements 
org.apache.logging.log4j.core.util.Builder<ConsoleAppender> {
               ...
       }
   ```
   
   This means when _not_ chaining you need to handle the generics:
   
   `ConsoleAppender.Builder<?> builder = ConsoleAppender.newBuilder();`
   
   This is OK for the abstract Builders that are inherited, but a wee bit 
non-standard for concrete builder implementations.
      
   Since the appender classes are final one might assume its builders can also 
be final and don't need the generics on the class itself.
   
   I *think* it could be simplified::
   
   For example ConsoleAppender:
   ```
     public static final class Builder 
         extends AbstractOutputStreamAppender.Builder<Builder> 
         implements org.apache.logging.log4j.core.util.Builder<ConsoleAppender>
   ```
   
   `ConsoleAppender.Builder builder = ConsoleAppender.newBuilder();`
   
   From a coding perspective a trivial change but more of a binary 
compatibility problem.
   


-- 
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-unsubscr...@logging.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to