Skip to content

Commit

Permalink
Checkstyle fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yeozongyao committed Mar 21, 2024
1 parent 8edc969 commit 5f09440
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/main/java/seedu/bookbuddy/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public static void parseCommand(String input, BookList books) {
index = Integer.parseInt(inputArray[1]);
books.deleteBook(index);
} catch (NumberFormatException e) {
System.out.println("Invalid input: " + inputArray[1] + " is not a valid number. Please enter a valid numeric index.");
System.out.println("Invalid input: " + inputArray[1] + " is not a valid number. " +
"Please enter a valid numeric index.");
} catch (IndexOutOfBoundsException e) {
System.out.println("Invalid book index. Please enter a valid index.");
}
Expand All @@ -59,7 +60,8 @@ public static void parseCommand(String input, BookList books) {
index = Integer.parseInt(inputArray[1]);
books.markDoneByIndex(index);
} catch (NumberFormatException e) {
System.out.println("Invalid input: " + inputArray[1] + " is not a valid number. Please enter a valid numeric index.");
System.out.println("Invalid input: " + inputArray[1] + " is not a valid number. " +
"Please enter a valid numeric index.");
} catch (IndexOutOfBoundsException e) {
System.out.println("Invalid book index. Please enter a valid index.");
}
Expand All @@ -69,7 +71,8 @@ public static void parseCommand(String input, BookList books) {
index = Integer.parseInt(inputArray[1]);
books.markUndoneByIndex(index);
} catch (NumberFormatException e) {
System.out.println("Invalid input: " + inputArray[1] + " is not a valid number. Please enter a valid numeric index.");
System.out.println("Invalid input: " + inputArray[1] + " is not a valid number. " +
"Please enter a valid numeric index.");
} catch (IndexOutOfBoundsException e) {
System.out.println("Invalid book index. Please enter a valid index.");
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/seedu/bookbuddy/ParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void parseInvalidAddCommandThrowsException() {
void parseInvalidRemoveCommandThrowsException() {
BookList books = new BookList();
String input = "remove notAnIndex"; // Invalid index provided
assertThrows(InvalidBookIndexException.class,
assertThrows(NumberFormatException.class,
() -> Parser.parseCommand(input, books), "Book index must be an integer.");
}

Expand Down

0 comments on commit 5f09440

Please sign in to comment.