diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java b/runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java index f9276589d..b8b7a7d3e 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java @@ -30,7 +30,6 @@ package org.antlr.v4.runtime.atn; -import org.antlr.misc.MutableInteger; import org.antlr.v4.runtime.Recognizer; import org.antlr.v4.runtime.RuleContext; import org.antlr.v4.runtime.misc.DoubleKeyMap; @@ -655,26 +654,6 @@ public abstract class PredictionContext implements Iterable visited = - new IdentityHashMap(); - countAllContextNodes_(context, count, visited); - return count.value; - } - - public static void countAllContextNodes_(PredictionContext context, - MutableInteger count, - Map visited) - { - if ( context==null || visited.containsKey(context) ) return; - visited.put(context, context); - count.value++; - for (int i = 0; i < context.size(); i++) { - countAllContextNodes_(context.getParent(i), count, visited); - } - } - public String toString(@Nullable Recognizer recog) { return toString(); // return toString(recog, ParserRuleContext.EMPTY);