PMD规则之Finalizer Rules
来源:互联网 发布:行星减速器传动比算法 编辑:程序博客网 时间:2024/04/29 13:23
· EmptyFinalizer: If the finalize() method is empty, then it does not need to exist.
翻译 空的finalize():如果finalize()方法是空的,那么它就不需要存在。
· FinalizeOnlyCallsSuperFinalize: If the finalize() is implemented, it should do something besides just calling super.finalize().
翻译 finalize方法调用父类finalize:如果finalize()被实现,它应该除了调用super.finalize()之外还应该做点别的。
· FinalizeOverloaded: Methods named finalize() should not have parameters. It is confusing and probably a bug to overload finalize(). It will not be called by the VM.
翻译 finalize重载:方法名是finalize()的方法应该具有参数。因为不带参数容易令人迷惑且可能是一个bug,那样就不会被JVM调用。
· FinalizeDoesNotCallSuperFinalize: If the finalize() is implemented, its last action should be to call super.finalize.
翻译 finalize没有调用父类的finalize:如果finalize()方法被重新实现,它最后一个动作应该是调用super.finalize();
· FinalizeShouldBeProtected: If you override finalize(), make it protected. If you make it public, other classes may call it.
翻译 finalize应该是受保护的:如果你覆盖finalize(),使他是protected的,如果作为public的,其它类就可以调用了。
· AvoidCallingFinalize: Object.finalize() is called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
翻译 避免调用finalize:Object.finalize()是由垃圾收集器发现没有引用指向这个对象的时候调用的,应尽量避免人为调用
- PMD规则之Finalizer Rules
- PMD规则之Basic Rules
- PMD规则之Braces Rules
- PMD规则之Controversial Rules
- PMD规则之Coupling Rules
- PMD规则之Design 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规则之Code Size Rules
- PMD规则之Design Rules
- 如何连接access数据库不用ODBC
- 在PropertySheet中插入一PropertyPage页
- sql临时表:SQL Server中的临时表和表变量
- Java线程:创建与启动
- PMD规则之Finalizer Rules
- PMD规则之Import Statement Rules
- 破解开机密码
- PMD规则之J2EE Rules
- Java线程:线程栈模型与线程的变量
- PMD规则之JavaBean Rules
- 关于win7的激活方法
- Java操作Excel方法比较
- Java线程:线程状态的转换