@Override public void visitAssignmentExpression(AssignmentExpressionTree tree) { Type wrapper = ((JavaType) tree.expression().symbolType()).primitiveWrapperType(); if (tree.is(Kind.PLUS_ASSIGNMENT) && tree.variable().symbolType().is("java.lang.String") && wrapper != null) { createIssue(tree, wrapper.name()); } super.visitAssignmentExpression(tree); }
private void checkConcatenation( Tree tree, ExpressionTree leftOperand, ExpressionTree rightOperand) { Type wrapper = null; if (isEmptyString(leftOperand)) { wrapper = ((JavaType) rightOperand.symbolType()).primitiveWrapperType(); } else if (isEmptyString(rightOperand)) { wrapper = ((JavaType) leftOperand.symbolType()).primitiveWrapperType(); } if (wrapper != null) { createIssue(tree, wrapper.name()); } }