summaryrefslogtreecommitdiffstats
path: root/vpp-api/java/jvpp
diff options
context:
space:
mode:
authorMaros Marsalek <mmarsale@cisco.com>2016-09-19 15:35:41 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2016-09-20 13:20:37 +0000
commit560e809b4459f508b756a19493de746e0892389e (patch)
tree2f4326fd3186ee9974956f67c7495c0c0528d208 /vpp-api/java/jvpp
parenta53b0e29098725ecc20e8355e955c1307ce3dd8d (diff)
VPP-348 Return empty DumpReply instead of null
Change-Id: If44f8d37649e5a9d5033ec2c0ab7452397e22691 Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'vpp-api/java/jvpp')
-rw-r--r--vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py30
1 files changed, 16 insertions, 14 deletions
diff --git a/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py b/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py
index 06c1073b756..ebb840f795f 100644
--- a/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py
+++ b/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py
@@ -126,13 +126,7 @@ jvpp_facade_details_callback_method_template = Template("""
}
if(completableFuture != null) {
- $plugin_package.$dto_package.$callback_dto_reply_dump replyDump = completableFuture.getReplyDump();
- if(replyDump == null) {
- replyDump = new $plugin_package.$dto_package.$callback_dto_reply_dump();
- completableFuture.setReplyDump(replyDump);
- }
-
- replyDump.$callback_dto_field.add(reply);
+ completableFuture.getReplyDump().$callback_dto_field.add(reply);
}
}
""")
@@ -179,13 +173,13 @@ def generate_jvpp(func_list, base_package, plugin_package, plugin_name, dto_pack
reply_name=camel_case_reply_name + dto_gen.dump_dto_suffix,
request_name=util.remove_reply_suffix(camel_case_reply_name) +
util.underscore_to_camelcase_upper(util.dump_suffix)))
- methods_impl.append(future_jvpp_method_impl_template.substitute(plugin_package=plugin_package,
- dto_package=dto_package,
- method_name=camel_case_request_method_name +
- util.underscore_to_camelcase_upper(util.dump_suffix),
- reply_name=camel_case_reply_name + dto_gen.dump_dto_suffix,
- request_name=util.remove_reply_suffix(camel_case_reply_name) +
- util.underscore_to_camelcase_upper(util.dump_suffix)))
+ methods_impl.append(future_jvpp_dump_method_impl_template.substitute(plugin_package=plugin_package,
+ dto_package=dto_package,
+ method_name=camel_case_request_method_name +
+ util.underscore_to_camelcase_upper(util.dump_suffix),
+ reply_name=camel_case_reply_name + dto_gen.dump_dto_suffix,
+ request_name=util.remove_reply_suffix(camel_case_reply_name) +
+ util.underscore_to_camelcase_upper(util.dump_suffix)))
else:
request_name = util.underscore_to_camelcase_upper(util.unconventional_naming_rep_req[func['name']]) \
if func['name'] in util.unconventional_naming_rep_req else util.remove_reply_suffix(camel_case_name_with_suffix)
@@ -313,6 +307,14 @@ future_jvpp_method_impl_template = Template('''
}
''')
+future_jvpp_dump_method_impl_template = Template('''
+ @Override
+ public java.util.concurrent.CompletionStage<$plugin_package.$dto_package.$reply_name> $method_name($plugin_package.$dto_package.$request_name request) {
+ return send(request, new $plugin_package.$dto_package.$reply_name());
+ }
+''')
+
+
# Returns request name or special one from unconventional_naming_rep_req map
def get_standard_dump_reply_name(camel_case_dto_name, func_name):
# FIXME this is a hotfix for sub-details callbacks