Rollback: "Avoid string comparisons when comparing intern'd strings."
interning isn't currently preserved for multi-stage builds
@@ -2052,21 +2052,18 @@ public class Node implements Serializable {
* Returns whether a node matches a simple or a qualified name, such as <code>x</code> or <code>
* a.b.c</code> or <code>this.a</code>.
*/
- @SuppressWarnings("ReferenceEquality")
public boolean matchesQualifiedName(Node n) {
if (n == null || n.token != token) {
return false;
}
switch (token) {
case NAME:
- // ==, rather than equal as it is intern'd in setString
- return !getString().isEmpty() && getString() == n.getString();
+ return !getString().isEmpty() && getString().equals(n.getString());
case THIS:
case SUPER:
return true;
case GETPROP:
- // ==, rather than equal as it is intern'd in setString
- return getLastChild().getString() == n.getLastChild().getString()
+ return getLastChild().getString().equals(n.getLastChild().getString())
&& getFirstChild().matchesQualifiedName(n.getFirstChild());
default:
return false;
