Skip to content
Prev Previous commit
Next Next commit
Fix JNI name mangling function so it works for service and action sub…
…types

For example, 'example_interfaces/srv/AddTwoInts_Request' should be mangled to 'example_1interfaces_srv_AddTwoInts_1Request'.

Signed-off-by: Jacob Perron <[email protected]>
  • Loading branch information
jacobperron committed Feb 11, 2020
commit efaf468bfd4bbceba067815444f1b472afab87d7
2 changes: 1 addition & 1 deletion rosidl_generator_java/rosidl_generator_java/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,4 @@ def get_jni_signature(type_):
def get_jni_mangled_name(fully_qualified_name):
# JNI name mangling:
# https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/design.html#resolving_native_method_names
return fully_qualified_name[0].replace('_', '_1') + '_' + '_'.join(fully_qualified_name[1:])
return '_'.join(list(map(lambda name: name.replace('_', '_1'), fully_qualified_name)))