//@author A0115160X
package bakatxt.core;

import java.util.Stack;

public class ReverseAction implements ReverseActionInterface {
    private static Stack<UserAction> undoStack;
    private static Stack<UserAction> redoStack;

    public ReverseAction() {
        undoStack = new Stack<UserAction>();
        redoStack = new Stack<UserAction>();
    }

    /**
     * Stores the executed command and task.
     * 
     * @param input
     *            a UserAction that contains the execution methods
     * @return <code>true</code> if a command is executed
     */
    @Override
    public boolean execute(UserAction input) {
        boolean status = input.execute(); // execute command
        if (status) {
            undoStack.push(input);
        }
        return status;
    }

    /**
     * Undo the previous action.
     * 
     * @return <code>true</code> if undo is executed
     */
    @Override
    public boolean undo() {
        boolean status = false;
        if (!undoStack.isEmpty()) {
            UserAction action = undoStack.pop();
            status = action.undo();
            if (!status) {
                undoStack.push(action);
            } else {
                redoStack.push(action);
            }
        }
        return status;
    }

    /**
     * Redo the previous undo action.
     * 
     * @return <code>true</code> if redo is executed
     */
    @Override
    public boolean redo() {
        boolean status = false;
        if (!redoStack.isEmpty()) {
            UserAction action = redoStack.pop();
            status = action.execute();
            if (!status) {
                redoStack.push(action);
            } else {
                undoStack.push(action);
            }
        }
        return status;
    }

}

@@ -638,22 +638,28 @@
 boolean 
-status
+isSuccessful
  = input
@@ -701,22 +701,28 @@
     if (
-status
+isSuccessful
 ) %7B%0A    
@@ -769,38 +769,44 @@
 %0A        return 
-status
+isSuccessful
 ;%0A    %7D%0A%0A    /**
@@ -958,38 +958,44 @@
         boolean 
-status
+isSuccessful
  = false;%0A      
@@ -1077,38 +1077,44 @@
 ();%0A            
-status
+isSuccessful
  = action.undo()
@@ -1124,38 +1124,44 @@
            if (!
-status
+isSuccessful
 ) %7B%0A            
@@ -1280,38 +1280,44 @@
 %0A        return 
-status
+isSuccessful
 ;%0A    %7D%0A%0A    /**
@@ -1482,22 +1482,28 @@
 boolean 
-status
+isSuccessful
  = false
@@ -1601,22 +1601,28 @@
         
-status
+isSuccessful
  = actio
@@ -1654,15 +1654,20 @@
 if (
-!status
+isSuccessful
 ) %7B%0A
@@ -1810,14 +1810,20 @@
 urn 
-status
+isSuccessful
 ;%0A  

Rename boolean variable