diff --git a/src/main/java/duke/Deadline.java b/src/main/java/duke/Deadline.java index d9ca2f0165..6848fad6a3 100644 --- a/src/main/java/duke/Deadline.java +++ b/src/main/java/duke/Deadline.java @@ -41,7 +41,6 @@ private LocalDateTime parseDueDate(String dueDate) throws BotException { try { return LocalDateTime.parse(dueDate, formatter); } catch (DateTimeParseException ignored) { - continue; } } throw new BotException("Invalid date format." diff --git a/src/main/java/duke/Duke.java b/src/main/java/duke/Duke.java index 57bcf5029b..ed4bf9e7f8 100644 --- a/src/main/java/duke/Duke.java +++ b/src/main/java/duke/Duke.java @@ -212,7 +212,7 @@ private String handleDeleteCommand(String[] userInputArray) throws BotException /** * Handles the marking of a task as done * - * @param inputs The user inputs + * @param userInputArray The user inputs * @throws BotException If the task number is missing, not numeric, or out of * range */ @@ -241,7 +241,7 @@ private String handleMarkTask(String[] userInputArray) throws BotException { /** * Handles the command to unmark a task * - * @param inputs The array of inputs containing the task number to unmark + * @param userInputArray The array of inputs containing the task number to unmark * @throws BotException If the task number is not provided, is not numeric, or * is out of range */ @@ -270,7 +270,7 @@ private String handleUnmarkTask(String[] userInputArray) throws BotException { /** * Handles the "todo" command by adding a new todo task to the task list * - * @param userInputArr the array containing the user input + * @param userInputArray the array containing the user input * @throws BotException if the description of the todo is empty */ private String handleTodoCommand(String[] userInputArray) throws BotException { @@ -288,7 +288,7 @@ private String handleTodoCommand(String[] userInputArray) throws BotException { /** * Handles the "deadline" command by adding a deadline task to the task list * - * @param userInputArr the array containing the user input + * @param userInputArray the array containing the user input * @throws BotException if the user input is incomplete */ private String handleDeadlineCommand(String[] userInputArray) throws BotException { @@ -314,7 +314,7 @@ private String handleDeadlineCommand(String[] userInputArray) throws BotExceptio * Adds the event task to the task list with the specified start time and end * time * - * @param userInputArr the user input array containing the event command and its + * @param userInputArray the user input array containing the event command and its * arguments * @throws BotException if the description and time of an event are empty */ diff --git a/src/main/java/duke/Main.java b/src/main/java/duke/Main.java index b57fa59e54..464a805235 100644 --- a/src/main/java/duke/Main.java +++ b/src/main/java/duke/Main.java @@ -45,6 +45,7 @@ public void start(Stage stage) { Scene scene = new Scene(ap); stage.setScene(scene); fxmlLoader.getController().setDuke(duke); + stage.setTitle("WannaBeSkynet"); stage.show(); } catch (IOException e) { e.printStackTrace(); diff --git a/src/main/java/duke/Parser.java b/src/main/java/duke/Parser.java index c392cd01b1..fe80aeaf71 100644 --- a/src/main/java/duke/Parser.java +++ b/src/main/java/duke/Parser.java @@ -183,7 +183,7 @@ private void handleDeleteCommand(String[] userInputArray) throws BotException { /** * Handles the "todo" command by adding a new todo task to the task list * - * @param userInputArr the array containing the user input + * @param userInputArray the array containing the user input * @throws BotException if the description of the todo is empty */ private void handleTodoCommand(String[] userInputArray) throws BotException { @@ -198,7 +198,7 @@ private void handleTodoCommand(String[] userInputArray) throws BotException { /** * Handles the "deadline" command by adding a deadline task to the task list * - * @param userInputArr the array containing the user input + * @param userInputArray the array containing the user input * @throws BotException if the user input is incomplete */ private void handleDeadlineCommand(String[] userInputArray) throws BotException { @@ -219,7 +219,7 @@ private void handleDeadlineCommand(String[] userInputArray) throws BotException * Adds the event task to the task list with the specified start time and end * time * - * @param userInputArr the user input array containing the event command and its + * @param userInputArray the user input array containing the event command and its * arguments * @throws BotException if the description and time of an event are empty */ @@ -252,7 +252,7 @@ private void addTaskMsg() { /** * Handles the marking of a task as done * - * @param inputs The user inputs + * @param userInputArray The user inputs * @throws BotException If the task number is missing, not numeric, or out of * range */ @@ -280,7 +280,7 @@ private void markTaskHandler(String[] userInputArray) throws BotException { /** * Handles the command to unmark a task * - * @param inputs The array of inputs containing the task number to unmark + * @param userInputArray The array of inputs containing the task number to unmark * @throws BotException If the task number is not provided, is not numeric, or * is out of range */ diff --git a/src/main/java/duke/TaskRepository.java b/src/main/java/duke/TaskRepository.java index 2bff835da6..17d037f458 100644 --- a/src/main/java/duke/TaskRepository.java +++ b/src/main/java/duke/TaskRepository.java @@ -81,7 +81,7 @@ private void processTask(String[] taskDetails, Boolean isTaskDone, String taskTy throws BotException { switch (taskType) { case "T": - processTodoTask(taskDetails, isTaskDone, description); + processTodoTask(isTaskDone, description); break; case "D": processDeadlineTask(taskDetails, isTaskDone, description); @@ -95,12 +95,10 @@ private void processTask(String[] taskDetails, Boolean isTaskDone, String taskTy /** * Processes a Todo task's details and adds it to the TaskList. * - * @param taskDetails The details of the task. * @param isTaskDone Whether the task is done. * @param description The description of the task. - * @throws BotException If there is an error while processing the task. */ - private void processTodoTask(String[] taskDetails, Boolean isTaskDone, String description) throws BotException { + private void processTodoTask(Boolean isTaskDone, String description) { taskList.addTodo(description); if (isTaskDone) { taskList.getTaskByNum(taskList.getTaskCount()).markAsDone(); diff --git a/src/main/java/duke/Ui.java b/src/main/java/duke/Ui.java index 85ecd54bda..6f3f733187 100644 --- a/src/main/java/duke/Ui.java +++ b/src/main/java/duke/Ui.java @@ -27,23 +27,6 @@ public static String wrapWithSepLine(String input) { return SEPARATOR_LINE + "\n" + input + "\n" + SEPARATOR_LINE; } - /** - * Wraps a list of strings with separator lines and returns the result - * Each string in the list is placed on a new line - * - * @param list The list of strings to be wrapped - * @return The list of strings wrapped with separator lines - */ - public static String wrapWithSepLine(List list) { - StringBuilder sb = new StringBuilder(SEPARATOR_LINE); - System.out.println(); - for (String item : list) { - sb.append("\n").append(item); - } - sb.append("\n").append(SEPARATOR_LINE); - return sb.toString(); - } - /** * Prints a list of strings to the terminal * Each string in the list is placed on a new line