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

[W6.2b][T16-2] Ang Jie Liang #148

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jieliangang
Copy link

No description provided.

@@ -39,4 +39,9 @@ public CommandResult execute() {
}
}

@Override

Choose a reason for hiding this comment

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

Remember to update your method with header comments as your method has a different behaviour from other subclass implementations. e.g. Returns if true if class mutates data.

@@ -85,7 +85,9 @@ public CommandResult execute(String userCommandText) throws Exception {
private CommandResult execute(Command command) throws Exception {
command.setData(addressBook, lastShownList);
CommandResult result = command.execute();
storage.save(addressBook);
if (command.isMutating()){

Choose a reason for hiding this comment

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

This change doesn’t help much because it does not confirm that the saving happens only for mutating commands. Tests will pass even if you don’t have this change. To be complete, you should have an else branch that confirms the file was not updated for non mutating commands (e.g. by checking the last updated time of the file).

@stephlewyh
Copy link

Good effort, Jie Liang. Do note that you will need to update header comments for each of the implemented overridden methods.

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.

3 participants