vy commented on PR #3839:
URL: https://github.com/apache/logging-log4j2/pull/3839#issuecomment-3262159881

   @ppkarwasz, can you explain why would we want to return null instead of 
throwing? Note that _"because we sometimes return null"_ does not constitute as 
an argument, since what we're talking about is a new API.
   
   > That mix of `null` vs `DefaultConfiguration` is problematic: users will 
almost always guard for one but not the other. For example, Spring Boot’s 
`Log4j2LoggingSystem` never checks for `null`.
   > ...
   
   Using this argument...
   
   > * **Return contract:** always `null` on failure (with legacy 
`DefaultConfiguration` as deprecated).
   
   ... you're proposing making _"returning `null` on failure"_ the contract. I 
can use the very same argument to propose the opposite: _"throwing on 
failure"_. Note that [PMC had consensus for throwing on configuration 
failures](https://lists.apache.org/thread/h2oydyk6xld47ljttqvflbt4530o73vw). 
Hence, I find your proposal contradictory. I'm inclined to throw on failures.
   
   > * **Parameter contract:** permissive for existing args, strict (`NPE`) 
only for the new `List<URI>`.
   
   I agree with your assessment here. I'd appreciate all these (param. spec.) 
to be documented in the Javadoc of the new method.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to