From 5c328c7e3f8379ee24a4e68458051d9f90d121e1 Mon Sep 17 00:00:00 2001 From: parrt Date: Tue, 3 Jan 2012 12:40:42 -0800 Subject: [PATCH] Bug: didn't stop at end of stream during consume() [git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9794] --- runtime/Java/src/org/antlr/v4/runtime/CommonTokenStream.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/Java/src/org/antlr/v4/runtime/CommonTokenStream.java b/runtime/Java/src/org/antlr/v4/runtime/CommonTokenStream.java index 0d08936cc..1741da6ef 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/CommonTokenStream.java +++ b/runtime/Java/src/org/antlr/v4/runtime/CommonTokenStream.java @@ -67,9 +67,12 @@ public class CommonTokenStream extends BufferedTokenStream { if ( p == -1 ) setup(); p++; sync(p); - while ( tokens.get(p).getChannel()!=channel ) { + CommonToken t = tokens.get(p); + int n = size(); + while ( p