diff options
Diffstat (limited to 'plugins')
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 { |