Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325579 - [Progress] org.eclipse.ui.internal.progress.ProgressManager#JobMonitor.setCanceled does not clear canceled flag when called with parameter "false"
Summary: [Progress] org.eclipse.ui.internal.progress.ProgressManager#JobMonitor.setCan...
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact: Prakash Rangaraj CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-17 08:47 EDT by Jörg Mann CLA
Modified: 2010-09-22 02:36 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jörg Mann CLA 2010-09-17 08:47:39 EDT
Build Identifier: I20100608-0911

When calling org.eclipse.ui.internal.progress.ProgressManager#JobMonitor.setCanceled(false) the cancel flag is not reset as stated in javadoc of the implemented interface IProgressMonitor

code snippet ProgressManager.JobMonitor
line 270:
if (value && !info.isCanceled()) {
...
but no else section in case value == false for clearing the flag


IProgressMonitor API spec:
/**
 * Sets the cancel state to the given value.
 * 
 * @param value <code>true</code> indicates that cancelation has
 *     been requested (but not necessarily acknowledged);
 *     <code>false</code> clears this flag
 * @see #isCanceled()
 */

Reproducible: Always

Steps to Reproduce:
1. Create a Job
2. Schedule it
3. call setCanceled(true) on the monitor inside the job's run method
4. call setCanceled(false) on the monitor inside the job's run method
5. monitor.isCanceled still returns true
Comment 1 Prakash Rangaraj CLA 2010-09-22 02:36:36 EDT
Once you cancel a job, there is no way to revert back to running state. The monitor has to reflect the state of the Job, so it can't simply return true, when the state of the job is cancelled. Unless the underlying jobs framework supports the setCancel(false), the UI can't do anything about it.