diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-04-03 19:22:48 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-04-03 19:22:48 -0400 |
| commit | 1c8bc7132d980c1ff2dbd6b9af579c3b2fd8c63e (patch) | |
| tree | a29777f07ebd81fbef61b5ae02f13f1a9d8f65a2 /BJC-Utils2/src/main/java/bjc/utils/gen/RandomGrammar.java | |
| parent | a023de85aa08c8f2b8b2441c6b14064eabee2775 (diff) | |
General code refactoring and maintenance
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/gen/RandomGrammar.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/gen/RandomGrammar.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/gen/RandomGrammar.java b/BJC-Utils2/src/main/java/bjc/utils/gen/RandomGrammar.java index ca0578d..4f194f3 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/gen/RandomGrammar.java +++ b/BJC-Utils2/src/main/java/bjc/utils/gen/RandomGrammar.java @@ -62,6 +62,10 @@ public class RandomGrammar<E> extends WeightedGrammar<E> { * The cases to add for this rule. */ public void makeRule(E rule, FunctionalList<FunctionalList<E>> cases) { + if (cases == null) { + throw new NullPointerException("Cases must not be null"); + } + super.addRule(rule); cases.forEach(currentCase -> super.addCase(rule, 1, currentCase)); |
