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

Bug fix: DoneTaskCommand undo/redo #133

Merged
merged 2 commits into from
Nov 1, 2021

Conversation

koh-jx
Copy link

@koh-jx koh-jx commented Oct 30, 2021

Bugfix for not being able to redo done task.

Issue lied in the fact that this.execute() in undo() calls super.canExecute(), which negates its previous super.canUndo().
Changed it such that it does not call this.execute().

Issue lied in the fact that this.execute() in undo() calls
super.canExecute(), which negates the canUndo(), making it unable to
be redone.
@codecov-commenter
Copy link

codecov-commenter commented Oct 30, 2021

Codecov Report

Merging #133 (e33e246) into master (7f739b6) will increase coverage by 0.30%.
The diff coverage is 61.53%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #133      +/-   ##
============================================
+ Coverage     58.41%   58.72%   +0.30%     
- Complexity      599      602       +3     
============================================
  Files           121      121              
  Lines          2561     2563       +2     
  Branches        251      251              
============================================
+ Hits           1496     1505       +9     
+ Misses          975      966       -9     
- Partials         90       92       +2     
Impacted Files Coverage Δ
...u/address/logic/commands/task/DoneTaskCommand.java 78.57% <61.53%> (+1.64%) ⬆️
...in/java/seedu/address/commons/util/StringUtil.java 89.28% <0.00%> (+25.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f739b6...e33e246. Read the comment docs.

@koh-jx koh-jx linked an issue Oct 30, 2021 that may be closed by this pull request
@koh-jx koh-jx added this to the v1.4 milestone Oct 30, 2021
Copy link

@jeffsieu jeffsieu left a comment

Choose a reason for hiding this comment

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

I would suggest extracting everything except super.canExecute() from the execute method into a private method, so that you don't repeat this code in both execute and undo.

@koh-jx koh-jx requested a review from jeffsieu October 30, 2021 07:16
@koh-jx koh-jx linked an issue Oct 30, 2021 that may be closed by this pull request
Copy link

@jeffsieu jeffsieu left a comment

Choose a reason for hiding this comment

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

LGTM. I'll make some changes in a subsequent PR.

@jeffsieu jeffsieu merged commit d160539 into AY2122S1-CS2103-F09-2:master Nov 1, 2021
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.

[PE-D] Can't redo 'task done' command [PE-D] Cannot redo done command
3 participants