Example usage for org.eclipse.jdt.core.dom Expression equals

List of usage examples for org.eclipse.jdt.core.dom Expression equals

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom Expression equals.

Prototype

@Override
public final boolean equals(Object obj) 

Source Link

Document

The ASTNode implementation of this Object method uses object identity (==).

Usage

From source file:org.autorefactor.refactoring.rules.UseStringContainsRefactoring.java

License:Open Source License

private boolean is(final InfixExpression ie, MethodInvocation node, Operator operator, Integer constant) {
    final Expression leftOp = removeParentheses(ie.getLeftOperand());
    final Expression rightOp = removeParentheses(ie.getRightOperand());
    if (hasOperator(ie, operator)) {
        if (leftOp.equals(node) && constant.equals(rightOp.resolveConstantExpressionValue())) {
            return true;
        } else if (rightOp.equals(node) && constant.equals(leftOp.resolveConstantExpressionValue())) {
            return true;
        }/*from www  .  j av  a2  s. c  o  m*/
    }
    return false;
}