diff --git a/build.gradle b/build.gradle index 761acf6..042b805 100644 --- a/build.gradle +++ b/build.gradle @@ -44,6 +44,7 @@ jar { into 'res', { from 'res' + exclude 'extlibs/' } into 'licenses', { diff --git a/src/main/java/se306/a1/scheduler/util/parse/CLIParser.java b/src/main/java/se306/a1/scheduler/util/parse/CLIParser.java index 8500a6a..a08a927 100644 --- a/src/main/java/se306/a1/scheduler/util/parse/CLIParser.java +++ b/src/main/java/se306/a1/scheduler/util/parse/CLIParser.java @@ -91,6 +91,9 @@ public InputConfig parseCLI(String[] args) throws ParseException, CLIException { if (isInteger(stringCores)) { config.cores = Integer.parseInt(stringCores); + if (config.cores < 1) { + throw new CLIException("Number of cores specified cannot be less than 1"); + } logger.info("Has specified parallel option: number of cores = " + config.cores); } else { logger.error("Number of cores is not an integer"); diff --git a/src/main/java/se306/a1/scheduler/util/parse/GraphParser.java b/src/main/java/se306/a1/scheduler/util/parse/GraphParser.java index c1ab842..a27a323 100644 --- a/src/main/java/se306/a1/scheduler/util/parse/GraphParser.java +++ b/src/main/java/se306/a1/scheduler/util/parse/GraphParser.java @@ -43,6 +43,10 @@ public static Graph parse(String inputPath) throws IOException, GraphException { Map nodes = new HashMap<>(); List edges = new ArrayList<>(); + if (parsedNodes.values().isEmpty()) { + throw new GraphException("No nodes contained in the graph"); + } + for (GraphNode node : parsedNodes.values()) { String label = node.getId();