Bug 476142 - IWorkspace.run methods should accept ICoreRunnable
Summary: IWorkspace.run methods should accept ICoreRunnable
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 4.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.6 M4   Edit
Assignee: Sergey Prigogin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-28 15:35 EDT by Sergey Prigogin CLA
Modified: 2015-11-25 13:29 EST (History)
5 users (show)

See Also:


Attachments
Image shows an unused import is causing compilation errors (157.71 KB, image/png)
2015-09-21 18:51 EDT, Patrik Suzzi CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Prigogin CLA 2015-08-28 15:35:54 EDT
IWorkspaceRunnable interface is structurally equivalent to ICoreRunnable and can be changed to extend ICoreRunnable. Once this is done, IWorkspace.run(IWorkspaceRunnable, IProgressMonitor) and  IWorkspace.run(IWorkspaceRunnable, ISchedulingRule, int, IProgressMonitor) methods can be changed to accept ICoreRunnable instead of IWorkspaceRunnable.

Eventually, IWorkspaceRunnable can be deprecated in favor of ICoreRunnable.
Comment 1 Eclipse Genie CLA 2015-08-28 17:05:35 EDT
New Gerrit change created: https://git.eclipse.org/r/54815
Comment 2 Eclipse Genie CLA 2015-08-31 15:32:46 EDT
New Gerrit change created: https://git.eclipse.org/r/54933
Comment 3 Dirk Fauth CLA 2015-09-01 06:20:48 EDT
Sorry, but where can the interface ICoreRunnable be found? I just checked out the latest sources of platform.runtime and platform.ui. But I can't find that interface anywhere.

From the import I would assume that the interface should be located in the org.eclipse.core.runtime project, but it doesn't contain that interface in master.
Comment 4 Sergey Prigogin CLA 2015-09-01 10:17:20 EDT
(In reply to Dirk Fauth from comment #3)

It is in rt.equinox.bundles (see
commit: http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=8a8f71942a1034d52acef423a973eee8415f576b)
Comment 6 Szymon Ptaszkiewicz CLA 2015-09-21 11:37:43 EDT
M2 is over.
Comment 8 Lars Vogel CLA 2015-09-21 12:02:14 EDT
Marking as fixed, as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=681252c4498fe82aba0acbb72fb86bdcb62a5175 fixes the references.
Comment 9 Patrik Suzzi CLA 2015-09-21 18:51:04 EDT
Created attachment 256737 [details]
Image shows an unused import is causing compilation errors

There is something to fix, related to solution of bug 476142

Description	Resource	Path	Location	Type
The import org.eclipse.core.resources.IWorkspaceRunnable is never used	AbstractWorkspaceOperation.java	/org.eclipse.ui.ide/src/org/eclipse/ui/ide/undo	line 23	Java Problem
Comment 10 Lars Vogel CLA 2015-09-21 18:59:05 EDT
(In reply to Patrik Suzzi from comment #9)
> Created attachment 256737 [details]
> Image shows an unused import is causing compilation errors

Sorry, reopening for the fix.
Comment 11 Eclipse Genie CLA 2015-09-21 19:00:56 EDT
New Gerrit change created: https://git.eclipse.org/r/56389
Comment 13 Lars Vogel CLA 2015-09-21 19:02:11 EDT
(In reply to Eclipse Genie from comment #12)
> Gerrit change https://git.eclipse.org/r/56389 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?id=1b7a326346773f9265c16e6faac08705c6f89b39

Fixed, thanks Patrik for reporting.
Comment 14 Sebastian Zarnekow CLA 2015-09-30 02:17:40 EDT
I'd like to reopen this and discuss a subtle change in the API (CC from the gerrit review https://git.eclipse.org/r/#/c/54815/):

I wonder about the subtle change of the contract of IWorkspaceRunnable#run. It used to define that a cancelled runnable should throw OperationCancelException whereas ICoreRunnable defines CoreException with a cancel status as the proper reaction to cancellation. Since IWorkspace.run(..) also describes the OperationCancelException as the result of a cancelled runnable, shouldn't the CoreException with cancel status be caught in the Workspace#run and an OCE be thrown? Alternatively the contract should be clarified.
Comment 15 Sergey Prigogin CLA 2015-09-30 10:17:10 EDT
(In reply to Sebastian Zarnekow from comment #14)

Will your concerns be addressed by https://git.eclipse.org/r/#/c/56850/ ?