Skip to content

Commit 13d4b11

Browse files
committed
Fix MessageLost native methods names causing loading issues (#70)
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
1 parent c440e9f commit 13d4b11

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
using rcljava_common::exceptions::rcljava_throw_exception;
2525

2626
JNIEXPORT jlong JNICALL
27-
Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeAllocateRCL(
27+
Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeAllocateRCLStatusEvent(
2828
JNIEnv * env, jclass)
2929
{
3030
void * p = malloc(sizeof(rmw_message_lost_status_t));
@@ -36,14 +36,14 @@ Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeAllocateRCL(
3636
}
3737

3838
JNIEXPORT void JNICALL
39-
Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeDeallocateRCL(
39+
Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeDeallocateRCLStatusEvent(
4040
JNIEnv *, jclass, jlong handle)
4141
{
4242
free(reinterpret_cast<void *>(handle));
4343
}
4444

4545
JNIEXPORT void JNICALL
46-
Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeFromRCL(
46+
Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeFromRCLEvent(
4747
JNIEnv * env, jobject self, jlong handle)
4848
{
4949
auto * p = reinterpret_cast<rmw_message_lost_status_t *>(handle);
@@ -67,7 +67,7 @@ Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeFromRCL(
6767
}
6868

6969
JNIEXPORT jint JNICALL
70-
Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeGetEventType(
70+
Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeGetSubscriptionEventType(
7171
JNIEnv *, jclass)
7272
{
7373
return RCL_SUBSCRIPTION_MESSAGE_LOST;

rcljava/src/main/java/org/ros2/rcljava/subscription/statuses/MessageLost.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ public class MessageLost implements SubscriptionEventStatus {
3030
public int totalCountChange;
3131

3232
public final long allocateRCLStatusEvent() {
33-
return nativeAllocateRCL();
33+
return nativeAllocateRCLStatusEvent();
3434
}
3535
public final void deallocateRCLStatusEvent(long handle) {
36-
nativeDeallocateRCL(handle);
36+
nativeDeallocateRCLStatusEvent(handle);
3737
}
3838
public final void fromRCLEvent(long handle) {
39-
nativeFromRCL(handle);
39+
nativeFromRCLEvent(handle);
4040
}
4141
public final int getSubscriptionEventType() {
42-
return nativeGetEventType();
42+
return nativeGetSubscriptionEventType();
4343
}
4444
// TODO(ivanpauno): Remove this when -source 8 can be used (method references for the win)
4545
public static final Supplier<MessageLost> factory = new Supplier<MessageLost>() {
@@ -48,6 +48,11 @@ public MessageLost get() {
4848
}
4949
};
5050

51+
private static native long nativeAllocateRCLStatusEvent();
52+
private static native void nativeDeallocateRCLStatusEvent(long handle);
53+
private native void nativeFromRCLEvent(long handle);
54+
private static native int nativeGetSubscriptionEventType();
55+
5156
private static final Logger logger = LoggerFactory.getLogger(MessageLost.class);
5257
static {
5358
try {
@@ -57,9 +62,4 @@ public MessageLost get() {
5762
System.exit(1);
5863
}
5964
}
60-
61-
private static native long nativeAllocateRCL();
62-
private static native void nativeDeallocateRCL(long handle);
63-
private native void nativeFromRCL(long handle);
64-
private static native int nativeGetEventType();
6565
}

0 commit comments

Comments
 (0)