1 FileTabCharacterCheck
为什么检查:
因为对于一个TAB而言,所空的空格不定是固定的,如果在机器A上设置了是4个空格,显示正常,而在机器B上阅读,B机器是100个空格为一个TAB的情况下,代码格式就很乱。所以需要做检查
final int tabPosition = line.indexOf('t');
解决办法:
在编码时,用空格代替TAB.
如果已经如此,可以在ECLIPSE格式化:
fommatter->indentation->general settting: tab policy选择spaces only,然后格式化
2 LineLengthCheck
单行超过了80个字符
<propertyname="max"value="${com.puppycrawl.tools.checkstyle.checks.sizes.LineLength.max}"default="100"/>
3 EmptyStatementCheck
Detects empty statements (standalone ;). |
4 WhitespaceAroundCheck
= is not followed by whitespace.
CallInNumber[][] callInNumbers={{CallInNumber.CALLIN_TOLL_FREE_NUMBER},{CallInNumber.CALLIN_TOLL_NUMBER},{CallInNumber.CALLIN_INTER_NUMBER}};
5 NeedBracesCheck
NeedBracesCheck, Priority: High |
'if' construct must use '{}'s. |