Source:
<code>public static Expression transformInlineConstants(final Expression exp) { if (exp instanceof PropertyExpression) { PropertyExpression pe = (PropertyExpression) exp; if (pe.getObjectExpression() instanceof ClassExpression) { ClassExpression ce = (ClassExpression) pe.getObjectExpression(); ClassNode type = ce.getType(); FieldNode field = ClassNodeUtils.getField(type, pe.getPropertyAsString()); if (type.isEnum() && field != null && field.isEnum()) return exp; Expression constant = findConstant(field); if (constant != null) return constant; } } else if (exp instanceof BinaryExpression) { BinaryExpression be = (BinaryExpression) exp; Expression lhs = transformInlineConstants(be.getLeftExpression()); Expression rhs = transformInlineConstants(be.getRightExpression()); <START> if (lhs instanceof ConstantExpression && rhs instanceof ConstantExpression && <END> lhs.getType().equals(ClassHelper.STRING_TYPE) && rhs.getType().equals(ClassHelper.STRING_TYPE)) { return configure(be, new ConstantExpression(lhs.getText() + rhs.getText())); } be.setLeftExpression(lhs); be.setRightExpression(rhs); return be; } else if (exp instanceof ListExpression) { ListExpression origList = (ListExpression) exp; ListExpression newList = new ListExpression(); boolean changed = false; for (Expression e : origList.getExpressions()) { Expression transformed = transformInlineConstants(e); newList.addExpression(transformed); if (transformed != e) changed = true; } if (changed) { newList.setSourcePosition(origList); return newList; } return origList; } return exp; }</code><technical_language>check be.operation.type == Types.PLUS too</technical_language>

Target:
public static Expression transformInlineConstants(final Expression exp) { if (exp instanceof PropertyExpression) { PropertyExpression pe = (PropertyExpression) exp; if (pe.getObjectExpression() instanceof ClassExpression) { ClassExpression ce = (ClassExpression) pe.getObjectExpression(); ClassNode type = ce.getType(); FieldNode field = ClassNodeUtils.getField(type, pe.getPropertyAsString()); if (type.isEnum() && field != null && field.isEnum()) return exp; Expression constant = findConstant(field); if (constant != null) return constant; } } else if (exp instanceof BinaryExpression) { BinaryExpression be = (BinaryExpression) exp; Expression lhs = transformInlineConstants(be.getLeftExpression()); Expression rhs = transformInlineConstants(be.getRightExpression()); if (be.getOperation().getType() == PLUS && lhs instanceof ConstantExpression && rhs instanceof ConstantExpression && lhs.getType().equals(ClassHelper.STRING_TYPE) && rhs.getType().equals(ClassHelper.STRING_TYPE)) { return configure(be, new ConstantExpression(lhs.getText() + rhs.getText())); } be.setLeftExpression(lhs); be.setRightExpression(rhs); return be; } else if (exp instanceof ListExpression) { ListExpression origList = (ListExpression) exp; ListExpression newList = new ListExpression(); boolean changed = false; for (Expression e : origList.getExpressions()) { Expression transformed = transformInlineConstants(e); newList.addExpression(transformed); if (transformed != e) changed = true; } if (changed) { newList.setSourcePosition(origList); return newList; } return origList; } return exp; }