From 0e3b0f3da75e24021ba9eda4b1dffc811dbf410a Mon Sep 17 00:00:00 2001 From: Thad House Date: Tue, 8 Oct 2019 21:30:33 -0700 Subject: [PATCH] Remove deprecated free() calls (#1925) Replaced with the standard close() --- cscore/src/main/java/edu/wpi/cscore/VideoListener.java | 7 +------ cscore/src/main/java/edu/wpi/cscore/VideoSink.java | 7 +------ cscore/src/main/java/edu/wpi/cscore/VideoSource.java | 5 ----- .../edu/wpi/first/networktables/NetworkTableInstance.java | 7 +------ .../src/main/java/edu/wpi/first/networktables/RpcCall.java | 7 +------ wpilibj/src/main/java/edu/wpi/first/wpilibj/I2C.java | 5 ----- wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java | 4 ---- .../src/main/java/edu/wpi/first/wpilibj/RobotDrive.java | 5 ----- wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java | 6 ------ 9 files changed, 4 insertions(+), 49 deletions(-) diff --git a/cscore/src/main/java/edu/wpi/cscore/VideoListener.java b/cscore/src/main/java/edu/wpi/cscore/VideoListener.java index 8dd62fa309..2a35505cd3 100644 --- a/cscore/src/main/java/edu/wpi/cscore/VideoListener.java +++ b/cscore/src/main/java/edu/wpi/cscore/VideoListener.java @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------*/ -/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */ +/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ @@ -27,11 +27,6 @@ public class VideoListener implements AutoCloseable { m_handle = CameraServerJNI.addListener(listener, eventMask, immediateNotify); } - @Deprecated - public void free() { - close(); - } - @Override public synchronized void close() { if (m_handle != 0) { diff --git a/cscore/src/main/java/edu/wpi/cscore/VideoSink.java b/cscore/src/main/java/edu/wpi/cscore/VideoSink.java index 8aa4199d7f..107f6d9a18 100644 --- a/cscore/src/main/java/edu/wpi/cscore/VideoSink.java +++ b/cscore/src/main/java/edu/wpi/cscore/VideoSink.java @@ -46,11 +46,6 @@ public class VideoSink implements AutoCloseable { m_handle = handle; } - @Deprecated - public void free() { - close(); - } - @Override public synchronized void close() { if (m_handle != 0) { @@ -186,7 +181,7 @@ public class VideoSink implements AutoCloseable { * @return Connected source; nullptr if no source connected. */ public VideoSource getSource() { - // While VideoSource.free() will call releaseSource(), getSinkSource() + // While VideoSource.close() will call releaseSource(), getSinkSource() // increments the internal reference count so this is okay to do. return new VideoSource(CameraServerJNI.getSinkSource(m_handle)); } diff --git a/cscore/src/main/java/edu/wpi/cscore/VideoSource.java b/cscore/src/main/java/edu/wpi/cscore/VideoSource.java index d301ad0566..51d3821716 100644 --- a/cscore/src/main/java/edu/wpi/cscore/VideoSource.java +++ b/cscore/src/main/java/edu/wpi/cscore/VideoSource.java @@ -81,11 +81,6 @@ public class VideoSource implements AutoCloseable { m_handle = handle; } - @Deprecated - public void free() { - close(); - } - @Override public synchronized void close() { if (m_handle != 0) { diff --git a/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTableInstance.java b/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTableInstance.java index 2564f70ab6..29813a57e3 100644 --- a/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTableInstance.java +++ b/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTableInstance.java @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------*/ -/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */ +/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ @@ -60,11 +60,6 @@ public final class NetworkTableInstance implements AutoCloseable { m_handle = handle; } - @Deprecated - public void free() { - close(); - } - /** * Destroys the instance (if created by {@link #create()}). */ diff --git a/ntcore/src/main/java/edu/wpi/first/networktables/RpcCall.java b/ntcore/src/main/java/edu/wpi/first/networktables/RpcCall.java index 1b377f632b..b9148c983b 100644 --- a/ntcore/src/main/java/edu/wpi/first/networktables/RpcCall.java +++ b/ntcore/src/main/java/edu/wpi/first/networktables/RpcCall.java @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------*/ -/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */ +/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ @@ -22,11 +22,6 @@ public final class RpcCall implements AutoCloseable { m_call = call; } - @Deprecated - public void free() { - close(); - } - /** * Cancels the result if no other action taken. */ diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/I2C.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/I2C.java index 1be539097c..ca8374a2a3 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/I2C.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/I2C.java @@ -53,11 +53,6 @@ public class I2C implements AutoCloseable { HAL.report(tResourceType.kResourceType_I2C, deviceAddress); } - @Deprecated - public void free() { - close(); - } - @Override public void close() { I2CJNI.i2CClose(m_port); diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java index b40e1b862e..fa6263a933 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java @@ -105,10 +105,6 @@ public abstract class RobotBase implements AutoCloseable { return m_threadId; } - @Deprecated - public void free() { - } - @Override public void close() { } diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotDrive.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotDrive.java index e6a8a623b4..7a172737f3 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotDrive.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotDrive.java @@ -653,11 +653,6 @@ public class RobotDrive extends MotorSafety implements AutoCloseable { m_maxOutput = maxOutput; } - @Deprecated - public void free() { - close(); - } - /** * Free the speed controllers if they were allocated locally. */ diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java index a1568b4b05..a76ebb1fc1 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java @@ -50,12 +50,6 @@ public class SPI implements AutoCloseable { HAL.report(tResourceType.kResourceType_SPI, port.value); } - - @Deprecated - public void free() { - close(); - } - @Override public void close() { if (m_accum != null) {