ppkarwasz commented on PR #3085:
URL: https://github.com/apache/logging-log4j2/pull/3085#issuecomment-2413199879

   @jonasrutishauser,
   
   Nice catch!
   
   Looking at the `o.a.l.Priority` class there are other things that can go 
wrong:
   
   1. `Priority.version2Level` can be `null`. This might lead to incorrect 
filtering of `Priority` instances (possibly even an NPE). Can you create a new 
package-private constructor that always sets this field to a non-`null` value:
      ```java
      this.version2Level = version2Equivalent != null ? version2Equivalent : 
OptionConverter.createLevel(this);
      ```
   1. The `Priority.FATAL`, `Priority.ERROR` and so on fields reference the 
`Level` subclass, which might lead to class loading deadlocks on some JVMs (or 
they might just be `null` on others). Can you create them using the new 
constructor instead?


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