Community
Participate
Working Groups
Methods that do not access fields should be static where possible, as this visually signifies that the method does not access fields of the class it is defined within, and encourages a more functional style of programming. It would be great to have a cleanup rule that checks if a method accesses fields, and if not, adds the static modifier to the method. This should also probably be added as a quick fix action for qualifying methods.
Moving to UI
A quick fix is already available after an optional warning for "Method can be static" or "Method can potentially be static" in compiler settings is enabled. Admittedly these quickfixes aren't at all discoverable when the warnings are not enabled. Perhaps this should be improved somehow..
*** This bug has been marked as a duplicate of bug 10605 ***