Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra/misc/org.eclipse.papyrus.infra.sync/src/org/eclipse/papyrus/infra/sync/service/SyncServiceRunnable.java')
-rw-r--r--plugins/infra/misc/org.eclipse.papyrus.infra.sync/src/org/eclipse/papyrus/infra/sync/service/SyncServiceRunnable.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/plugins/infra/misc/org.eclipse.papyrus.infra.sync/src/org/eclipse/papyrus/infra/sync/service/SyncServiceRunnable.java b/plugins/infra/misc/org.eclipse.papyrus.infra.sync/src/org/eclipse/papyrus/infra/sync/service/SyncServiceRunnable.java
index b37e26531ac..caa5cb53207 100644
--- a/plugins/infra/misc/org.eclipse.papyrus.infra.sync/src/org/eclipse/papyrus/infra/sync/service/SyncServiceRunnable.java
+++ b/plugins/infra/misc/org.eclipse.papyrus.infra.sync/src/org/eclipse/papyrus/infra/sync/service/SyncServiceRunnable.java
@@ -1,6 +1,6 @@
/*****************************************************************************
- * Copyright (c) 2015 Christian W. Damus and others.
- *
+ * Copyright (c) 2015, 2021 Christian W. Damus and others.
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,8 @@
*
* Contributors:
* Christian W. Damus - Initial API and implementation
- *
+ * Quentin Le Menez - bug 570177
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.sync.service;
@@ -18,25 +19,25 @@ package org.eclipse.papyrus.infra.sync.service;
import java.lang.reflect.UndeclaredThrowableException;
import java.util.concurrent.Callable;
+import org.eclipse.papyrus.infra.guava.internal.AbstractCheckedFuture;
+import org.eclipse.papyrus.infra.guava.internal.CheckedFuture;
import org.eclipse.papyrus.infra.sync.ISyncObject;
import com.google.common.reflect.TypeToken;
-import com.google.common.util.concurrent.AbstractCheckedFuture;
-import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListenableFutureTask;
/**
* An operation that runs in the context of the {@link ISyncService synchronization service}.
* The {@link SyncServiceRunnable.Safe Safe} variant does not throw a checked exception.
- *
+ *
* @see ISyncService#run(SyncServiceRunnable)
* @see SyncServiceRunnable.Safe
*/
public abstract class SyncServiceRunnable<V, X extends Exception> {
@SuppressWarnings("serial")
- private final TypeToken<X> exceptionType = new TypeToken<X>(getClass()) {
+ private final TypeToken<X> exceptionType = new TypeToken<>(getClass()) {
};
public abstract V run(ISyncService syncService) throws X;
@@ -48,11 +49,12 @@ public abstract class SyncServiceRunnable<V, X extends Exception> {
/**
* Obtains me as a {@link Runnable} checked future result in the context of a sync object.
- *
+ *
* @param context
* the synchronization context in which context I shall run
- *
+ *
* @return a checked future result that implements that {@link Runnable} API for execution
+ * @since 3.1
*/
public CheckedFuture<V, X> asFuture(final ISyncObject context) {
return checked(ListenableFutureTask.create(new Callable<V>() {
@@ -64,7 +66,7 @@ public abstract class SyncServiceRunnable<V, X extends Exception> {
}
private CheckedFuture<V, X> checked(final ListenableFuture<V> future) {
- class Checked extends AbstractCheckedFuture<V, X>implements Runnable {
+ class Checked extends AbstractCheckedFuture<V, X> implements Runnable {
Checked() {
super(future);
}

Back to the top