void (@NotNull PsiMethod method) { if (!MethodUtils.isFinalize(method)) { return; } if (method.hasModifierProperty(PsiModifier.PROTECTED)) { return; } final PsiClass aClass = method.getContainingClass(); if (aClass == null || aClass.isInterface()) { return; } for (PsiMethod superMethod : method.findSuperMethods()) { if (superMethod.hasModifierProperty(PsiModifier.PUBLIC)) { return; } } registerMethodError(method); }