Ensure target non-null in Transition constructor (additional runtime-side consistency check).

This commit is contained in:
Sam Harwell 2012-03-19 08:33:36 -05:00
parent 4bc615d72f
commit 5e0f9a4490
1 changed files with 7 additions and 1 deletions
runtime/Java/src/org/antlr/v4/runtime/atn

View File

@ -91,7 +91,13 @@ public abstract class Transition {
@NotNull
public ATNState target;
protected Transition(@NotNull ATNState target) { this.target = target; }
protected Transition(@NotNull ATNState target) {
if (target == null) {
throw new NullPointerException("target cannot be null.");
}
this.target = target;
}
public int getSerializationType() { return 0; }