void (@NotNull PsiMethod method) { if (!method.hasModifierProperty(PsiModifier.FINAL)) { return; } if (!method.hasModifierProperty(PsiModifier.STATIC) && AnnotationUtil.findAnnotation(method, true, CommonClassNames.JAVA_LANG_SAFE_VARARGS) != null) { return; } final PsiClass containingClass = method.getContainingClass(); if (containingClass == null || containingClass.isEnum()) { return; } if (!containingClass.hasModifierProperty(PsiModifier.FINAL)) { return; } final PsiModifierList modifiers = method.getModifierList(); final PsiElement[] children = modifiers.getChildren(); for (final PsiElement child : children) { final String text = child.getText(); if (PsiModifier.FINAL.equals(text)) { registerError(child); } } }