*/
public JExpression shortCircuitAnd(JBinaryOperation original,
SourceInfo info, JExpression lhs, JExpression rhs) {
info = getBestSourceInfo(original, info, lhs);
if (lhs instanceof JBooleanLiteral) {
JBooleanLiteral booleanLiteral = (JBooleanLiteral) lhs;
if (booleanLiteral.getValue()) {
return rhs;
} else {
return lhs;
}
} else if (rhs instanceof JBooleanLiteral) {
JBooleanLiteral booleanLiteral = (JBooleanLiteral) rhs;
if (booleanLiteral.getValue()) {
return lhs;
} else if (!lhs.hasSideEffects()) {
return rhs;
}
}