// TODO(spoon): immediately simplify the newMulti
return newMulti;
}
if (arg instanceof JBinaryOperation) {
// try to invert the binary operator
JBinaryOperation argOp = (JBinaryOperation) arg;
JBinaryOperator op = argOp.getOp();
JBinaryOperator newOp = null;
if (op == JBinaryOperator.EQ) {
// e.g. !(x == y) -> x != y
newOp = JBinaryOperator.NEQ;
} else if (op == JBinaryOperator.NEQ) {
// e.g. !(x != y) -> x == y
newOp = JBinaryOperator.EQ;
} else if (op == JBinaryOperator.GT) {
// e.g. !(x > y) -> x <= y
newOp = JBinaryOperator.LTE;
} else if (op == JBinaryOperator.LTE) {
// e.g. !(x <= y) -> x > y
newOp = JBinaryOperator.GT;
} else if (op == JBinaryOperator.GTE) {
// e.g. !(x >= y) -> x < y
newOp = JBinaryOperator.LT;
} else if (op == JBinaryOperator.LT) {
// e.g. !(x < y) -> x >= y
newOp = JBinaryOperator.GTE;
}
if (newOp != null) {
JBinaryOperation newBinOp =
new JBinaryOperation(info, argOp.getType(), newOp, argOp.getLhs(), argOp.getRhs());
return newBinOp;
}
} else if (arg instanceof JPrefixOperation) {
// try to invert the unary operator
JPrefixOperation argOp = (JPrefixOperation) arg;