PsiElement (PsiStatement loopStatement, PsiVariable var, String streamText, PsiType expressionType, OperationReductionMigration.ReductionOperation reductionOperation, CommentTracker ct) { InitializerUsageStatus status = ControlFlowUtils.getInitializerUsageStatus(var, loopStatement); if (status != InitializerUsageStatus.UNKNOWN) { PsiExpression initializer = var.getInitializer(); if (initializer != null && reductionOperation.getInitializerExpressionRestriction().test(initializer)) { PsiType type = var.getType(); String replacement = (type.isAssignableFrom(expressionType) ? "" : "(" + type.getCanonicalText() + ") ") + streamText; return replaceInitializer(loopStatement, var, initializer, replacement, status, ct); } } return ct.replaceAndRestoreComments(loopStatement, var.getName() + reductionOperation.getOperation() + "=" + streamText + ";"); }