void (@NotNull PsiClass aClass) { if (aClass.isInterface() || aClass.isAnnotationType() || aClass.isEnum()) { return; } if (aClass instanceof PsiTypeParameter) { return; } if (!CloneUtils.isCloneable(aClass)) { return; } for (PsiMethod method : aClass.findMethodsByName("clone", false)) { if (CloneUtils.isClone(method)) { return; } } final boolean directlyCloneable = CloneUtils.isDirectlyCloneable(aClass); final boolean cloneCalled = directlyCloneable && RemoveCloneableFix.isCloneCalledInChildren(aClass); final boolean highlight = (!m_ignoreCloneableDueToInheritance || directlyCloneable) && (!ignoreWhenCloneCalled || !cloneCalled); if (!highlight && !isOnTheFly()) { return; } final PsiElement elementToHighlight = aClass instanceof PsiAnonymousClass ? ((PsiAnonymousClass)aClass).getBaseClassReference() : aClass.getNameIdentifier(); if (elementToHighlight != null) { registerError(elementToHighlight, highlight ? ProblemHighlightType.GENERIC_ERROR_OR_WARNING : ProblemHighlightType.INFORMATION, aClass, cloneCalled); } }