void (GrVariable variable, StringBuilder builder, ExpressionContext expressionContext) { PsiType type = expressionContext.typeProvider.getVarType(variable); ModifierListGenerator.writeModifiers(builder, variable.getModifierList()); PsiType originalType = type; LocalVarAnalyzer.Result analyzedVars = expressionContext.analyzedVars; boolean wrapped = false; if (analyzedVars != null) { if (analyzedVars.toMakeFinal(variable) && !variable.hasModifierProperty(PsiModifier.FINAL)) { builder.append(PsiModifier.FINAL).append(' '); } else if (analyzedVars.toWrap(variable)) { builder.append(PsiModifier.FINAL).append(' '); type = JavaPsiFacade.getElementFactory(expressionContext.project).createTypeFromText( GroovyCommonClassNames.GROOVY_LANG_REFERENCE + "<" + getTypeText(originalType, variable) + ">", variable); wrapped = true; } } TypeWriter.writeType(builder, type, variable); builder.append(' '); writeVariableWithoutType(builder, expressionContext, variable, wrapped, originalType); }