diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2016-12-21 14:29:01 +0100 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2016-12-21 17:50:03 +0000 |
commit | 4348c85b3da576936dd99e0ac6b56921dd7fd9e9 (patch) | |
tree | 680ccb1437d8e0c6c0940cda3ff12eb36ab8ce1e | |
parent | 29396e6445922ba0ca1d4c36d4bedaacea313ad6 (diff) |
Fix coverity issues
Change-Id: I7707a42321df2c73e5414926d4000f8672ecfaf3
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
-rw-r--r-- | vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/JVppRegistryImpl.java | 8 | ||||
-rw-r--r-- | vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/future/AbstractFutureJVppInvoker.java | 6 |
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 |