GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||
GeezerVison is showing github.com — [java] #3724 - fix FinalFieldCouldBeStatic: triggers only if the referenced name is static by dykov · Pull Request #3727 · pmd/pmd Conversation
|
Generated by 🚫 Danger |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for improving the previous fix! I'm a bit undecided, whether we should leave it as is or merge this PR... public final int someField = Integer.MAX_VALUE; This is correct and valid - "someField" is a final field, that can be made static. "Integer.MAX_VALUE" is static as well. With this PR, this case won't be detected anymore. However, with XPath this case can probably not be detected reliably. With XPath we only have the current source file and can't look into other files/classes such as "java.lang.Integer". So, two options: I think, I'm going with option b) - although I guess the false-positives are very rare (e.g. no occurrences in our regression tester projects). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[java] Make FinalFieldCouldBeStatic detect constant variable
There was an error while loading. Please reload this page.