Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#242 new check: avoid final members

Allon Mureinik

Hi Checkstyle gurus,

During my work on the oVirt Engine project, I came across a couple of issues with GWT mishandling final members (see, e.g., http://code.google.com/p/google-web-toolkit/issues/detail?id=1054).

The solution I came up with is a Checkstyle check to avoid such annoyances in the first place.
After running with it for a couple of weeks and feeling comfortable with the outcome, I decided to contribute it back to the checkstyle project, so other can benefit for it.

This patch contains the following:
1. The new check - AvoidFinalMembersCheck
2. The English version of is error message in messages.properties
3. A test case - AvoidFinalMembersCheckTest
4. Some input sources for the test - FinalMembers.java

Note this is my first time working with Mercurial and my first submission to checkstyle, so comments, suggestions and pointers would be highly appreciated.


1 Attachments


    • assigned_to: Daniil Yaroslavtsev
  • I think it is a bad practice to suppress final members everywhere if you don`t need them for rare cases. To have the right to life, this check should have at least a property, which allows user to specify fully qualified names of packages where final members are undesirable. IMHO, nobody will use this check otherwise.

  • As author does not respond, I am closing this patch. Allon, if you still want to contribute this code - please fork our new GitHub repo (https://github.com/checkstyle/checkstyle) and prepare the pull request for further discussion (with respecting my objections above).

    • status: open --> wont-fix