From 9a4d23c790aeeb229c274b96c46d6572f2f9d9f7 Mon Sep 17 00:00:00 2001 From: jing-xuan Date: Mon, 11 Nov 2019 23:49:38 +0800 Subject: [PATCH 1/3] fixed log issue --- src/main/java/logic/Parser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/logic/Parser.java b/src/main/java/logic/Parser.java index 8eb75f735e..180477bad2 100644 --- a/src/main/java/logic/Parser.java +++ b/src/main/java/logic/Parser.java @@ -225,7 +225,7 @@ private static Command parseTaskLog(String userInput) throws FarmioException { if (matcher.find()) { int pageNumber = 0; try { - Integer.parseInt(matcher.group("index")); + pageNumber = Integer.parseInt(matcher.group("index")); } catch (NumberFormatException e) { throw new FarmioException("Your number is too big!"); } From f093fb9076af086b4bfacaa84b2356623cf573dd Mon Sep 17 00:00:00 2001 From: jing-xuan Date: Tue, 12 Nov 2019 00:10:04 +0800 Subject: [PATCH 2/3] let task commands be accepted --- build.gradle | 2 +- src/main/java/logic/Parser.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 14f4312ad7..fc8a0cebb9 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ checkstyle { shadowJar { archiveBaseName = "farmio" - archiveVersion = "v1.0" + archiveVersion = "v1.4" archiveClassifier = null archiveAppendix = null } diff --git a/src/main/java/logic/Parser.java b/src/main/java/logic/Parser.java index 180477bad2..2abac51a1d 100644 --- a/src/main/java/logic/Parser.java +++ b/src/main/java/logic/Parser.java @@ -178,7 +178,7 @@ private static Command parseTaskAdd(String userInput) throws FarmioException { if (userInput.equals("market")) { return new CommandShowList("MarketList"); } - if (userInput.equals("task logic.commands") || userInput.equals("task command")) { + if (userInput.equals("task commands") || userInput.equals("task command")) { return new CommandShowList("TaskCommands"); } if (userInput.startsWith("do") || userInput.startsWith("if")) { From c90b0638f3753a76d9710e62f30b4221bd44c78b Mon Sep 17 00:00:00 2001 From: jing-xuan Date: Tue, 12 Nov 2019 00:38:33 +0800 Subject: [PATCH 3/3] Fixed parseInt issues --- src/main/java/logic/Parser.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/logic/Parser.java b/src/main/java/logic/Parser.java index 2abac51a1d..e4167e626d 100644 --- a/src/main/java/logic/Parser.java +++ b/src/main/java/logic/Parser.java @@ -327,7 +327,7 @@ private static Command parseTaskEdit(String userInput) throws FarmioException { if (matcher.find()) { int taskID = 0; try { - Integer.parseInt(matcher.group("index")); + taskID = Integer.parseInt(matcher.group("index")); } catch (NumberFormatException e) { throw new FarmioException("Your number is too large"); } @@ -350,7 +350,7 @@ private static Command parseTaskInsert(String userInput) throws FarmioException if (matcher.find()) { int taskID = 0; try { - Integer.parseInt(matcher.group("id")); + taskID = Integer.parseInt(matcher.group("id")); } catch (NumberFormatException e) { throw new FarmioException("Your number is too large!"); }