eclise快捷键

CheckStyle报错的常见问题及解决方式

1.File contains tab characters (this is the first instance). :这一行有tab行距,用鼠标选中tab打出的空白处,ctrl+f,全部修改成双空格;

2.method def modifier at indentation level 2 not at correct indentation, 4:和第一点一样,checkstyle要求距离边距4个空格,把这行的前面所有空白去掉,然后敲4个空格就OK;

3.Line is longer than 120 characters (found 123).: 文字超长,换个行啥的就OK;

4.Static variable definition in wrong order.:顺序不对,需要调整:window-->preferences-->查找sort-->menbers sort order:上面的顺序调整一下,一般types第一位,static在普通的前面,方法最后,方法里构造在最前面;下面的勾上,顺序:public,protected,default,private;上面:经供参考:types,static fields,fields,initializers,constructors,static initializers,static methods,methods,配置完成后在需要的类里面:右键-->source-->sort-->打钩-->确定,再次check;

5.Javadoc has empty description section. 没注释啊魂淡;

6.'XXXX' hides a field.:命名重复,换个名,推荐alt+shift+r改;

7.method call child at indentation level 8 not at correct indentation, 12:当前赋值可能方式不对,换个赋值方式瞧瞧;

8.Don't use trailing comments.:直译:不要搞笑吧亲;

9.'static' modifier out of order with the JLS suggestions.:老实点把final放在static 后面; 

10.Unnecessary parentheses around assignment right-hand side.:有个不必要的括号存在;


1、Eclipse自动生成作者、日期注释等功能设置

猜你喜欢

转载自blog.csdn.net/w_t_y_y/article/details/79475979