Menu

#1225 UselessParentheses rule executed on empty ruleset

New Tickets
closed
None
PMD
3-Major
Bug
2014-07-22
2014-07-17
No

When creating a own ruleset which is empty, then the rule UselessParentheses is still executed. I tried to exclude it as described, but this does not work either. I tried with 5.0.5 and 5.1.1 - it's the same with both versions.

I really like to remove this rule.

Please see my ruleset. It contains only a description and a exclude-pattern for test classes. Hopefully you can reproduce it.

1 Attachments

Discussion

  • Andreas Dangel

    Andreas Dangel - 2014-07-20
    • status: open --> more-info-needed
    • assigned_to: Andreas Dangel
     
  • Andreas Dangel

    Andreas Dangel - 2014-07-20

    I can't reproduce your issue.

    Are you sure you are only activating your empty ruleset and not accidentally the basic or the unnecessary rulesets in addition?
    Are you using pmd from commandline or via a different integration (e.g. maven)?

    The UselessParentheses rule is included in both java-basic and java-unnecessary.
    If you don't want to have this rule, but still use basic, you'll need to exclude it. See http://pmd.sourceforge.net/pmd-5.1.1/howtomakearuleset.html "Excluding rules from a ruleset".

     
    • Daniel Hirscher

      Daniel Hirscher - 2014-07-20

      I'm using Gradle 1.10. I'm pretty sure that the ruleset is taken, because I stripped it down to nothing and it's still reporting UselessParentheses. I didn't know that the rule is included in two rulesets. I will investigate further tomorrow.

       
  • Daniel Hirscher

    Daniel Hirscher - 2014-07-21

    This was the missing hint. I could solve it. Thank you for the great support. Good work.

     
  • Andreas Dangel

    Andreas Dangel - 2014-07-22
    • status: more-info-needed --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB