Should make Coverity stop thinking we try to synchronize reply.context.
Change-Id: I97169e46b9c8f594836d6beb75b9f42dfc6e5bad
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
@Override
@SuppressWarnings("unchecked")
@Override
@SuppressWarnings("unchecked")
- public void onControlPingReply($base_package.$dto_package.ControlPingReply reply) {
+ public void onControlPingReply(final $base_package.$dto_package.ControlPingReply reply) {
$base_package.$callback_package.ControlPingCallback callback;
$base_package.$callback_package.ControlPingCallback callback;
+ final int replyId = reply.context;
- callback = ($base_package.$callback_package.ControlPingCallback) requests.remove(reply.context);
+ callback = ($base_package.$callback_package.ControlPingCallback) requests.remove(replyId);
jvpp_facade_callback_method_template = Template("""
@Override
@SuppressWarnings("unchecked")
jvpp_facade_callback_method_template = Template("""
@Override
@SuppressWarnings("unchecked")
- public void on$callback_dto($plugin_package.$dto_package.$callback_dto reply) {
+ public void on$callback_dto(final $plugin_package.$dto_package.$callback_dto reply) {
$plugin_package.$callback_package.$callback callback;
$plugin_package.$callback_package.$callback callback;
+ final int replyId = reply.context;
- callback = ($plugin_package.$callback_package.$callback) requests.remove(reply.context);
+ callback = ($plugin_package.$callback_package.$callback) requests.remove(replyId);
@Override
@SuppressWarnings("unchecked")
@Override
@SuppressWarnings("unchecked")
- public void onControlPingReply($base_package.$dto_package.ControlPingReply reply) {
+ public void onControlPingReply(final $base_package.$dto_package.ControlPingReply reply) {
final java.util.concurrent.CompletableFuture<$base_package.$dto_package.JVppReply<?>> completableFuture;
final java.util.concurrent.CompletableFuture<$base_package.$dto_package.JVppReply<?>> completableFuture;
+ final int replyId = reply.context;
- completableFuture = (java.util.concurrent.CompletableFuture<$base_package.$dto_package.JVppReply<?>>) requests.get(reply.context);
+ completableFuture = (java.util.concurrent.CompletableFuture<$base_package.$dto_package.JVppReply<?>>) requests.get(replyId);
}
if(completableFuture != null) {
}
if(completableFuture != null) {
} else {
completableFuture.complete(reply);
}
} else {
completableFuture.complete(reply);
}
- requests.remove(reply.context);
+ requests.remove(replyId);
jvpp_facade_callback_method_template = Template("""
@Override
@SuppressWarnings("unchecked")
jvpp_facade_callback_method_template = Template("""
@Override
@SuppressWarnings("unchecked")
- public void on$callback_dto($plugin_package.$dto_package.$callback_dto reply) {
+ public void on$callback_dto(final $plugin_package.$dto_package.$callback_dto reply) {
final java.util.concurrent.CompletableFuture<$base_package.$dto_package.JVppReply<?>> completableFuture;
final java.util.concurrent.CompletableFuture<$base_package.$dto_package.JVppReply<?>> completableFuture;
+ final int replyId = reply.context;
- completableFuture = (java.util.concurrent.CompletableFuture<$base_package.$dto_package.JVppReply<?>>) requests.get(reply.context);
+ completableFuture = (java.util.concurrent.CompletableFuture<$base_package.$dto_package.JVppReply<?>>) requests.get(replyId);
}
if(completableFuture != null) {
completableFuture.complete(reply);
synchronized(requests) {
}
if(completableFuture != null) {
completableFuture.complete(reply);
synchronized(requests) {
- requests.remove(reply.context);
+ requests.remove(replyId);
jvpp_facade_details_callback_method_template = Template("""
@Override
@SuppressWarnings("unchecked")
jvpp_facade_details_callback_method_template = Template("""
@Override
@SuppressWarnings("unchecked")
- public void on$callback_dto($plugin_package.$dto_package.$callback_dto reply) {
+ public void on$callback_dto(final $plugin_package.$dto_package.$callback_dto reply) {
final $base_package.$future_package.AbstractFutureJVppInvoker.CompletableDumpFuture<$plugin_package.$dto_package.$callback_dto_reply_dump> completableFuture;
final $base_package.$future_package.AbstractFutureJVppInvoker.CompletableDumpFuture<$plugin_package.$dto_package.$callback_dto_reply_dump> completableFuture;
+ final int replyId = reply.context;
- completableFuture = ($base_package.$future_package.AbstractFutureJVppInvoker.CompletableDumpFuture<$plugin_package.$dto_package.$callback_dto_reply_dump>) requests.get(reply.context);
+ completableFuture = ($base_package.$future_package.AbstractFutureJVppInvoker.CompletableDumpFuture<$plugin_package.$dto_package.$callback_dto_reply_dump>) requests.get(replyId);
}
if(completableFuture != null) {
}
if(completableFuture != null) {