aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/JVppRegistryImpl.java8
-rw-r--r--vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/future/AbstractFutureJVppInvoker.java6
2 files changed, 8 insertions, 6 deletions
diff --git a/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/JVppRegistryImpl.java b/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/JVppRegistryImpl.java
index 8e101404434..98ef1c158e8 100644
--- a/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/JVppRegistryImpl.java
+++ b/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/JVppRegistryImpl.java
@@ -108,11 +108,11 @@ public final class JVppRegistryImpl implements JVppRegistry, ControlPingCallback
final ControlPingCallback callback;
synchronized (pingCalls) {
callback = pingCalls.remove(reply.context);
- }
- if (callback == null) {
- LOG.log(Level.WARNING, "No callback was registered for reply context=" + reply.context + " Contexts waiting="
+ if (callback == null) {
+ LOG.log(Level.WARNING, "No callback was registered for reply context=" + reply.context + " Contexts waiting="
+ pingCalls.keySet());
- return;
+ return;
+ }
}
// pass the reply to the callback registered by the ping caller
callback.onControlPingReply(reply);
diff --git a/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/future/AbstractFutureJVppInvoker.java b/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/future/AbstractFutureJVppInvoker.java
index 98e140e9df6..e7df528ae30 100644
--- a/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/future/AbstractFutureJVppInvoker.java
+++ b/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/future/AbstractFutureJVppInvoker.java
@@ -51,8 +51,10 @@ public abstract class AbstractFutureJVppInvoker implements FutureJVppInvoker {
this.requests = Objects.requireNonNull(requestMap, "Null requestMap");
}
- protected synchronized final Map<Integer, CompletableFuture<? extends JVppReply<?>>> getRequests() {
- return this.requests;
+ protected final Map<Integer, CompletableFuture<? extends JVppReply<?>>> getRequests() {
+ synchronized (requests) {
+ return requests;
+ }
}
// TODO use Optional in Future, java8