checkStype输出及其意义2

来源:互联网 发布:java log4j2 编辑:程序博客网 时间:2024/06/14 16:32

Type is missing a javadoc commentClass  缺少类型说明

2“{” should be on the previous line “{” 应该位于前一行

Methos is missing a javadoc comment 方法前面缺少javadoc注释

4 Expected @throws tag for “Exception”在注释中希望有@throws的说明

5“.” Is preceeded with whitespace “.” 前面不能有空格

6“.” Is followed by whitespace“.” 后面不能有空格

7“=” is not preceeded with whitespace“=” 前面缺少空格

8“=” is not followed with whitespace“=” 后面缺少空格

9“}” should be on the same line“}” 应该与下条语句位于同一行

10Unused @param tag for “unused”没有参数“unused”,不需注释

11Variable “CA” missing javadoc变量“CA”缺少javadoc注释

12Line longer than 80characters行长度超过80

13Line contains a tab character行含有”tab” 字符

14Redundant “Public” modifier冗余的“public” modifier

15Final modifier out of order with the JSL suggestion Final modifier的顺序错误

16Avoid using the “.*” form of importImport格式避免使用“.*”

17Redundant import from the same package从同一个包中Import内容

18Unused import-java.util.listImport进来的java.util.list没有被使用

19Duplicate import to line 13重复Import同一个内容

20Import from illegal package从非法包中 Import内容

21“while” construct must use “{}”  “while” 语句缺少“{}”

22Variable “sTest1” must be private and have accessor method变量“sTest1”应该是private的,并且有调用它的方法

23Variable “ABC” must match pattern “^[a-z][a-zA-Z0-9]*$”变量“ABC”不符合命名规则“^[a-z][a-zA-Z0-9]*$”

24“(” is followed by whitespace“(” 后面不能有空格 25“)” is proceeded by whitespace“)” 前面不能有空格

 

不太明白的错误解答

1.  'X' hides a field.

public class Foo
{
    private int bar;

    public Foo(int bar)
    {
        this.bar = bar;
    }

    public final int getBar()
    {
        return bar;
    }
}

解释:全局private int bar;和局部public Foo(int bar)的bar变量名字重复。
此错误,可以忽略不检查。


2. Parameter X should be final.


public class Foo
{
    private int bar;

    public Foo(int bar)
    {
        this.bar = bar;
    }

    public final int getBar()
    {
        return bar;
    }
}

解释:public Foo(int bar)的局部变量,被认为是不可改变的,检查需要加上final关键字定义public Foo(final int bar)
此错误,可以忽略不检查

3. Redundant 'X' modifier.

public interface CacheHRTreeService extends Manager {

 /**
  * Organization Tree
  *
  * @param orgDto
  * @return
  * @throws Exception
  */
 public void setOrganization(OrganizationDTO orgDto) throws Exception;

 /**
  * Organization Tree
  *
  * @return
  * @throws Exception
  */
 public OrganizationDTO getOrganization() throws Exception;
......
}

解释:多余的字段。public OrganizationDTO getOrganization() throws Exception;此时public为多余的字段,因为interface定义的时候,就是public的。

需要检查。

4. - Class X should be declared as final.

解释:对于单例设计模式,要求返回唯一的类对象。但是HRFactory和ContextFactory为优化的两个类,不需求检查。
其他的单例类,依然需要进行检查。


5.  Utility classes should not have a public or default constructor.

解释:工具类不必提供默认的构造方法。
需要检查,仅仅为提示。

6. File does not end with a newline.
解释:虽然JAVA程序不要求结尾要用新行,但是习惯上应该要空一行。
需要检查,仅仅为提示。

7. - Method 'addChildrenId' is not designed for extension - needs to be
  abstract, final or empty.

解释:通过父类继承的,此类有点特殊
可以忽略此类。

8. Variable 'id' must be private and have accessor methods.
解释:BaseHRDTO类,为父类,属性给子类继承,比较特殊。
但是其他的类,声名需要加上范围'private'关键字
需要检查。

9. -Array brackets at illegal position.
解释:代码写法,习惯不一样。
需要检查,仅仅提示。

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 斗鱼手机号换了怎么办 斗鱼直播掉帧怎么办 手机一直卡顿点不动怎么办呢 斗鱼直播分值底怎么办 斗鱼6000鱼丸怎么办卡 斗鱼直播没人看怎么办 淘宝直播间没人气怎么办 挂水了还是有热度怎么办 陌陌工会不结算工资怎么办 滴滴给了差评怎么办 饿了么星级低怎么办 滴滴乘客给低星怎么办 蘑菇街自动收货前还没到怎么办 小主播人气太少别人看不到怎么办 税收分类编码不可用怎么办 斗鱼鱼翅充错了怎么办 苹果指纹摔坏了怎么办 小米5指纹坏了怎么办 苹果5s指纹失灵怎么办 学生赌博输了3万怎么办 电脑录屏没有声音怎么办 别人说你没有他美怎么办 没有你我怎么办歌词是什么意思 要是没有他我怎么办啊歌词 用喀秋莎保存的视频黑屏怎么办 电脑杀毒之后开不了机怎么办 夫妻离婚分房分车怎么办 请的护身符丢了怎么办 老车轻微烧机油怎么办 电脑下软件变卡怎么办 机械表日历偏了怎么办 子宫内膜异位痛经怎么办 凉着了坏肚子怎么办 昆虫叮咬后疼痛起水泡怎么办 每次来月经都痛经怎么办 人左肩的灯灭了怎么办 香港超过7天了怎么办? 手机拍完照图像是倒的怎么办 地下城金币邮寄卡了怎么办 wow7.3打团本卡怎么办 上古卷轴5出bug怎么办