boolean (@Nullable PsiExpression condition, @Nullable PsiStatement body) { if (body == null) { return false; } if (!(condition instanceof PsiPolyadicExpression polyadicExpression)) { return false; } final IElementType tokenType = polyadicExpression.getOperationTokenType(); if (JavaTokenType.ANDAND == tokenType) { for (PsiExpression operand : polyadicExpression.getOperands()) { if (checkCondition(operand, body)) { return true; } } return false; } if (JavaTokenType.EQEQ != tokenType) { return false; } final PsiExpression[] operands = polyadicExpression.getOperands(); if (operands.length != 2) { return false; } final PsiExpression lhs = operands[0]; final PsiExpression rhs = operands[1]; if (PsiUtil.isConstantExpression(lhs)) { return checkConstantValueVariableUse(rhs, lhs, body); } else if (PsiUtil.isConstantExpression(rhs)) { return checkConstantValueVariableUse(lhs, rhs, body); } return false; }