Reputation: 15090
I have enabled Checkstyle for my project. It is showing yellow mark on method parameters and requesting to set it as final
. Why? What is the purpose? If not specified what will be the problem?
Upvotes: 5
Views: 5695
Reputation: 11
Remove FinalParameters from your CheckStyle declaration. http://checkstyle.sourceforge.net/config_misc.html#FinalParameters
Upvotes: 1
Reputation: 6046
In case there is a rule in Checkstyle, normally the answer is there as well: http://checkstyle.sourceforge.net/config_misc.html
In this case:
Changing the value of parameters during the execution of the method's algorithm can be confusing and should be avoided. A great way to let the Java compiler prevent this coding style is to declare parameters final.
Upvotes: 4