ashr123 commented on code in PR #3789:
URL: https://github.com/apache/logging-log4j2/pull/3789#discussion_r2192887860


##########
log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/NamedPattern.java:
##########


Review Comment:
   @vy if you want I saw that you've edited 0ef914b, so i assume you did 
everything you wanted..
   In addition I still think that 
`DatePatternConverter#decodeNamedPattern(String)` should be the entry point for 
`DatePatternConverter`'s parsing.. anyone else that wants to use 
`NamedDatePattern.java` will do it as they pleases..
   Regarding the exception, because the 
`DatePatternConverter#decodeNamedPattern(String)` Log4J's entry point for 
decoding patterns, is does the necessary abstraction, so I think its ok to use 
the try-catch mechanism, this is the mechanism Java's developers invented (i 
admit, at the time) for mapping strings into `enum` literals and this is how it 
was intended for use, it doesn't mean that if `IllegalArgumentException` is 
thrown - is a bad thing, its up for 
`DatePatternConverter#decodeNamedPattern(String)` to decide 🙂



-- 
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