Skip to content

Commit

Permalink
Update code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
Musfirahe0556596 authored and Musfirahe0556596 committed Mar 1, 2022
1 parent 9d10630 commit d3e364d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/main/java/duke/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public static void performTodo(TaskList taskManager, String userInput) {
* @param stringSeparator such as '/at' or '/by' to identify different type of tasks.
* @param taskType holds the task child classes, for instance, deadline.
*/
public static void performTaskWithTimeConstraints(TaskList taskManager, String userInput, String stringSeparator, String taskType) {
public static void performTaskWithTimeConstraints(TaskList taskManager, String userInput,
String stringSeparator, String taskType) {
try {
Task newTask = taskManager.addTaskWithTime(userInput, stringSeparator);
Storage.saveDataAddToListOperation(taskManager, newTask);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/duke/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ public static void appendDukeDataFile(String newTask) throws IOException, ArrayI
* @throws IOException If file operation failed.
* @throws ArrayIndexOutOfBoundsException For any operations which involves index checking.
*/
public static void modifyMarkStatusDataFile(int taskNumber, boolean isMarked) throws IOException, ArrayIndexOutOfBoundsException {
public static void modifyMarkStatusDataFile(int taskNumber, boolean isMarked) throws
IOException, ArrayIndexOutOfBoundsException {
List<String> fileContentLines = Files.readAllLines(FILE_PATH);
int lineNumber = 1;
String replacedFileContents = "";
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/duke/task/TaskList.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public static Task addTask(String userInput) throws DukeEmptyDescriptionExceptio
* @throws DukeMissingTimeSeparator If time separators (e.g. '/at') for each task type is missing.
* @throws DateTimeParseException If time could not be parsed properly.
*/
public static Task addTaskWithTime(String userInput, String stringSeparator) throws DukeEmptyDescriptionException, DukeMissingTimeSeparator, DateTimeParseException {
public static Task addTaskWithTime(String userInput, String stringSeparator) throws
DukeEmptyDescriptionException, DukeMissingTimeSeparator, DateTimeParseException {
String extractedStringsWithoutCommandType = parser.validateAndExtractTaskDescription(userInput);
if ((extractedStringsWithoutCommandType.split(stringSeparator).length) <= 1) {
throw new DukeMissingTimeSeparator();
Expand Down Expand Up @@ -83,7 +84,8 @@ public static Task addTaskWithTime(String userInput, String stringSeparator) thr
* @throws NumberFormatException If task number could not be parsed into an integer.
* @throws DukeTaskOutOfRangeException If the task number supplied is less or more than the current task list.
*/
public static int markTask(boolean isMarked, String userInput) throws DukeEmptyDescriptionException, NumberFormatException, DukeTaskOutOfRangeException {
public static int markTask(boolean isMarked, String userInput) throws
DukeEmptyDescriptionException, NumberFormatException, DukeTaskOutOfRangeException {
if ((userInput.split(" ")).length <= 1) {
throw new DukeEmptyDescriptionException();
}
Expand Down

0 comments on commit d3e364d

Please sign in to comment.