VPP-1525: additional fixes for strings in Japi
[vpp.git] / extras / japi / java / jvpp / gen / jvppgen / jni_impl_gen.py
index 717a42c..2941778 100755 (executable)
@@ -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)