-
Notifications
You must be signed in to change notification settings - Fork 166
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
[W5.7][F11-3]Cai Jiaxiu #444
base: master
Are you sure you want to change the base?
Conversation
Nice work! But would be best to add test coverage as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job. It is encouraged to update user guide if you have not done so. Please close this PR after reading my comments
@@ -61,7 +61,7 @@ public Address getAddress() { | |||
public Set<Tag> getTags() { | |||
return new HashSet<>(tags); | |||
} | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary space. Ensure that you look through the changes to the code before you stage a file for commit.
} | ||
|
||
/** | ||
* set the original and updated person |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Standardize header comments by ensuring all comments start with a capital letter.
setUpdatedPerson(); | ||
addressBook.updatePerson(original, toUpdate); | ||
return new CommandResult(String.format(MESSAGE_UPDATE_PERSON_SUCCESS, toUpdate)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary blank line
@@ -148,15 +162,56 @@ private static boolean isPrivatePrefixPresent(String matchedPrefix) { | |||
*/ | |||
private static Set<String> getTagsFromArgs(String tagArguments) throws IllegalValueException { | |||
// no tags | |||
if (tagArguments.isEmpty()) { | |||
if (tagArguments.isEmpty() || tagArguments.trim().isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition can be simplified to just tagArguments.trim().isEmpty()
since trim()
just removes leading and trailing whitespace in tagArguments
@@ -9,6 +9,9 @@ | |||
|| add: Adds a person to the address book. Contact details can be marked private by prepending 'p' to the prefix. | |||
|| Parameters: NAME [p]p/PHONE [p]e/EMAIL [p]a/ADDRESS [t/TAG]... | |||
|| Example: add John Doe p/98765432 e/[email protected] a/311, Clementi Ave 2, #02-25 t/friends t/owesMoney | |||
|| update: Updates a person identified by the index number used in the last person listing. | |||
|| Parameters: INDEX [[p]p/PHONE] [[p]e/EMAIL] [[p]a/ADDRESS] [t/TAG]... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there an extra [
before [p]
?
@@ -294,6 +295,69 @@ private static String convertPersonToAddCommandString(ReadOnlyPerson person) { | |||
return addCommand; | |||
} | |||
|
|||
/* | |||
* Tests for update person command ============================================================================== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's no need to write header comments for tests
No description provided.