From f9396907bd669900a065c6782912f3e09d362720 Mon Sep 17 00:00:00 2001 From: sharwell Date: Thu, 17 Nov 2011 16:48:30 -0800 Subject: [PATCH] v4: Clean up impl with generic List field [git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9338] --- .../src/org/antlr/v4/runtime/ANTLRStringStream.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/runtime/Java/src/org/antlr/v4/runtime/ANTLRStringStream.java b/runtime/Java/src/org/antlr/v4/runtime/ANTLRStringStream.java index e8f427b92..153d78458 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/ANTLRStringStream.java +++ b/runtime/Java/src/org/antlr/v4/runtime/ANTLRStringStream.java @@ -58,7 +58,7 @@ public class ANTLRStringStream implements CharStream { * move through the input stream. Indexed from 1..markDepth. * A null is kept @ index 0. Create upon first call to mark(). */ - protected List markers; + protected List markers; /** Track the last mark() call result value for use in rewind(). */ protected int lastMarker; @@ -149,17 +149,17 @@ public class ANTLRStringStream implements CharStream { public int mark() { if ( markers==null ) { - markers = new ArrayList(); + markers = new ArrayList(); markers.add(null); // depth 0 } markDepth++; - CharStreamState state = null; + CharStreamState state; if ( markDepth>=markers.size() ) { state = new CharStreamState(); markers.add(state); } else { - state = (CharStreamState)markers.get(markDepth); + state = markers.get(markDepth); } state.p = p; state.line = line; @@ -169,7 +169,7 @@ public class ANTLRStringStream implements CharStream { } public void rewind(int m) { - CharStreamState state = (CharStreamState)markers.get(m); + CharStreamState state = markers.get(m); // restore stream state seek(state.p); line = state.line;