boolean (PsiVariable psiVariable) { PsiModifierList modifierList = psiVariable.getModifierList(); if (modifierList == null) return true; if (modifierList.hasExplicitModifier(PsiModifier.FINAL)) return true; if (!REPORT_IMPLICIT_FINALS && modifierList.hasModifierProperty(PsiModifier.FINAL)) return true; if (psiVariable instanceof PsiLocalVariable) { return !REPORT_VARIABLES; } if (psiVariable instanceof PsiParameter parameter) { final PsiElement declarationScope = parameter.getDeclarationScope(); if (declarationScope instanceof PsiCatchSection) { return !REPORT_CATCH_PARAMETERS; } else if (declarationScope instanceof PsiForeachStatement) { return !REPORT_FOREACH_PARAMETERS; } return !REPORT_PARAMETERS; } return true; }