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);
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