@Override
 public void visitBinaryExpression(PsiBinaryExpression expression) {
   final IElementType tokenType = expression.getOperationTokenType();
   if (JavaTokenType.OROR != tokenType) {
     return;
   }
   final PsiExpression lhs = expression.getLOperand();
   final PsiExpression rhs = expression.getROperand();
   final Pair<PsiReferenceExpression, PsiExpression> pair1 = getReferenceExpressionPair(lhs);
   final Pair<PsiReferenceExpression, PsiExpression> pair2 = getReferenceExpressionPair(rhs);
   if (pair1 == null || pair2 == null) {
     return;
   }
   final PsiExpression expression1 = pair1.getSecond();
   final PsiExpression expression2 = pair2.getSecond();
   if (expression1 == null || expression2 == null) {
     return;
   }
   final Project project = expression1.getProject();
   final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project);
   final PsiConstantEvaluationHelper constantEvaluationHelper =
       psiFacade.getConstantEvaluationHelper();
   final Object constant1 = constantEvaluationHelper.computeConstantExpression(expression1);
   final Object constant2 = constantEvaluationHelper.computeConstantExpression(expression2);
   if (constant1 == null || constant2 == null || constant1 == constant2) {
     return;
   }
   final PsiReferenceExpression referenceExpression1 = pair1.getFirst();
   final PsiReferenceExpression referenceExpression2 = pair2.getFirst();
   if (referenceExpression1.resolve() == referenceExpression2.resolve()) {
     registerError(expression);
   }
 }
 private boolean isTrivial(PsiMethod method) {
   final PsiCodeBlock body = method.getBody();
   if (body == null) {
     return true;
   }
   final PsiStatement[] statements = body.getStatements();
   if (statements.length == 0) {
     return true;
   }
   final Project project = method.getProject();
   final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project);
   final PsiConstantEvaluationHelper evaluationHelper = psiFacade.getConstantEvaluationHelper();
   for (PsiStatement statement : statements) {
     if (!(statement instanceof PsiIfStatement)) {
       return false;
     }
     final PsiIfStatement ifStatement = (PsiIfStatement) statement;
     final PsiExpression condition = ifStatement.getCondition();
     final Object result = evaluationHelper.computeConstantExpression(condition);
     if (result == null || !result.equals(Boolean.FALSE)) {
       return false;
     }
   }
   return true;
 }