Menu

#1002 False +: FinalFieldCouldBeStatic on inner class

PMD-5.0.3
closed
pmd (543)
PMD
3-Major
Bug
2013-04-05
2012-04-12
Nick Radov
No

See the attached sample file, it triggers a warning on the FinalFieldCouldBeStatic design rule. But this is a false positive because static fields can only be declared in static or top level types. If you make the field static it will cause a compiler error.

Discussion

  • Nick Radov

    Nick Radov - 2012-04-12

    sample code to reproduce bug

     
  • Andreas Dangel

    Andreas Dangel - 2013-03-13
    • status: open --> in-progress
    • assigned_to: Tom Copeland --> Andreas Dangel
    • module: --> PMD
    • milestone: --> PMD-5.0.3
    • priority: 5 --> 3-Major
    • type: --> Bug
    • affects_version: -->
     
  • Andreas Dangel

    Andreas Dangel - 2013-03-14
    • status: in-progress --> closed
     

Log in to post a comment.