Implements AutoCloseable for types, replacing free() (#1048)

This commit is contained in:
Thad House
2018-05-22 23:33:17 -07:00
committed by Peter Johnson
parent a2ecb1027a
commit cbaff52850
58 changed files with 242 additions and 171 deletions

View File

@@ -32,7 +32,7 @@ import edu.wpi.first.wpilibj.util.WPILibVersion;
* run to completion before the OperatorControl code could start. In the future the Autonomous code
* might be spawned as a task, then killed at the end of the Autonomous period.
*/
public abstract class RobotBase {
public abstract class RobotBase implements AutoCloseable {
/**
* The ID of the main Java thread.
*/
@@ -93,10 +93,15 @@ public abstract class RobotBase {
LiveWindow.setEnabled(false);
}
@Deprecated
public void free() {
}
/**
* Free the resources for a RobotBase class.
*/
public void free() {
@Override
public void close() {
}
/**