Menu

#245 Private unchanged field should be marked as final

closed-rejected
5
2017-10-22
2011-12-20
No

If I have a private field in a class which is never assigned a value except at construction, then it should be made final. This will definitely help improve the performance of the program since the optimizer is able to do more optimizations around it. It will also help trigger the engineer's mind into thinking about missing methods or code to update the field's value.

Discussion

  • Keith Lea

    Keith Lea - 2012-01-13
    • assigned_to: nobody --> wpugh
    • status: open --> open-accepted
     
  • Andrey Loskutov

    Andrey Loskutov - 2017-10-22
    • Labels: new bug pattern --> new bug pattern, report on spotbugs
    • Status: open-accepted --> closed-rejected
     

Log in to post a comment.