diff --git a/tool/src/org/antlr/v4/analysis/NFAContext.java b/tool/src/org/antlr/v4/analysis/NFAContext.java index d483a06eb..529e11121 100644 --- a/tool/src/org/antlr/v4/analysis/NFAContext.java +++ b/tool/src/org/antlr/v4/analysis/NFAContext.java @@ -100,6 +100,9 @@ public class NFAContext { */ public boolean equals(Object o) { NFAContext other = ((NFAContext)o); + if ( this.cachedHashCode != other.cachedHashCode ) { + return false; // can't be same if hash is different + } if ( this==other ) return true; // System.out.println("comparing "+this+" with "+other);