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;