ParameterInfoImpl (JavaIntroduceParameterObjectClassDescriptor descriptor, PsiMethod method, List<? extends ParameterInfoImpl> oldMethodParameters) { final PsiCodeBlock body = method.getBody(); String baseParameterName = StringUtil.decapitalize(descriptor.getClassName()); final Project project = method.getProject(); if (!PsiNameHelper.getInstance(project).isIdentifier(baseParameterName, LanguageLevel.HIGHEST)) { baseParameterName = StringUtil.fixVariableNameDerivedFromPropertyName(baseParameterName); } final String paramName = body != null ? JavaCodeStyleManager.getInstance(project) .suggestUniqueVariableName(baseParameterName, body.getLBrace(), true) : JavaCodeStyleManager.getInstance(project) .propertyNameToVariableName(baseParameterName, VariableKind.PARAMETER); final String classTypeText = descriptor.createFakeClassTypeText(); final JavaPsiFacade facade = JavaPsiFacade.getInstance(project); return new ParameterInfoImpl(NEW_PARAMETER, paramName, facade.getElementFactory().createTypeFromText(classTypeText, method), null) { @Nullable @Override public PsiElement getActualValue(PsiElement exp, Object substitutor) { final IntroduceParameterObjectDelegate<PsiNamedElement, ParameterInfo, IntroduceParameterObjectClassDescriptor<PsiNamedElement, ParameterInfo>> delegate = findDelegate(exp); return delegate != null ? delegate.createNewParameterInitializerAtCallSite(exp, descriptor, oldMethodParameters, substitutor) : null; } }; }