Source:
<code>private void buildPlusOrAssignmentInvocation(BlockBuilder blockBuilder, IdentifierGenerator idGenerator, Tree element) { boolean elementIsString = isString(((ExpressionTree) element).symbolType()); if (element.is(PLUS) && elementIsString) { BinaryExpressionTree binaryExpressionTree = (BinaryExpressionTree) element; Expression lhs = idGenerator.lookupExpressionFor(binaryExpressionTree.leftOperand()); Expression rhs = idGenerator.lookupExpressionFor(binaryExpressionTree.rightOperand()); Expression.Variable var = variableWithId(idGenerator.newIdFor(binaryExpressionTree)); blockBuilder.assignTo(var, call("__concat").withArgs(lhs, rhs), location(element)); } else if (element.is(PLUS_ASSIGNMENT) && elementIsString) { Expression var = idGenerator.lookupExpressionFor(((AssignmentExpressionTree) element).variable()); Expression expr = idGenerator.lookupExpressionFor(((AssignmentExpressionTree) element).expression()); <START> if (!var.isConstant()) { <END> idGenerator.varForExpression(element, ((Expression.Variable) var).id()); blockBuilder.assignTo((Expression.Variable) var, call("__concat").withArgs(var, expr), location(element)); } } else if (element.is(ASSIGNMENT)) { Expression var = idGenerator.lookupExpressionFor(((AssignmentExpressionTree) element).variable()); Expression expr = idGenerator.lookupExpressionFor(((AssignmentExpressionTree) element).expression()); if (!var.isConstant()) { blockBuilder.assignTo((Expression.Variable) var, call("__id").withArgs(expr), location(element)); } } }</code><technical_language>this condition safely cast Variable, upgrade latest version of protobuf this is enough guarantee var Expression.Variable</technical_language>

Target:
private void buildPlusOrAssignmentInvocation(BlockBuilder blockBuilder, IdentifierGenerator idGenerator, Tree element) { boolean elementIsString = (((ExpressionTree) element).symbolType()).is("java.lang.String"); if (element.is(PLUS) && elementIsString) { BinaryExpressionTree binaryExpressionTree = (BinaryExpressionTree) element; Expression lhs = idGenerator.lookupExpressionFor(binaryExpressionTree.leftOperand()); Expression rhs = idGenerator.lookupExpressionFor(binaryExpressionTree.rightOperand()); Expression.Variable var = variableWithId(idGenerator.newIdFor(binaryExpressionTree)); blockBuilder.assignTo(var, call("__concat").withArgs(lhs, rhs), location(element)); } else if (element.is(PLUS_ASSIGNMENT) && elementIsString) { Expression var = idGenerator.lookupExpressionFor(((AssignmentExpressionTree) element).variable()); Expression expr = idGenerator.lookupExpressionFor(((AssignmentExpressionTree) element).expression()); if (var instanceof Expression.Variable) { idGenerator.varForExpression(element, ((Expression.Variable) var).id()); blockBuilder.assignTo((Expression.Variable) var, call("__concat").withArgs(var, expr), location(element)); } } else if (element.is(ASSIGNMENT)) { Expression var = idGenerator.lookupExpressionFor(((AssignmentExpressionTree) element).variable()); Expression expr = idGenerator.lookupExpressionFor(((AssignmentExpressionTree) element).expression()); if (var instanceof Expression.Variable) { blockBuilder.assignTo((Expression.Variable) var, call("__id").withArgs(expr), location(element)); } } }