Ensure target non-null in Transition constructor (additional runtime-side consistency check).
This commit is contained in:
parent
4bc615d72f
commit
5e0f9a4490
|
@ -91,7 +91,13 @@ public abstract class Transition {
|
||||||
@NotNull
|
@NotNull
|
||||||
public ATNState target;
|
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; }
|
public int getSerializationType() { return 0; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue