summaryrefslogtreecommitdiff
path: root/java/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/src')
-rw-r--r--java/src/Ice/src/main/java/com/zeroc/IceInternal/InvocationFutureI.java23
1 files changed, 20 insertions, 3 deletions
diff --git a/java/src/Ice/src/main/java/com/zeroc/IceInternal/InvocationFutureI.java b/java/src/Ice/src/main/java/com/zeroc/IceInternal/InvocationFutureI.java
index 951a103fe44..3be5400e401 100644
--- a/java/src/Ice/src/main/java/com/zeroc/IceInternal/InvocationFutureI.java
+++ b/java/src/Ice/src/main/java/com/zeroc/IceInternal/InvocationFutureI.java
@@ -133,13 +133,30 @@ public abstract class InvocationFutureI<T> extends com.zeroc.Ice.InvocationFutur
// calling thread if the request was sent synchronously. Calling complete() or
// completeExceptionally() on _sentFuture invokes the action from this thread.
//
- if(_exception != null)
+ if(_sentSynchronously)
{
- _sentFuture.completeExceptionally(_exception);
+ if(_exception != null)
+ {
+ _sentFuture.completeExceptionally(_exception);
+ }
+ else
+ {
+ _sentFuture.complete(_sentSynchronously);
+ }
}
else
{
- _sentFuture.complete(_sentSynchronously);
+ if(_exception != null)
+ {
+ dispatch(() ->
+ {
+ _sentFuture.completeExceptionally(_exception);
+ });
+ }
+ else
+ {
+ invokeSentAsync();
+ }
}
}
return r;