uschindler commented on pull request #2200:
URL: https://github.com/apache/lucene-solr/pull/2200#issuecomment-761100335


   IntelliJ has a check for this which works quite good. But in contrast ECJ 
from Eclipse has not. It would have been great to allow this check.
   
   Maybe check errorprone, maybe they have a rule already? Basically we could 
add this to forbiddenapis, but that would be a misnomer. All you need is a 
check if a static initializer of a class references a subclass in any (direct) 
way. The issue then happens if the subclass is initialized in another thread 
while the static initializer is running. So generally static initializers that 
refer to private child classes which cannot be seen befor the parent is 
initialized, are safe, but that's a detail and needs to be decided.
   
   The Codec Deadlock was exactly that problem, too. Unfortunately for this 
case a static tool won't have a chance, so a static tool alone is not a full 
solution.


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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to