summaryrefslogtreecommitdiffstats
path: root/extras/japi/java/jvpp
diff options
context:
space:
mode:
Diffstat (limited to 'extras/japi/java/jvpp')
-rwxr-xr-xextras/japi/java/jvpp/gen/jvppgen/jni_impl_gen.py3
-rwxr-xr-xextras/japi/java/jvpp/gen/jvppgen/jvpp_model.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/extras/japi/java/jvpp/gen/jvppgen/jni_impl_gen.py b/extras/japi/java/jvpp/gen/jvppgen/jni_impl_gen.py
index 717a42c452a..2941778f208 100755
--- a/extras/japi/java/jvpp/gen/jvppgen/jni_impl_gen.py
+++ b/extras/japi/java/jvpp/gen/jvppgen/jni_impl_gen.py
@@ -111,5 +111,6 @@ def _generate_msg_size(msg):
_size_components += " + %s*sizeof(%s)" % (field.array_len_field.java_name, field.type.base_type.vpp_name)
# FIXME(VPP-586): for proper nested structures support, we need generate functions computing type sizes
# and use it instead of sizeof
-
+ if field.type.name == "string":
+ _size_components += " + jstr_length(env, %s) * sizeof(u8)" % field.name
return msg_size + "".join(_size_components)
diff --git a/extras/japi/java/jvpp/gen/jvppgen/jvpp_model.py b/extras/japi/java/jvpp/gen/jvppgen/jvpp_model.py
index da1e01f5a63..9a3204e3fc6 100755
--- a/extras/japi/java/jvpp/gen/jvppgen/jvpp_model.py
+++ b/extras/japi/java/jvpp/gen/jvppgen/jvpp_model.py
@@ -447,7 +447,7 @@ class JVppModel(object):
host_to_net_function='clib_host_to_net_i64',
net_to_host_function='clib_net_to_host_i64'),
'f64': SimpleType('f64', 'double', 'D', 'jdouble', 'Double'),
- 'string': SimpleType('string', 'String', 'l', 'jstring', 'Object',
+ 'string': SimpleType('string', 'String', 'Ljava/lang/String;', 'jstring', 'Object',
host_to_net_function='_host_to_net_string',
net_to_host_function='_net_to_host_string')
})