PMD规则之Clone Implementation Rules

来源:互联网 发布:行星减速器传动比算法 编辑:程序博客网 时间:2024/05/02 04:22

·  ProperCloneImplementation: Object clone() should be implemented with super.clone().

翻译  适当的克隆实现:对象的clone()方法中应该包含super.clone()实现

·  CloneThrowsCloneNotSupportedException: The method clone() should throw a CloneNotSupportedException.

翻译  克隆方法要抛出不支持克隆异常:clone()方法应该抛出CloneNotSupportedException

·  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.

翻译  克隆方法必须实现Cloneable接口:如果类实现Cloneable接口,clone()方法应该被实现为一个final的方法并且只抛出CloneNotSupportedException的异常

原创粉丝点击