void (@NotNull PsiMethod method) { final boolean redundantStrictfp = PsiUtil.isLanguageLevel17OrHigher(method) && method.hasModifierProperty(PsiModifier.STRICTFP); if (redundantStrictfp) { final PsiModifierList modifierList = method.getModifierList(); final List<PsiKeyword> modifiers = PsiTreeUtil.getChildrenOfTypeAsList(modifierList, PsiKeyword.class); for (PsiKeyword modifier : modifiers) { if (JavaTokenType.STRICTFP_KEYWORD == modifier.getTokenType()) { // all code is strictfp under Java 17 and higher registerError(modifier, "unnecessary.strictfp.modifier.problem.descriptor"); } } } final PsiClass containingClass = method.getContainingClass(); if (containingClass == null) { return; } if (containingClass.isEnum()) { if (!method.isConstructor() || !method.hasModifierProperty(PsiModifier.PRIVATE)) { return; } final PsiModifierList modifierList = method.getModifierList(); final List<PsiKeyword> modifiers = PsiTreeUtil.getChildrenOfTypeAsList(modifierList, PsiKeyword.class); for (PsiKeyword modifier : modifiers) { if (JavaTokenType.PRIVATE_KEYWORD == modifier.getTokenType()) { // enum constructors are implicitly private registerError(modifier, "unnecessary.enum.constructor.modifier.problem.descriptor"); } } } else if (containingClass.isInterface()) { final PsiModifierList modifierList = method.getModifierList(); final List<PsiKeyword> modifiers = PsiTreeUtil.getChildrenOfTypeAsList(modifierList, PsiKeyword.class); for (PsiKeyword modifier : modifiers) { final IElementType tokenType = modifier.getTokenType(); if (JavaTokenType.PUBLIC_KEYWORD == tokenType) { // all members of interface are implicitly public registerError(modifier, "unnecessary.interface.member.modifier.problem.descriptor"); } else if (JavaTokenType.ABSTRACT_KEYWORD == tokenType) { // all non-default, non-static methods of interfaces are implicitly abstract registerError(modifier, "unnecessary.interface.method.modifier.problem.descriptor"); } } } }