checkstyle风格修改记录

暂时工作记录:

RightCurlyAlone   4.1.3 右括号是否需要另起一行,可以选择,但是如果是if/else等多block,不能用右括号立即关闭{}

EmptyLineSeparator  4.6.1 

EmptyCatchBlock暂时屏蔽

 

一、javadoc相关

JavaDoc描述:    https://www.cnblogs.com/boring09/p/4274893.html

1、<p>标签的使用

如果注释包含多段内容,段与段之间需要用 <p> 分隔,空行是没用的
<p> 标签前应有空行。 [JavadocParagraph]

2、Javadoc的第一句缺少一个结束时期。 [SummaryJavadoc]
解决:一开始,我以为需要一个时间,后来发现只需要一个英文句号就可以
https://stackoverflow.com/questions/13129766/first-sentence-should-end-with-a-period

3、Javadoc注释放在错误的位置。 [InvalidJavadocPosition]

/** State that processed the message */
State msgProcessedState = null;
		
这种在函数里面的应该叫注释,不是javadoc,不能用/**   */
用/* */

4、Javadoc 缩进级别错误,应为 4 个缩进符。 [JavadocTagContinuationIndentation]

@return这一行出的问题

7.1.3 Block tags

Any of the standard "block tags" that are used appear in the order @param@return@throws@deprecated, and these four types never appear with an empty description. When a block tag doesn't fit on a single line, continuation lines are indented four (or more) spaces from the position of the @.

错误:

    /**
     * Setup the mTempStateStack with the states we are going to enter.
     *
     * <p>This is found by searching up the destState's ancestors for a state that is already active
     * i.e. StateInfo.active == true. The destStae and all of its inactive parents will be on the
     * TempStateStack as the list of states to enter.
     *
     * @return StateInfo of the common ancestor for the destState and current state or null if there
     * is no common parent.
     */

修改后 

    /**
     * Setup the mTempStateStack with the states we are going to enter.
     *
     * <p>This is found by searching up the destState's ancestors for a state that is already active
     * i.e. StateInfo.active == true. The destStae and all of its inactive parents will be on the
     * TempStateStack as the list of states to enter.
     *
     * @return StateInfo of the common ancestor for the destState and current state or null if there
     *          is no common parent.
     */

二、其他错误修改

1、数组大括号位置错误。 [ArrayTypeStyle]:
private StateInfo mStateStack[]; -->     private StateInfo[] mTempStateStack;

To configure the check to enforce Java style:

<module name="ArrayTypeStyle"/>
        
Example:

public class MyClass {
  int[] nums; // OK
  String strings[]; // violation

  char[] toCharArray() { // OK
    return null;
  }
}

 

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值