leventov commented on issue #7227: Prohibit static, non-final fields URL: https://github.com/apache/incubator-druid/issues/7227#issuecomment-524973836 There are three types of static, non-final fields in the project: 1. Fields which should properly be `final`, just the `final` modifier was missed out. This is the wast majority of the 295 total occurrences in the project. The goal of this inspection check is to fix these omissions and prevent them in the future. 2. Fields which are effectively `final`, but cannot formally be `final` because the Java compiler complains. Example: `threadMXBean` and `initialized` from your comment. What we should do about these fields: suppress the annotation using `@SuppressWarnings("SSBasedInspection") // effectively final field; suppressing for "static, non final field" pattern` with these fields. 3. Static, truly mutable fields. This is an anti-pattern and should be avoided. If there is a good reason to use static mutable fields, these should also be `@SuppressWarnings("SSBasedInspection")`
---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org