void (@NotNull PsiMethod method) { super.visitMethod(method); if (!CloneUtils.isClone(method)) { return; } if (method.hasModifierProperty(PsiModifier.FINAL)) { return; } if (onlyWarnOnProtectedClone && method.hasModifierProperty(PsiModifier.PUBLIC)) { return; } final PsiClass containingClass = method.getContainingClass(); if (containingClass == null) { return; } if (containingClass.hasModifierProperty(PsiModifier.FINAL)) { return; } if (MethodUtils.hasInThrows(method, "java.lang.CloneNotSupportedException")) { return; } final PsiMethod superMethod = MethodUtils.getSuper(method); if (superMethod != null && !MethodUtils.hasInThrows(superMethod, "java.lang.CloneNotSupportedException")) { return; } registerMethodError(method); }