void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement element = descriptor.getPsiElement(); if (!(element instanceof PsiTypeElement typeElement) || !element.isValid() || element.getParent() == null || !element.isPhysical()) return; VarianceCandidate candidate = VarianceCandidate.findVarianceCandidate(typeElement); if (candidate == null) return; PsiMethod method = candidate.method; if (!isOverriddenOrOverrides) { PsiField field = findFieldAssignedFromMethodParameter(candidate.methodParameter, method); if (field != null) { replaceType(project, Objects.requireNonNull(field.getTypeElement()), suggestMethodParameterType(candidate, isExtends)); } PsiTypeElement methodParameterTypeElement = Objects.requireNonNull(candidate.methodParameter.getTypeElement()); PsiClassType clone = suggestMethodParameterType(candidate, isExtends); replaceType(project, methodParameterTypeElement, clone); return; } int index = method.getParameterList().getParameterIndex(candidate.methodParameter); if (index == -1) return; PsiMethod superMethod = SuperMethodWarningUtil.checkSuperMethod(method); if (superMethod == null) return; if (superMethod != method) { method = superMethod; candidate = candidate.getSuperMethodVarianceCandidate(superMethod); } PsiClassType clone = suggestMethodParameterType(candidate, isExtends); int[] i = {0}; String candidateName = candidate.methodParameter.getName(); List<ParameterInfoImpl> parameterInfos = ContainerUtil.map(superMethod.getParameterList().getParameters(), p -> { int i1 = i[0]++; return ParameterInfoImpl.create(i1) .withName(i1 == index ? candidateName : p.getName()) .withType(i1 == index ? clone : p.getType()); }); JavaChangeSignatureDialog dialog = JavaChangeSignatureDialog.createAndPreselectNew(project, method, parameterInfos, false, null/*todo?*/); dialog.setParameterInfos(parameterInfos); if (dialog.showAndGet()) { PsiField field = findFieldAssignedFromMethodParameter(candidate.methodParameter, method); if (field != null) { replaceType(project, field.getTypeElement(), suggestMethodParameterType(candidate, isExtends)); } } }