Skip to content

[java] merge UnnecessaryFinalModifier into UnnecessaryModifier#717

Merged
adangel merged 3 commits into
pmd:masterfrom
jsotuyod:issue-411
Nov 8, 2017
Merged

[java] merge UnnecessaryFinalModifier into UnnecessaryModifier#717
adangel merged 3 commits into
pmd:masterfrom
jsotuyod:issue-411

Conversation

@jsotuyod

@jsotuyod jsotuyod commented Nov 7, 2017

Copy link
Copy Markdown
Member

@jsotuyod jsotuyod added this to the 6.0.0 milestone Nov 7, 2017
 - I take the chance to also flag final resources in try-with-resources
 - This resolves pmd#411
 - This resolves pmd#676
 - The rule is now using the rulechain
@adangel adangel mentioned this pull request Nov 7, 2017
25 tasks
<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" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it doesn't fail. I may have forgotten the name attribute 'though. I'm adding it back.

@jsotuyod

jsotuyod commented Nov 7, 2017

Copy link
Copy Markdown
Member Author

@adangel there you go!

@adangel adangel merged commit 2c0957a into pmd:master Nov 8, 2017
@jsotuyod jsotuyod deleted the issue-411 branch November 8, 2017 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants