@Override
    public void visitTryStatement(@NotNull PsiTryStatement statement) {
      super.visitTryStatement(statement);
      final PsiResourceList resourceList = statement.getResourceList();
      if (resourceList != null && reportLocalVariables) {
        for (PsiResourceListElement element : resourceList) {
          if (element instanceof final PsiResourceVariable variable && variable.hasModifierProperty(PsiModifier.FINAL)) {
            registerModifierError(PsiModifier.FINAL, variable, variable);
          }
        }
      }
      if (onlyWarnOnAbstractMethods || !reportParameters) {
        return;
      }
      final PsiCatchSection[] catchSections = statement.getCatchSections();
      for (PsiCatchSection catchSection : catchSections) {
        final PsiParameter parameter = catchSection.getParameter();
        final PsiCodeBlock catchBlock = catchSection.getCatchBlock();
        if (parameter == null || catchBlock == null) {
          continue;
        }
        if (!parameter.hasModifierProperty(PsiModifier.FINAL)) {
          continue;
        }
        if (parameter.getType() instanceof PsiDisjunctionType || !isNecessaryFinal(parameter, parameter.getDeclarationScope())) {
          registerModifierError(PsiModifier.FINAL, parameter, parameter);
        }
      }
    }
@Override
    public void visitTryStatement(@NotNull PsiTryStatement statement)