Skip to content

Commit

Permalink
Fix checkstyle issues
Browse files Browse the repository at this point in the history
  • Loading branch information
antonTan96 committed Nov 13, 2023
1 parent 5e72a5d commit 5ed0ccf
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public CommandResult execute(Model model) throws CommandException {
}

private void employeeIsInList(int target, int size) throws CommandException {
if(target >= size) {
if (target >= size) {
logger.warning("Invalid employee index: " + (target + 1));
throw new CommandException(Messages.MESSAGE_INVALID_EMPLOYEE_DISPLAYED_INDEX);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ public CommandResult execute(Model model) throws CommandException {
}

private void employeeIsInList(int target, int size) throws CommandException {
if(target >= size) {
if (target >= size) {
logger.warning("Invalid employee index: " + (target + 1));
throw new CommandException(Messages.MESSAGE_INVALID_EMPLOYEE_DISPLAYED_INDEX);
}
}

private void projectIsInList(int target, int size) throws CommandException {
if(target >= size) {
if (target >= size) {
logger.warning("Invalid project index: " + (target + 1));
throw new CommandException(Messages.MESSAGE_INVALID_PROJECT_DISPLAYED_INDEX);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public class DeleteProjectCommand extends Command {
+ ": Deletes the project identified by the index number used in the displayed project list.\n"
+ "Parameters: INDEX (must be a positive integer)\n"
+ "Example: " + COMMAND_WORD + " 1";
private static final Logger logger = LogsCenter.getLogger(DeadlineProjectCommand.class);
public static final String MESSAGE_DELETE_PROJECT_SUCCESS = "Deleted Project: %1$s";
private static final Logger logger = LogsCenter.getLogger(DeadlineProjectCommand.class);

private final Index targetIndex;
public DeleteProjectCommand(Index targetIndex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void execute_duplicateProject_throwsCommandException() {

// Invalid input: Employee index does not exist in TaskHub
@Test
public void execute_addEmployeeToProject_employeeDoesNotExist_throwsCommandException() {
public void execute_addNonExistentEmployee_throwsCommandException() {
Project project = new ProjectBuilder().build();
ArrayList<Index> invalidIndex = new ArrayList<>();
ModelStub modelStub = new ModelStubWithProject(project);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import static org.junit.jupiter.api.Assertions.assertTrue;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess;
import static seedu.address.testutil.Assert.assertThrows;
import static seedu.address.testutil.TypicalEmployees.getTypicalTaskHub;
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_EMPLOYEE;
import static seedu.address.testutil.TypicalIndexes.INDEX_SECOND_EMPLOYEE;
Expand All @@ -18,7 +17,6 @@
import seedu.address.model.UserPrefs;
import seedu.address.model.project.Project;

import java.util.ArrayList;

public class DeleteProjectCommandTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.junit.jupiter.api.Test;

import seedu.address.commons.core.index.Index;
import seedu.address.logic.Messages;
import seedu.address.logic.commands.AssignProjectCommand;

public class AssignProjectCommandParserTest {
Expand Down Expand Up @@ -77,7 +76,7 @@ public void parse_missingCompulsoryField_failure() {
assertParseFailure(parser, AssignProjectCommand.COMMAND_WORD, expectedMessage);

// no employee index
assertParseFailure(parser, " " + PREFIX_PROJECT + INDEX_FIRST_EMPLOYEE.getOneBased(), expectedMessage);
assertParseFailure(parser, " " + PREFIX_PROJECT + INDEX_FIRST_EMPLOYEE.getOneBased(), expectedMessage);

// no project index
assertParseFailure(parser, " " + PREFIX_EMPLOYEE + INDEX_FIRST_EMPLOYEE.getOneBased(), expectedMessage);
Expand Down

0 comments on commit 5ed0ccf

Please sign in to comment.