use of org.eclipse.jdt.core.dom.Assignment in project Main by SpartanRefactoring.
the class AssignmentOperatorBloater method tip.
@Override
public Tip tip(final Assignment ¢) {
return new Tip(description(¢), getClass(), ¢) {
@Override
public void go(final ASTRewrite r, final TextEditGroup g) {
// TODO Ori Roth: use class subject
final InfixExpression e = ¢.getAST().newInfixExpression();
e.setLeftOperand(copy.of(left(¢)));
e.setRightOperand(make.plant(copy.of(right(¢))).into(e));
e.setOperator(op.assign2infix(¢.getOperator()));
final Assignment a = ¢.getAST().newAssignment();
a.setLeftHandSide(copy.of(left(¢)));
a.setRightHandSide(fix(e, left(¢).resolveTypeBinding()));
a.setOperator(Operator.ASSIGN);
r.replace(¢, a, g);
}
};
}
Aggregations