Ignore:
Timestamp:
2017-06-02T17:37:25+12:00 (7 years ago)
Author:
ak19
Message:

Removed unnecessary comments. Emacs tabbing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/download/DownloadJob.java

    r31720 r31721  
    212212        previous_state = getState();
    213213        if (getState() == RUNNING) {
    214         //setState(STOPPED);
    215         stopDownload(); // cancels any running SafeProcess
     214        stopDownload(); // cancels any running SafeProcess, will set the current state to STOPPED when the time is right
    216215        } else {
    217         //previous_state = getState();
    218216        setState(RUNNING);
    219217        mummy.resumeThread();
     
    225223        if(getState() == RUNNING) {
    226224        previous_state = getState();
    227         //setState(STOPPED); // do we need to do anything else to stop this? YES, we do:
    228         stopDownload(); // cancels any running SafeProcess
     225        stopDownload(); // cancels any running SafeProcess, will set the current state to STOPPED when the time is right
    229226        }
    230227        mummy.deleteDownloadJob(this);
     
    731728
    732729    SafeProcess.log("@@@@ DONE callDownload()");
    733    
    734     /*
    735     // Regardless of whether state==STOPPED or ends up being COMPLETE, the process is at an end now.
    736     // Notify the DownloadScrollPane which is waiting on this job to complete that we are ready
    737     synchronized(this) {
    738         System.err.println("**************** Notifying download scrollpane");
    739         this.notify();
    740     }
    741     */ 
    742730
    743731    // refresh the workspace tree
     
    758746        boolean hadToSendInterrupt = prcs.cancelRunningProcess(); // returns false if it was already terminating/terminated, true if interrupt sent
    759747
    760 
    761         /*
    762           // if process terminating naturally but waiting for process' worker threads to join(),
    763           // shall we just remove the progress bar display for this download?
    764           // If so, do this section in place of the 2 calls to progress.enableCancelJob(boolean) below
    765         if(!hadToSendInterrupt && SwingUtilities.isEventDispatchThread()) {
    766         if(getState() == DownloadJob.RUNNING) {
    767             progress.mirrorComplete();
    768             previous_state = getState();
    769             setState(DownloadJob.COMPLETE);     
    770         }
    771         mummy.deleteCurrentDownloadJob(this); // why wait for the cleanup which can't be interrupted anyway?
    772         }
    773         */
    774748    } else {
    775749        System.err.println("@@@@ No process to interrupt");
     
    807781        mummy.deleteCurrentDownloadJob(this);
    808782        }
    809     } /*else {
    810         // If we've got to here and the state isn't STOPPED then the
    811         // job is complete.
    812         System.err.println("**************** NOT Notifying download scrollpane");
    813         if(getState() == DownloadJob.RUNNING) {
    814         progress.mirrorComplete();
    815         previous_state = getState();
    816         setState(DownloadJob.COMPLETE);     
    817         }
    818     }
    819    
    820     // Regardless of whether state==STOPPED or ends up being COMPLETE, the process is at an end now.
    821     // Notify the DownloadScrollPane which is waiting on this job to complete that we are ready
    822     synchronized(this) {
    823         System.err.println("**************** Notifying download scrollpane");
    824         this.notify();
    825         }*/
    826 
     783    }
    827784    }
    828785
Note: See TracChangeset for help on using the changeset viewer.