-
Notifications
You must be signed in to change notification settings - Fork 113
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][W17-1]Chen Caijie #143
base: master
Are you sure you want to change the base?
Conversation
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.
I saw that you have included a catch for DuplicatePersonException inside EditCommand. Can I clarify under what situation will this exception be caught?
Because of the way I implemented the edit command, it extracts the person out first by removing it then adding a new person with the new name but with all the same details. the add function throws a duplicate person exception so I needed to catch it. I guess this will be caught when u try and edit to the same name! Thank you for your question!
… On Feb 12, 2019, at 10:13 PM, Wei Kang Lee ***@***.***> wrote:
@Wklee96 commented on this pull request.
I saw that you have included a catch for DuplicatePersonException inside EditCommand. Can I clarify under what situation will this exception be caught?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
package seedu.addressbook.commands; | ||
|
||
import seedu.addressbook.data.exception.IllegalValueException; | ||
import seedu.addressbook.data.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.
Try to be explicit in your imports, avoiding the use of .*
.
import seedu.addressbook.data.exception.IllegalValueException; | ||
import seedu.addressbook.data.person.*; | ||
|
||
public class EditCommand extends 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.
Including a javadoc comment for new classes would be good.
@@ -73,33 +78,36 @@ public Command parseCommand(String userInput) { | |||
|
|||
switch (commandWord) { | |||
|
|||
case AddCommand.COMMAND_WORD: | |||
return prepareAdd(arguments); | |||
case AddCommand.COMMAND_WORD: |
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.
Note that the coding style specifies that there shouldn't be indentation for case clauses.
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.
Hi Caijie, some comments:
- Good that you updated the User Guide, I/O tests and JUnit tests.
- Note the coding style requirements for switch-case statements - there shouldn't be indentations for case clauses. It would be helpful to configure your IDE accordingly.
- Testing with valid input could be a good addition to your JUnit tests.
- It would be helpful to check if you can handle the case where the name and new name inputs are the same, differently (E.g. Give the user a more personalised feedback message).
- Good that you used a branch to implement this enhancement.
- Think about whether you can break down your commits further such that each one corresponds to one incremental change.
currently only editing of a person's name is supported.