Menu

#1496 [java] New Rule: AccesorMethodGeneration - complements accessor class rule

PMD-5.5.4
closed
PMD
4-Minor
Feature-Request
5.4.2
2017-02-13
2016-06-22
No

The AccessorClassGeneration rule detects synthetic methods which are needed for accessing private constructors across nested class boundaries. Accessor methods are also generated when private methods or fields are accessed across nested class boundaries. I would like to see an AccessorMethodGeneration check added which detects where these would be generated so that they can be avoided in a similar fashion to the constructor ones.

Discussion

  • Jake Wharton

    Jake Wharton - 2016-06-22

    Also, complement. :facepalm:

     
  • Andreas Dangel

    Andreas Dangel - 2016-08-12
    • labels: --> java, java-design
    • summary: Compliment accessor class rule with accessor method rule. --> [java] New Rule: AccesorMethodGeneration - complements accessor class rule
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +1 @@
    -The `AccessorClassGeneration` rule detects synthetic methods which are needed for accessing private constructors across nested class boundaries. Accessor methods are also generated when private methods or fields are accessed across nested class boundaries. I would like to see an `AccessorMethodGeneration` check added which detects where these would be generated so that they can be avoided in a similar fashion to the constructor ones.
    +The [AccessorClassGeneration](http://pmd.github.io/latest/pmd-java/rules/java/design.html#AccessorClassGeneration) rule detects synthetic methods which are needed for accessing private constructors across nested class boundaries. Accessor methods are also generated when private methods or fields are accessed across nested class boundaries. I would like to see an `AccessorMethodGeneration` check added which detects where these would be generated so that they can be avoided in a similar fashion to the constructor ones.
    
     
  • Juan Sotuyo

    Juan Sotuyo - 2017-02-06
    • status: open --> in-progress
    • assigned_to: Juan Sotuyo
     
  • Juan Sotuyo

    Juan Sotuyo - 2017-02-06

    I'll be tackling this. I'm very interested on helping Android developers keep away from multidex / 65k method count.

    This rule will be specially awesome once we implement autofixable issues.

     
  • Andreas Dangel

    Andreas Dangel - 2017-02-13
    • status: in-progress --> closed
    • Milestone: New Tickets --> PMD-5.5.4
     
  • Andreas Dangel

    Andreas Dangel - 2017-02-13

    This rule will be available with PMD 5.5.4 and later.
    See PR https://github.com/pmd/pmd/pull/244

     

Log in to post a comment.