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;
|
final ControlPingCallback callback;
|
||||||
synchronized (pingCalls) {
|
synchronized (pingCalls) {
|
||||||
callback = pingCalls.remove(reply.context);
|
callback = pingCalls.remove(reply.context);
|
||||||
}
|
|
||||||
if (callback == null) {
|
if (callback == null) {
|
||||||
LOG.log(Level.WARNING, "No callback was registered for reply context=" + reply.context + " Contexts waiting="
|
LOG.log(Level.WARNING, "No callback was registered for reply context=" + reply.context + " Contexts waiting="
|
||||||
+ pingCalls.keySet());
|
+ pingCalls.keySet());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// pass the reply to the callback registered by the ping caller
|
// pass the reply to the callback registered by the ping caller
|
||||||
callback.onControlPingReply(reply);
|
callback.onControlPingReply(reply);
|
||||||
}
|
}
|
||||||
|
@ -51,8 +51,10 @@ public abstract class AbstractFutureJVppInvoker implements FutureJVppInvoker {
|
|||||||
this.requests = Objects.requireNonNull(requestMap, "Null requestMap");
|
this.requests = Objects.requireNonNull(requestMap, "Null requestMap");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected synchronized final Map<Integer, CompletableFuture<? extends JVppReply<?>>> getRequests() {
|
protected final Map<Integer, CompletableFuture<? extends JVppReply<?>>> getRequests() {
|
||||||
return this.requests;
|
synchronized (requests) {
|
||||||
|
return requests;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO use Optional in Future, java8
|
// TODO use Optional in Future, java8
|
||||||
|
Reference in New Issue
Block a user