PMD规则之Type Resolution Rules
来源:互联网 发布:最好拆卸软件 编辑:程序博客网 时间:2024/04/18 19:54
· LooseCoupling: Avoid using implementation types (i.e., HashSet); use the interface (i.e, Set) instead
翻译 松散耦合:避免使用实现类(如 HashSet),使用接口(如 Set)代替
· CloneMethodMustImplementCloneable: The method clone() should only be implemented if the class implements the Cloneable interface with the exception of a final method that only throws CloneNotSupportedException. This version uses PMD's type resolution facilities, and can detect if the class implements or extends a Cloneable class
翻译 存在克隆方法类必须实现Cloneable接口: clone()方法只有在类实现了cloneable接口且伴随一个final方法只抛出CloneNotSupportedException异常的情况下才要被实现。这个版本使用了PMD的类型分析工具,能够检测类是否实现或继承了一个可克隆的类
· UnusedImports: Avoid unused import statements. This rule will find unused on demand imports, i.e. import com.foo.*.
翻译 无用的import:避免无用的import语句。这个规则按需查找无用的import语句。
· SignatureDeclareThrowsException: It is unclear which exceptions that can be thrown from the methods. It might be difficult to document and understand the vague interfaces. Use either a class derived from RuntimeException or a checked exception. Junit classes are excluded.
翻译 具体声明抛出的异常:不确定方法中能够抛出什么样的具体异常。为模糊的接口提供证明并理解它是很困难的。抛出的异常类要么从RuntimeException中继承或者抛出一个被检查的异常。
- PMD规则之Type Resolution Rules
- PMD规则之Basic Rules
- PMD规则之Braces Rules
- PMD规则之Controversial Rules
- PMD规则之Coupling Rules
- PMD规则之Design Rules
- PMD规则之Finalizer Rules
- PMD规则之J2EE Rules
- PMD规则之JavaBean Rules
- PMD规则之Junit Rules
- PMD规则之Migration Rules
- PMD规则之Naming Rules
- PMD规则之Optimization Rules
- PMD规则之Controversial Rules
- PMD规则之Basic Rules
- PMD规则之Braces Rules
- PMD规则之Design Rules
- PMD规则之Clone Implementation Rules
- PMD规则之Security Code Guidelines
- 一个简单的makefile示例及其注释
- 有关Android线程的学习
- 关于ireport脚本的我自己的一部分总结
- OneNote and Autohotkey – Useful Scripts
- PMD规则之Type Resolution Rules
- 用Nohup命令让Linux下的程序在后台执行
- PMD规则之Unused Code Rules
- PHP变量的变量——可变变量
- 如何用标准的odbc sql接口访问wincc归档数据库
- 闲谈
- Smary模板应用30分钟入门教程
- C++中传值参数和引用参数和指针怎样区别?
- 非对称加密算法