Java optimization and formatting fixes (#4857)

This commit is contained in:
Sriman Achanta
2022-12-26 14:37:53 -05:00
committed by GitHub
parent 92149efa11
commit 26bdbf3d41
13 changed files with 21 additions and 35 deletions

View File

@@ -103,10 +103,7 @@ public final class CommandScheduler implements NTSendable, AutoCloseable {
disable();
cancelAll();
});
LiveWindow.setDisabledListener(
() -> {
enable();
});
LiveWindow.setDisabledListener(this::enable);
}
/**

View File

@@ -117,11 +117,7 @@ public class MecanumControllerCommand extends CommandBase {
m_desiredRotation =
requireNonNullParam(desiredRotation, "desiredRotation", "MecanumControllerCommand");
m_maxWheelVelocityMetersPerSecond =
requireNonNullParam(
maxWheelVelocityMetersPerSecond,
"maxWheelVelocityMetersPerSecond",
"MecanumControllerCommand");
m_maxWheelVelocityMetersPerSecond = maxWheelVelocityMetersPerSecond;
m_frontLeftController =
requireNonNullParam(frontLeftController, "frontLeftController", "MecanumControllerCommand");
@@ -258,11 +254,7 @@ public class MecanumControllerCommand extends CommandBase {
m_desiredRotation =
requireNonNullParam(desiredRotation, "desiredRotation", "MecanumControllerCommand");
m_maxWheelVelocityMetersPerSecond =
requireNonNullParam(
maxWheelVelocityMetersPerSecond,
"maxWheelVelocityMetersPerSecond",
"MecanumControllerCommand");
m_maxWheelVelocityMetersPerSecond = maxWheelVelocityMetersPerSecond;
m_frontLeftController = null;
m_rearLeftController = null;

View File

@@ -72,7 +72,7 @@ public class SelectCommand extends CommandBase {
@Override
public void initialize() {
if (m_selector != null) {
if (!m_commands.keySet().contains(m_selector.get())) {
if (!m_commands.containsKey(m_selector.get())) {
m_selectedCommand =
new PrintCommand(
"SelectCommand selector value does not correspond to" + " any command!");