diff --git a/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java b/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java index 9be9d967ef..fad6f68b63 100644 --- a/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java +++ b/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java @@ -50,7 +50,7 @@ public class PlanViewImpl implements PlanView { static String rssPrefix = "http://issues.apache.org/jira/si/jira.issueviews:issue-xml/"; @Property public String planFile = "src/main/resources/jiraSideBand.xml"; - + @Init public void init() { } @@ -60,6 +60,7 @@ public class PlanViewImpl implements PlanView { try { p = readPlan(); augmentPlan(p); + writePlan(p); } catch (Exception e) { e.printStackTrace(); } @@ -236,10 +237,15 @@ public class PlanViewImpl implements PlanView { Unmarshaller m = jaxbContext.createUnmarshaller(); File inputFile = new File(planFile).getAbsoluteFile(); + if(!inputFile.exists()){ // start afresh + Plan newPlan = new Plan(); + writePlan(newPlan); + inputFile = new File(planFile).getAbsoluteFile(); + } p = (Plan)m.unmarshal(inputFile); } catch(Exception e) { - // FIXME + throw new IllegalStateException("Failed to read plan file",e); } return p; }