[java] merge UnnecessaryFinalModifier into UnnecessaryModifier#717
Conversation
jsotuyod
commented
Nov 7, 2017
- I take the chance to also flag final resources in try-with-resources
- This resolves [java] RFC: Merge java-unnecessarycode/UnnecessaryFinalModifier and java-unnecessarycode/UnnecessaryModifier #411
- This resolves [java] java-unnecessarycode/UnnecessaryFinalModifier on try-with-resources #676
- The rule is now using the rulechain
| <rule ref="category/java/errorprone.xml/UnusedNullCheckInEquals" deprecated="true" /> | ||
| <rule ref="category/java/errorprone.xml/UselessOperationOnImmutable" deprecated="true" /> | ||
|
|
||
| <rule ref="category/java/codestyle.xml/UnnecessaryFinalModifier" deprecated="true" /> |
There was a problem hiding this comment.
I'm uncertain, whether we should provide the rule additionally under the old name:
<rule ref="category/java/codestyle.xml/UnnecessaryModifier" name="UnnecessaryFinalModifier" depreated="true" />
That way, if someone uses "java-unnecessary/UnnecessaryFinalModifier", we would still resolve the rule. It could lead to duplicated reports - the rule might be in use twice.
But on the other hand, the RuleSetFactoryCompatibility class should take care of this...
WDYT?
There was a problem hiding this comment.
I believe the RuleSetFactoryCompatibility already handles that scenario.
The only difference AFAIK is on the documentation site.
I think leaving it there threw an exception upon parsing the dogfooding ruleset, but I can't remember right now.
There was a problem hiding this comment.
No, it doesn't fail. I may have forgotten the name attribute 'though. I'm adding it back.
|
@adangel there you go! |