Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change error messages in delete and find commands. #159

Merged
merged 2 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ public DeleteCommand parse(String args) throws ParseException {
ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_GROUPTAG);

//duplicate parameters
try {
argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_GROUPTAG);
} catch (ParseException e) {
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT,
DeleteCommand.MESSAGE_TWO_PARAMETERS));
}
argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_GROUPTAG);

// check if either n/ or g/ are present
if (!arePrefixesPresent(argMultimap, PREFIX_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@ public FindCommand parse(String args) throws ParseException {
ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_GROUPTAG);

//duplicate parameters
try {
argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_GROUPTAG);
} catch (ParseException e) {
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT,
FindCommand.MESSAGE_TWO_PARAMETERS));
}
argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_GROUPTAG);

// check if either n/ or g/ are present
if (!arePrefixesPresent(argMultimap, PREFIX_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public ListTimeCommand parse(String args) throws ParseException {
}
}

argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_GROUPTAG);

// if n/ is present
if (arePrefixesPresent(argMultimap, PREFIX_NAME)) {
// check if g/ is present
Expand All @@ -56,7 +58,6 @@ public ListTimeCommand parse(String args) throws ParseException {
}
}

argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_GROUPTAG);

// n/ not present, g/ should be present
String groupName = argMultimap.getValue(PREFIX_GROUPTAG).get();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public Email getEmail() {
}

public GroupList getGroups() {
return personGroups;
return this.personGroups;
}

/**
Expand Down