boolean isAmpAmp = operator.getType() == TokenType.AMPERSAND_AMPERSAND;
boolean isBarBar = operator.getType() == TokenType.BAR_BAR;
if (isAmpAmp || isBarBar) {
Expression lhsCondition = node.getLeftOperand();
if (!isDebugConstant(lhsCondition)) {
ValidResult lhsResult = getConstantBooleanValue(lhsCondition);
if (lhsResult != null) {
if (lhsResult.isTrue() && isBarBar) {
// report error on else block: true || !e!
errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.getRightOperand());
// only visit the LHS:
safelyVisit(lhsCondition);
return null;
} else if (lhsResult.isFalse() && isAmpAmp) {
// report error on if block: false && !e!
errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.getRightOperand());
// only visit the LHS:
safelyVisit(lhsCondition);
return null;