void (@NotNull PsiParameter parameter) { super.visitParameter(parameter); final PsiElement parent = parameter.getParent(); if (!(parent instanceof PsiCatchSection)) { return; } final CompiledPattern pattern = myCompilingVisitor.getContext().getPattern(); final MatchingHandler handler = pattern.getHandlerSimple(parameter); @NonNls final String name = "__catch_" + parent.getTextOffset(); final SubstitutionHandler substitutionHandler; if (handler instanceof SubstitutionHandler parameterHandler) { substitutionHandler = new SubstitutionHandler(name, false, parameterHandler.getMinOccurs(), parameterHandler.isTarget() ? Integer.MAX_VALUE : parameterHandler.getMaxOccurs(), true); } else { substitutionHandler = new SubstitutionHandler(name, false, 1, 1, true); } pattern.setHandler(parent, substitutionHandler); }