Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 464838

Summary: ModalContext.run method should call done() on the progress monitor passed to the constructor
Product: [Eclipse Project] Platform Reporter: Sergey Prigogin <eclipse.sprigogin>
Component: UIAssignee: Sergey Prigogin <eclipse.sprigogin>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, Lars.Vogel, sxenos
Version: 4.5   
Target Milestone: 4.6 M7   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/68969
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=788eb1917c57e0bf2ffc5cd6bdbcf9c3b51d98dd
Whiteboard:
Bug Depends on:    
Bug Blocks: 487372, 499658    

Description Sergey Prigogin CLA 2015-04-16 20:38:15 EDT
org.eclipse.jface.operation.ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor, Display) should call done() on the passed in progress monitor to relieve the runnable from the responsibility to do it. This would facilitate use of a SubMonitor in the runnable passed as the first parameter.
Comment 1 Eclipse Genie CLA 2015-04-16 20:51:51 EDT
New Gerrit change created: https://git.eclipse.org/r/45959
Comment 2 Sergey Prigogin CLA 2015-04-17 05:00:55 EDT
Shifting of responsibility to call IProgressMonitor.done() from the IRunnableWithProgress.run() method to the caller of that method would allow for simplification of implementations of IRunnableWithProgress.run() method. This will eventually result in net code size saving because there are many more implementations of IRunnableWithProgress.run() method than there are places were this method is called. The proposed division of responsibilities is the same as is recommended when SubMonitors are used.
Comment 3 Lars Vogel CLA 2015-04-20 04:40:47 EDT
As discussed in the Gerrit: The eventual goal is to make the "caller is responsible for calling done()" convention from the Jobs framework universal. This will be a convention based on Javadoc and should be tracked by a master bug.
Comment 4 Stefan Xenos CLA 2016-02-05 14:56:36 EST
Re: comment 3

I've filed a master bug for this: bug 487372.
Comment 5 Eclipse Genie CLA 2016-03-21 19:49:50 EDT
New Gerrit change created: https://git.eclipse.org/r/68969