From 53b0097c7b8fe75cc7175ab68865b79bebb825d5 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 7 Jan 2016 14:22:57 -0500 Subject: [PATCH] Add null checks to clear warning from IntelliJ --- src/main/java/com/etsy/arbiter/OozieWorkflowGenerator.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/etsy/arbiter/OozieWorkflowGenerator.java b/src/main/java/com/etsy/arbiter/OozieWorkflowGenerator.java index 4d37614..56d7736 100644 --- a/src/main/java/com/etsy/arbiter/OozieWorkflowGenerator.java +++ b/src/main/java/com/etsy/arbiter/OozieWorkflowGenerator.java @@ -122,6 +122,9 @@ public void generateOozieWorkflows(String outputBase, List workflows, Action transition = getTransition(workflowGraph, a); switch (a.getType()) { case "start": + if (transition == null) { + throw new RuntimeException("No transition found for start action"); + } directives.add("start") .attr("to", transition.getName()) .up(); @@ -141,6 +144,9 @@ public void generateOozieWorkflows(String outputBase, List workflows, directives.up(); break; case "join": + if (transition == null) { + throw new RuntimeException(String.format("No transition found for join action %s", a.getName())); + } directives.add("join") .attr("name", a.getName()) .attr("to", transition.getName())