Fix coverity issues
Change-Id: I7707a42321df2c73e5414926d4000f8672ecfaf3 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
This commit is contained in:

committed by
Damjan Marion

parent
29396e6445
commit
4348c85b3d
@ -108,12 +108,12 @@ 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="
|
||||
+ pingCalls.keySet());
|
||||
return;
|
||||
}
|
||||
}
|
||||
// pass the reply to the callback registered by the ping caller
|
||||
callback.onControlPingReply(reply);
|
||||
}
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user