-
Notifications
You must be signed in to change notification settings - Fork 73
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
base: master
Are you sure you want to change the base?
Conversation
@@ -39,4 +39,9 @@ public CommandResult execute() { | |||
} | |||
} | |||
|
|||
@Override |
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.
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()){ |
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 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).
Good effort, Jie Liang. Do note that you will need to update header comments for each of the implemented overridden methods. |
No description provided.