mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
removed CompletablePromise from open API
This commit is contained in:
@@ -41,9 +41,9 @@ class DonePromise<T> extends InternalPromiseUtil.BasePromise<T> {
|
||||
//noinspection unchecked
|
||||
((InternalPromiseUtil.PromiseImpl<T>)child)._setValue(value);
|
||||
}
|
||||
else if (child instanceof Promise.CompletablePromise) {
|
||||
else if (child instanceof InternalPromiseUtil.CompletablePromise) {
|
||||
//noinspection unchecked
|
||||
((CompletablePromise<T>)child).setResult(value.result);
|
||||
((InternalPromiseUtil.CompletablePromise<T>)child).setResult(value.result);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,11 @@ public class InternalPromiseUtil {
|
||||
void _setValue(@NotNull PromiseValue<T> value);
|
||||
}
|
||||
|
||||
public interface CompletablePromise<T> extends Promise<T> {
|
||||
void setResult(@Nullable T t);
|
||||
boolean setError(@NotNull Throwable error);
|
||||
}
|
||||
|
||||
@SuppressWarnings("ExceptionClassNameDoesntEndWithException")
|
||||
public static class MessageError extends RuntimeException {
|
||||
public final ThreeState log;
|
||||
|
||||
@@ -143,9 +143,4 @@ public interface Promise<T> {
|
||||
default boolean isSucceeded() {
|
||||
return getState() == State.SUCCEEDED;
|
||||
}
|
||||
|
||||
interface CompletablePromise<T> extends Promise<T> {
|
||||
void setResult(@Nullable T t);
|
||||
boolean setError(@NotNull Throwable error);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import org.jetbrains.concurrency.Promise.State
|
||||
import java.util.concurrent.*
|
||||
import java.util.function.Consumer
|
||||
|
||||
open class AsyncPromise<T> : CancellablePromise<T>, Promise.CompletablePromise<T> {
|
||||
open class AsyncPromise<T> : CancellablePromise<T>, InternalPromiseUtil.CompletablePromise<T> {
|
||||
private val f: CompletableFuture<T>
|
||||
|
||||
constructor() {
|
||||
|
||||
Reference in New Issue
Block a user