(dogfood) Further CompareObjectsWithEquals fixes

This commit is contained in:
Andreas Dangel
2020-12-17 16:40:52 +01:00
parent 3a82cf5ae1
commit 62a052e97b
25 changed files with 47 additions and 37 deletions

View File

@ -41,7 +41,7 @@ public class ASTName extends AbstractEcmascriptNode<Name> {
*/
public boolean isFunctionNodeName() {
return getParent() instanceof ASTFunctionNode
&& ((ASTFunctionNode) getParent()).getFunctionName() == this;
&& this.equals(((ASTFunctionNode) getParent()).getFunctionName());
}
/**
@ -55,7 +55,7 @@ public class ASTName extends AbstractEcmascriptNode<Name> {
if (getParent() instanceof ASTFunctionNode) {
ASTFunctionNode functionNode = (ASTFunctionNode) getParent();
for (int i = 0; i < functionNode.getNumParams(); i++) {
if (functionNode.getParam(i) == this) {
if (this.equals(functionNode.getParam(i))) {
return true;
}
}
@ -70,7 +70,7 @@ public class ASTName extends AbstractEcmascriptNode<Name> {
* otherwise.
*/
public boolean isFunctionCallName() {
return getParent() instanceof ASTFunctionCall && ((ASTFunctionCall) getParent()).getTarget() == this;
return getParent() instanceof ASTFunctionCall && this.equals(((ASTFunctionCall) getParent()).getTarget());
}
/**
@ -81,6 +81,6 @@ public class ASTName extends AbstractEcmascriptNode<Name> {
*/
public boolean isVariableDeclaration() {
return getParent() instanceof ASTVariableInitializer
&& ((ASTVariableInitializer) getParent()).getTarget() == this;
&& this.equals(((ASTVariableInitializer) getParent()).getTarget());
}
}

View File

@ -211,7 +211,7 @@ public final class EcmascriptTreeBuilder implements NodeVisitor {
@Override
public boolean visit(AstNode node) {
if (parents.peek() == node) {
if (node.equals(parents.peek())) {
return true;
} else {
buildInternal(node);