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

[W5][M11-1]Wang Jiannan #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

warheade
Copy link

No description provided.

[warheade] added 2 commits February 10, 2019 16:32
…add when it does not exist

It might be useful in real life scenarios
Copy link

@huyidi huyidi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Edit would be a useful command.

@yingrong1996
Copy link

A very good feature. I think if the example could show the before and after will be better in illustrating the usage of the function

Copy link

@okkhoy okkhoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Do take note of the coding standards and adhere to it when you write code.
  • Always remember to update the documentation and tests when you add any new features.
    • Without documentation, your users will not be aware of the new feature
    • Without tests, you are at a risk of regressions


import seedu.addressbook.common.Messages;
import seedu.addressbook.data.exception.IllegalValueException;
import seedu.addressbook.data.person.*;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not import everything using *, import only necessary classes

*/
public class EditCommand extends Command{
public static final String COMMAND_WORD = "edit";
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Edits a contact in the address book. "
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for updating the in-app help

+ " John Doe p/98765432 e/[email protected] a/311, Clementi Ave 2, #02-25 t/friends t/owesMoney";

public static final String MESSAGE_SUCCESS = "Contact is edited: %1$s";
//public static final String MESSAGE_NONEXISTENT_PERSON = "This person does not exist in the address book";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eliminate unused code and do not retain them commented, you can always get it back from previous versions if necessary.

try {

final ReadOnlyPerson target = getTargetPerson();
System.out.println("fk");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inappropriate code! Use the debugger instead to trace the program flow!

} catch (PersonNotFoundException pnfe) {
return new CommandResult(Messages.MESSAGE_PERSON_NOT_IN_ADDRESSBOOK);
}
catch (DuplicatePersonException dpethisisuseless){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding standard violation here. (2 counts!, can you identify them?)

@okkhoy
Copy link

okkhoy commented Feb 16, 2019

@warheade
Some comments added. Please take note and close the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants