Skip to content

[java] Remove java statistical rules#1772

Merged
jsotuyod merged 6 commits into
pmd:pmd/7.0.xfrom
oowekyala:remove-java-stat-rules
Sep 6, 2019
Merged

[java] Remove java statistical rules#1772
jsotuyod merged 6 commits into
pmd:pmd/7.0.xfrom
oowekyala:remove-java-stat-rules

Conversation

@oowekyala

@oowekyala oowekyala commented Apr 12, 2019

Copy link
Copy Markdown
Member

Followup on #1750, refs #1432

This removes Java statistical rules. Basically I duplicate nearly exactly AbstractCounterCheckRule from #1750. It can't really be abstracted as both those base rule classes need to extend eg AbstractJavaRule.

Also, this removes the old Ncss rules instead of porting them. They've been deprecated since 5.8.0 IIRC.

I add one thing: AbstractJavaRulechainRule. The constraint of not calling super.visit when a rule uses the rulechain is error-prone and not user friendly. Just having a base class where super.visit doesn't recurse solves this. It also requires rulechain visits in the constructor. Converting an existing rule just means extending this base class.

This design is cool but highlights the fact that there's no way to add a rulechain visit to an abstract type for now, which will become important for the 7.0.0 java grammar, which heavily uses interfaces. As such the design is awkward, but I don't expect it to last. I'll open an issue for that as soon as I have time -> #1785

@oowekyala oowekyala added this to the 7.0.0 milestone Apr 12, 2019
@ghost

ghost commented Apr 13, 2019

Copy link
Copy Markdown
1 Message
📖 No java rules are changed!

Generated by 🚫 Danger

@jsotuyod jsotuyod left a comment

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 love how this PR simplifies things and would like to have it merged, however, it currently depends on #1622

@jsotuyod jsotuyod merged commit 61ee224 into pmd:pmd/7.0.x Sep 6, 2019
@oowekyala oowekyala mentioned this pull request Sep 6, 2019
@oowekyala oowekyala deleted the remove-java-stat-rules branch September 6, 2019 14:31
@oowekyala

Copy link
Copy Markdown
Member Author

Thanks for merging @jsotuyod ! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

is:feature-removal Remove an unneeded unused feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants