mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Remove deprecated free() calls (#1925)
Replaced with the standard close()
This commit is contained in:
committed by
Peter Johnson
parent
7f839b87ce
commit
0e3b0f3da7
@@ -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) {
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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()}).
|
||||
*/
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -105,10 +105,6 @@ public abstract class RobotBase implements AutoCloseable {
|
||||
return m_threadId;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void free() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user