Skip to content

Commit 0dd0877

Browse files
committed
Fix JNI name mangling function so it works for service and action subtypes
For example, 'example_interfaces/srv/AddTwoInts_Request' should be mangled to 'example_1interfaces_srv_AddTwoInts_1Request'. Signed-off-by: Jacob Perron <[email protected]>
1 parent 32a59e2 commit 0dd0877

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rosidl_generator_java/rosidl_generator_java/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,4 @@ def get_jni_signature(type_):
204204
def get_jni_mangled_name(fully_qualified_name):
205205
# JNI name mangling:
206206
# https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/design.html#resolving_native_method_names
207-
return fully_qualified_name[0].replace('_', '_1') + '_' + '_'.join(fully_qualified_name[1:])
207+
return '_'.join(list(map(lambda name: name.replace('_', '_1'), fully_qualified_name)))

0 commit comments

Comments
 (0)