From b130e4a003d72e541257d3042783d4e29791075d Mon Sep 17 00:00:00 2001 From: Jade Turner Date: Wed, 6 Nov 2024 11:46:05 +0800 Subject: [PATCH] java Signed-off-by: Jade Turner --- .../main/java/edu/wpi/first/wpilibj/DriverStation.java | 2 +- .../src/main/java/edu/wpi/first/wpilibj/MotorSafety.java | 2 +- .../first/wpilibj/internal/DriverStationModeThread.java | 2 +- .../wpi/first/wpilibj/simulation/DriverStationSim.java | 2 +- .../wpilibj/templates/educational/EducationalRobot.java | 2 +- .../first/wpilibj/templates/robotbaseskeleton/Robot.java | 2 +- .../templates/romieducational/EducationalRobot.java | 2 +- .../templates/xrpeducational/EducationalRobot.java | 2 +- .../java/edu/wpi/first/wpilibj/DriverStationTest.java | 2 +- wpiutil/src/main/java/edu/wpi/first/util/WPIUtilJNI.java | 4 ++-- .../main/java/edu/wpi/first/util/concurrent/Event.java | 2 +- .../java/edu/wpi/first/util/concurrent/Semaphore.java | 2 +- wpiutil/src/main/native/cpp/jni/WPIUtilJNI.cpp | 8 ++++---- 13 files changed, 17 insertions(+), 17 deletions(-) diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java index 1e51b5b4c9f..480696fa223 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java @@ -1152,7 +1152,7 @@ public static AllianceStationID getRawAllianceStation() { * @return true if connected, false if timeout */ public static boolean waitForDsConnection(double timeoutSeconds) { - int event = WPIUtilJNI.createEvent(true, false); + int event = WPIUtilJNI.makeEvent(true, false); DriverStationJNI.provideNewDataEventHandle(event); boolean result; try { diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/MotorSafety.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/MotorSafety.java index dc969a9c96f..d3d18a97151 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/MotorSafety.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/MotorSafety.java @@ -31,7 +31,7 @@ public abstract class MotorSafety { @SuppressWarnings("PMD.AssignmentInOperand") private static void threadMain() { - int event = WPIUtilJNI.createEvent(false, false); + int event = WPIUtilJNI.makeEvent(false, false); DriverStationJNI.provideNewDataEventHandle(event); ControlWord controlWord = new ControlWord(); diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/internal/DriverStationModeThread.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/internal/DriverStationModeThread.java index 57c6bf7ddf8..838dc56392c 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/internal/DriverStationModeThread.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/internal/DriverStationModeThread.java @@ -27,7 +27,7 @@ public DriverStationModeThread() { } private void run() { - int handle = WPIUtilJNI.createEvent(false, false); + int handle = WPIUtilJNI.makeEvent(false, false); DriverStationJNI.provideNewDataEventHandle(handle); while (m_keepAlive.get()) { diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/DriverStationSim.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/DriverStationSim.java index 52f733dc04b..3f958020e28 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/DriverStationSim.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/DriverStationSim.java @@ -285,7 +285,7 @@ public static void setMatchTime(double matchTime) { /** Updates DriverStation data so that new values are visible to the user program. */ public static void notifyNewData() { - int handle = WPIUtilJNI.createEvent(false, false); + int handle = WPIUtilJNI.makeEvent(false, false); DriverStationJNI.provideNewDataEventHandle(handle); DriverStationDataJNI.notifyNewData(); try { diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/educational/EducationalRobot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/educational/EducationalRobot.java index 29c4022dec9..ecc56639f51 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/educational/EducationalRobot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/educational/EducationalRobot.java @@ -36,7 +36,7 @@ public void test() { public void startCompetition() { DriverStationModeThread modeThread = new DriverStationModeThread(); - int event = WPIUtilJNI.createEvent(false, false); + int event = WPIUtilJNI.makeEvent(false, false); DriverStation.provideRefreshedDataEventHandle(event); diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/robotbaseskeleton/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/robotbaseskeleton/Robot.java index dfad4caf1e0..c1557e757fd 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/robotbaseskeleton/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/robotbaseskeleton/Robot.java @@ -31,7 +31,7 @@ public void test() {} public void startCompetition() { DriverStationModeThread modeThread = new DriverStationModeThread(); - int event = WPIUtilJNI.createEvent(false, false); + int event = WPIUtilJNI.makeEvent(false, false); DriverStation.provideRefreshedDataEventHandle(event); diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/romieducational/EducationalRobot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/romieducational/EducationalRobot.java index a9a777e42a4..915db359b9e 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/romieducational/EducationalRobot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/romieducational/EducationalRobot.java @@ -36,7 +36,7 @@ public void test() { public void startCompetition() { DriverStationModeThread modeThread = new DriverStationModeThread(); - int event = WPIUtilJNI.createEvent(false, false); + int event = WPIUtilJNI.makeEvent(false, false); DriverStation.provideRefreshedDataEventHandle(event); diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/xrpeducational/EducationalRobot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/xrpeducational/EducationalRobot.java index 0a6245c0894..a3ef643a519 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/xrpeducational/EducationalRobot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/xrpeducational/EducationalRobot.java @@ -36,7 +36,7 @@ public void test() { public void startCompetition() { DriverStationModeThread modeThread = new DriverStationModeThread(); - int event = WPIUtilJNI.createEvent(false, false); + int event = WPIUtilJNI.makeEvent(false, false); DriverStation.provideRefreshedDataEventHandle(event); diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/DriverStationTest.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/DriverStationTest.java index cd67cbdb18f..1c1796b813c 100644 --- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/DriverStationTest.java +++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/DriverStationTest.java @@ -26,7 +26,7 @@ protected Logger getClassLogger() { public void waitForDataTest() { long startTime = RobotController.getFPGATime(); - int handle = WPIUtilJNI.createEvent(false, false); + int handle = WPIUtilJNI.makeEvent(false, false); DriverStationJNI.provideNewDataEventHandle(handle); // Wait for data 50 times diff --git a/wpiutil/src/main/java/edu/wpi/first/util/WPIUtilJNI.java b/wpiutil/src/main/java/edu/wpi/first/util/WPIUtilJNI.java index 136e2c041d6..42754b3640a 100644 --- a/wpiutil/src/main/java/edu/wpi/first/util/WPIUtilJNI.java +++ b/wpiutil/src/main/java/edu/wpi/first/util/WPIUtilJNI.java @@ -108,7 +108,7 @@ public static synchronized void forceLoad() throws IOException { * @param initialState true to make the event initially in signaled state * @return Event handle */ - public static native int createEvent(boolean manualReset, boolean initialState); + public static native int makeEvent(boolean manualReset, boolean initialState); /** * Destroys an event. Destruction wakes up any waiters. @@ -141,7 +141,7 @@ public static synchronized void forceLoad() throws IOException { * @param maximumCount maximum value for the semaphore's internal counter * @return Semaphore handle */ - public static native int createSemaphore(int initialCount, int maximumCount); + public static native int makeSemaphore(int initialCount, int maximumCount); /** * Destroys a semaphore. Destruction wakes up any waiters. diff --git a/wpiutil/src/main/java/edu/wpi/first/util/concurrent/Event.java b/wpiutil/src/main/java/edu/wpi/first/util/concurrent/Event.java index bda2e8868f5..329bbd212c0 100644 --- a/wpiutil/src/main/java/edu/wpi/first/util/concurrent/Event.java +++ b/wpiutil/src/main/java/edu/wpi/first/util/concurrent/Event.java @@ -22,7 +22,7 @@ public final class Event implements AutoCloseable { * @param initialState true to make the event initially in signaled state */ public Event(boolean manualReset, boolean initialState) { - m_handle = WPIUtilJNI.createEvent(manualReset, initialState); + m_handle = WPIUtilJNI.makeEvent(manualReset, initialState); } /** diff --git a/wpiutil/src/main/java/edu/wpi/first/util/concurrent/Semaphore.java b/wpiutil/src/main/java/edu/wpi/first/util/concurrent/Semaphore.java index 66c28a29645..d8d3c1a99d7 100644 --- a/wpiutil/src/main/java/edu/wpi/first/util/concurrent/Semaphore.java +++ b/wpiutil/src/main/java/edu/wpi/first/util/concurrent/Semaphore.java @@ -21,7 +21,7 @@ public final class Semaphore implements AutoCloseable { * @param maximumCount maximum value for the semaphore's internal counter */ public Semaphore(int initialCount, int maximumCount) { - m_handle = WPIUtilJNI.createSemaphore(initialCount, maximumCount); + m_handle = WPIUtilJNI.makeSemaphore(initialCount, maximumCount); } /** diff --git a/wpiutil/src/main/native/cpp/jni/WPIUtilJNI.cpp b/wpiutil/src/main/native/cpp/jni/WPIUtilJNI.cpp index 60022d192eb..2b39e07fb67 100644 --- a/wpiutil/src/main/native/cpp/jni/WPIUtilJNI.cpp +++ b/wpiutil/src/main/native/cpp/jni/WPIUtilJNI.cpp @@ -162,11 +162,11 @@ Java_edu_wpi_first_util_WPIUtilJNI_getSystemTime /* * Class: edu_wpi_first_util_WPIUtilJNI - * Method: createEvent + * Method: makeEvent * Signature: (ZZ)I */ JNIEXPORT jint JNICALL -Java_edu_wpi_first_util_WPIUtilJNI_createEvent +Java_edu_wpi_first_util_WPIUtilJNI_makeEvent (JNIEnv*, jclass, jboolean manualReset, jboolean initialState) { return wpi::MakeEvent(manualReset, initialState); @@ -210,11 +210,11 @@ Java_edu_wpi_first_util_WPIUtilJNI_resetEvent /* * Class: edu_wpi_first_util_WPIUtilJNI - * Method: createSemaphore + * Method: makeSemaphore * Signature: (II)I */ JNIEXPORT jint JNICALL -Java_edu_wpi_first_util_WPIUtilJNI_createSemaphore +Java_edu_wpi_first_util_WPIUtilJNI_makeSemaphore (JNIEnv*, jclass, jint initialCount, jint maximumCount) { return wpi::MakeSemaphore(initialCount, maximumCount);