private static void handleUndoLog(List<UndoAction> undoLog, boolean undo) {
        if (undoLog == null) {
            return;
        }

        if (undo) {
            undoLog = Lists.reverse(undoLog);
        }
        for (UndoAction action : undoLog) {
            if (undo) {
                action.undo();
            } else {
                action.release();
            }
        }
        if (undo) {
            undoLog.clear();
        }
    }
private static void handleUndoLog ( List < UndoAction > undoLog , boolean undo ) { if ( undoLog == null ) { return ; } if ( undo ) { undoLog = Lists . reverse ( undoLog ) ; } for ( UndoAction action : undoLog ) { if ( undo ) { action . undo ( ) ; } else { action . release ( ) ; } } if ( undo ) { undoLog . clear ( ) ; } }
Java level related stuffs that are also needed to roll back
@param undoLog
@param undo