// binary expression.
// TODO(jwren) Do we want to take constant expressions into account, evaluate if(false) {}
// differently than if(<condition>), when <condition> evaluates to a constant false value?
if (operatorType == TokenType.BAR_BAR) {
if (lhsExpression instanceof BooleanLiteral) {
BooleanLiteral booleanLiteral = (BooleanLiteral) lhsExpression;
if (!booleanLiteral.getValue()) {
return false;
}
}
}
// If the operator is && and the left hand side is true literal, don't consider the RHS of the
// binary expression.
if (operatorType == TokenType.AMPERSAND_AMPERSAND) {
if (lhsExpression instanceof BooleanLiteral) {
BooleanLiteral booleanLiteral = (BooleanLiteral) lhsExpression;
if (booleanLiteral.getValue()) {
return false;
}
}
}
Expression rhsExpression = node.getRightOperand();