Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Delaigue2015-05-29 07:51:46 +0000
committerAxel RICHARD2015-06-09 13:42:49 +0000
commit71c2516023c01c4e37892ae50a77e1db47c883d1 (patch)
tree94b2bfd7df35e838ffbaff46def7424d8430a626 /plugins
parent1991ca751a80fafe2027e730dd0300c9bd0279e1 (diff)
downloadorg.eclipse.emf.compare-71c2516023c01c4e37892ae50a77e1db47c883d1.tar.gz
org.eclipse.emf.compare-71c2516023c01c4e37892ae50a77e1db47c883d1.tar.xz
org.eclipse.emf.compare-71c2516023c01c4e37892ae50a77e1db47c883d1.zip
[468741] Cancel of comparisons caused a pop-up.
Bug: 468741 Change-Id: I2bad5d846eb5045b1a0a3015997de8a117c24530 Signed-off-by: Laurent Delaigue <laurent.delaigue@obeo.fr>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/AbstractResolution.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/LocalModelResolution.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/LocalModelsResolution.java17
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ModelsResolution.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ResourceComputationScheduler.java14
5 files changed, 13 insertions, 30 deletions
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/AbstractResolution.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/AbstractResolution.java
index 63357cfc7..e7d783836 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/AbstractResolution.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/AbstractResolution.java
@@ -81,10 +81,8 @@ public abstract class AbstractResolution {
* @param callable
* Treatment to run
* @return The result of the treatment
- * @throws InterruptedException
- * If the treatment is interrupted
*/
- protected <T> T call(Callable<T> callable) throws InterruptedException {
+ protected <T> T call(Callable<T> callable) {
this.diagnostic = new DiagnosticSupport();
return context.getScheduler().call(callable, getFinalizeResolvingRunnable());
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/LocalModelResolution.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/LocalModelResolution.java
index b5e277a76..f0ee44b21 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/LocalModelResolution.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/LocalModelResolution.java
@@ -57,10 +57,8 @@ public class LocalModelResolution extends AbstractResolution {
* @param start
* Resource for which we want the traversal
* @return The {@link StorageTraversal} for the given resource, never null but possibly empty.
- * @throws InterruptedException
- * If the computation is interrupted.
*/
- public StorageTraversal run(final IResource start) throws InterruptedException {
+ public StorageTraversal run(final IResource start) {
if (logger.isDebugEnabled()) {
logger.debug("run() - START"); //$NON-NLS-1$
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/LocalModelsResolution.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/LocalModelsResolution.java
index 881833fb0..46404ef29 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/LocalModelsResolution.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/LocalModelsResolution.java
@@ -88,10 +88,8 @@ public class LocalModelsResolution extends AbstractResolution {
* Executes this treatment.
*
* @return The Logical model to use to compare the 2 or 3 resources.
- * @throws InterruptedException
- * If the treatment is interrupted.
*/
- public SynchronizationModel run() throws InterruptedException {
+ public SynchronizationModel run() {
if (logger.isDebugEnabled()) {
logger.debug("run() - START"); //$NON-NLS-1$
}
@@ -123,10 +121,8 @@ public class LocalModelsResolution extends AbstractResolution {
* Resolve the local resources.
*
* @return The synchronization model that contains the logical models of each side.
- * @throws InterruptedException
- * In case it is interrupted.
*/
- private SynchronizationModel resolveLocalResources() throws InterruptedException {
+ private SynchronizationModel resolveLocalResources() {
// Sub-optimal implementation, we'll only try and resolve each side individually
final StorageTraversal leftTraversal;
final StorageTraversal rightTraversal;
@@ -157,11 +153,8 @@ public class LocalModelsResolution extends AbstractResolution {
* @param subMonitor
* The progress monitor to use
* @return The traversal for the given resource.
- * @throws InterruptedException
- * In case it is interrupted.
*/
- private StorageTraversal resolveLocalModel(final IResource start, SubMonitor subMonitor)
- throws InterruptedException {
+ private StorageTraversal resolveLocalModel(final IResource start, SubMonitor subMonitor) {
LocalModelResolution comp = new LocalModelResolution(context, subMonitor);
return comp.run(start);
}
@@ -170,10 +163,8 @@ public class LocalModelsResolution extends AbstractResolution {
* Resolve several local files.
*
* @return The synchronization model that contains the logical models of each side.
- * @throws InterruptedException
- * In case it is interrupted.
*/
- private SynchronizationModel resolveLocalFiles() throws InterruptedException {
+ private SynchronizationModel resolveLocalFiles() {
if (logger.isDebugEnabled()) {
logger.debug("resolveLocalFiles()"); //$NON-NLS-1$
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ModelsResolution.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ModelsResolution.java
index f2ad7668c..059ccaaea 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ModelsResolution.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ModelsResolution.java
@@ -101,10 +101,8 @@ public class ModelsResolution extends AbstractResolution {
* Executes the resolution.
*
* @return The logical model to use to compare the given storages
- * @throws InterruptedException
- * If the treatment is interrupted.
*/
- public SynchronizationModel run() throws InterruptedException {
+ public SynchronizationModel run() {
if (logger.isDebugEnabled()) {
logger.debug("run() - START"); //$NON-NLS-1$
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ResourceComputationScheduler.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ResourceComputationScheduler.java
index 57ccb55f1..d922e7523 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ResourceComputationScheduler.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ResourceComputationScheduler.java
@@ -135,11 +135,8 @@ public class ResourceComputationScheduler<T> {
* <li>{@link #unloadingPool} is not null and is ready to be used</li>
* <li>{@link #computedKeys} is not null</li>
* </p>
- *
- * @throws InterruptedException
- * If the set-up is interrupted
*/
- private void setUpComputation() throws InterruptedException {
+ private void setUpComputation() {
final int availableProcessors = Runtime.getRuntime().availableProcessors();
ThreadFactory computingThreadFactory = new ThreadFactoryBuilder().setNameFormat(
"EMFCompare-ResolvingThread-%d") //$NON-NLS-1$
@@ -270,17 +267,18 @@ public class ResourceComputationScheduler<T> {
* @param <U>
* the type of the return value.
* @return The result returned by the given callable execution.
- * @throws InterruptedException
- * If the computation is interrupted
*/
- public synchronized <U> U call(Callable<U> callable, Runnable postTreatment) throws InterruptedException {
+ public synchronized <U> U call(Callable<U> callable, Runnable postTreatment) {
checkNotNull(callable);
try {
setUpComputation();
return callable.call();
} catch (Exception e) {
if (e instanceof InterruptedException) {
- throw (InterruptedException)e;
+ throw new OperationCanceledException();
+ }
+ if (e instanceof OperationCanceledException) {
+ throw (OperationCanceledException)e;
}
throw new RuntimeException(e);
} finally {

Back to the top