暂时工作记录:
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这一行出的问题
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;
}
}