在我的项目checkstyle_error.xml显示此错误Parameter role should be final.
如何解决checkstyle_error.xml错误
为public void setRole(String role) {
,但我没有得到,为什么是最后的。 并可能更多的空间和制表符相关的错误。任何人都可以告诉我这是为什么。任何好的教程来查找checkstyle错误约定。
一些错误,我得到的是:
1. Unused @param tag for 'Integer'
/**
* Sets id.
* @param Integer id
*/
public void setId(Integer id) {
this.id = id;
}
2. Expected @param tag for 'id&apos
public void setId(Integer id) {
this.id = id;
}
一个最佳实践是让参数成为'final'。 代码更容易阅读,因为它会阻止方法内的代码更改引用:即'role ='other''将被禁止。 – YMomb