diff --git a/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp b/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp index d2f935d5..9fdee7ab 100644 --- a/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp +++ b/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp @@ -24,7 +24,7 @@ using rcljava_common::exceptions::rcljava_throw_exception; JNIEXPORT jlong JNICALL -Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeAllocateRCL( +Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeAllocateRCLStatusEvent( JNIEnv * env, jclass) { void * p = malloc(sizeof(rmw_message_lost_status_t)); @@ -36,14 +36,14 @@ Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeAllocateRCL( } JNIEXPORT void JNICALL -Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeDeallocateRCL( +Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeDeallocateRCLStatusEvent( JNIEnv *, jclass, jlong handle) { free(reinterpret_cast(handle)); } JNIEXPORT void JNICALL -Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeFromRCL( +Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeFromRCLEvent( JNIEnv * env, jobject self, jlong handle) { auto * p = reinterpret_cast(handle); @@ -67,7 +67,7 @@ Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeFromRCL( } JNIEXPORT jint JNICALL -Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeGetEventType( +Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeGetSubscriptionEventType( JNIEnv *, jclass) { return RCL_SUBSCRIPTION_MESSAGE_LOST; diff --git a/rcljava/src/main/java/org/ros2/rcljava/subscription/statuses/MessageLost.java b/rcljava/src/main/java/org/ros2/rcljava/subscription/statuses/MessageLost.java index d136b4df..eb789b4c 100644 --- a/rcljava/src/main/java/org/ros2/rcljava/subscription/statuses/MessageLost.java +++ b/rcljava/src/main/java/org/ros2/rcljava/subscription/statuses/MessageLost.java @@ -30,16 +30,16 @@ public class MessageLost implements SubscriptionEventStatus { public int totalCountChange; public final long allocateRCLStatusEvent() { - return nativeAllocateRCL(); + return nativeAllocateRCLStatusEvent(); } public final void deallocateRCLStatusEvent(long handle) { - nativeDeallocateRCL(handle); + nativeDeallocateRCLStatusEvent(handle); } public final void fromRCLEvent(long handle) { - nativeFromRCL(handle); + nativeFromRCLEvent(handle); } public final int getSubscriptionEventType() { - return nativeGetEventType(); + return nativeGetSubscriptionEventType(); } // TODO(ivanpauno): Remove this when -source 8 can be used (method references for the win) public static final Supplier factory = new Supplier() { @@ -48,6 +48,11 @@ public MessageLost get() { } }; + private static native long nativeAllocateRCLStatusEvent(); + private static native void nativeDeallocateRCLStatusEvent(long handle); + private native void nativeFromRCLEvent(long handle); + private static native int nativeGetSubscriptionEventType(); + private static final Logger logger = LoggerFactory.getLogger(MessageLost.class); static { try { @@ -57,9 +62,4 @@ public MessageLost get() { System.exit(1); } } - - private static native long nativeAllocateRCL(); - private static native void nativeDeallocateRCL(long handle); - private native void nativeFromRCL(long handle); - private static native int nativeGetEventType(); }