Merge branch 'harsh-kukreja-master'
This commit is contained in:
@ -20,5 +20,8 @@ This is a {{ site.pmd.release_type }} release.
|
||||
|
||||
### External Contributions
|
||||
|
||||
* [#2448](https://github.com/pmd/pmd/pull/2448): \[java] Operator Wrap check - [Harsh Kukreja](https://github.com/harsh-kukreja)
|
||||
|
||||
|
||||
{% endtocmaker %}
|
||||
|
||||
|
@ -91,8 +91,8 @@ public class CloneMethodMustImplementCloneableRule extends AbstractJavaRule {
|
||||
|
||||
// Is the clone method just throwing CloneNotSupportedException?
|
||||
final ASTClassOrInterfaceDeclaration classOrInterface = node.getFirstParentOfType(ASTClassOrInterfaceDeclaration.class);
|
||||
if (classOrInterface != null && //Don't analyze enums, which cannot subclass clone()
|
||||
(node.isFinal() || classOrInterface.isFinal())) {
|
||||
if (classOrInterface != null //Don't analyze enums, which cannot subclass clone()
|
||||
&& (node.isFinal() || classOrInterface.isFinal())) {
|
||||
if (node.findDescendantsOfType(ASTBlock.class).size() == 1) {
|
||||
final List<ASTBlockStatement> blocks = node.findDescendantsOfType(ASTBlockStatement.class);
|
||||
if (blocks.size() == 1) {
|
||||
|
Reference in New Issue
Block a user