[ 
https://issues.apache.org/jira/browse/SOLR-16167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17527725#comment-17527725
 ] 

Peter Gromov commented on SOLR-16167:
-------------------------------------

The IDEA implementation is relatively straightforward, although I remember 
there were some nontrivial scenarios to handle. Note that it also has a 
[test|https://github.com/JetBrains/intellij-community/blob/0e2aa4030ee763c9b0c828f0b5119f4cdcc66f35/plugins/InspectionGadgets/test/com/siyeh/igtest/threading/StaticInitializerReferencesSubClass/StaticInitializer.java]
 which might be helpful.

Running IDEA analysis in the standard gradle precommit checks might be 
difficult to implement, and it'd likely be pretty slow.  One can run the chosen 
inspections on CI though, as a separate build, e.g. using 
[Qodana](https://www.jetbrains.com/qodana/).

If there's an existing solution with false positives, fixing them also seems a 
viable approach to me.

> Review static initializers that reference subclasses
> ----------------------------------------------------
>
>                 Key: SOLR-16167
>                 URL: https://issues.apache.org/jira/browse/SOLR-16167
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>    Affects Versions: main (10.0)
>            Reporter: Michael Gibney
>            Priority: Major
>         Attachments: StaticInitializerReferencesSubClass.xml
>
>
> More general follow-up to SOLR-16165.
> There is the potential for classloading deadlock in the case where static 
> initializers reference a subclass.
> This issue could cover 1 or 2 things:
> # Fix existing issues
> # Add a build check to prevent such issues from being introduced in the future
> Fixing existing issues should be relatively straightforward, once we're 
> specifically looking for them. "in the wild" these are problematic enough 
> that it's probably worth just fixing all such issues whether or not they 
> manifest as deadlock in practice.
> It would be great if we could port/modify/leverage an existing implementation 
> that already checks for this and have it apply automatically in the build, 
> unless this approach proves impractical.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to