mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[build] Enable spotbugs (#3601)
Benign spotbugs warnings were suppressed, and all others were fixed. Bug descriptions are documented here: https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html Co-authored-by: Austin Shalit <austinshalit@gmail.com>
This commit is contained in:
@@ -17,8 +17,7 @@ class CommandGroupErrorTest extends CommandTestBase {
|
||||
MockCommandHolder command2Holder = new MockCommandHolder(true);
|
||||
Command command2 = command2Holder.getMock();
|
||||
|
||||
@SuppressWarnings("PMD.UnusedLocalVariable")
|
||||
Command group = new ParallelCommandGroup(command1, command2);
|
||||
new ParallelCommandGroup(command1, command2);
|
||||
assertThrows(
|
||||
IllegalArgumentException.class, () -> new ParallelCommandGroup(command1, command2));
|
||||
}
|
||||
@@ -31,8 +30,7 @@ class CommandGroupErrorTest extends CommandTestBase {
|
||||
MockCommandHolder command2Holder = new MockCommandHolder(true);
|
||||
Command command2 = command2Holder.getMock();
|
||||
|
||||
@SuppressWarnings("PMD.UnusedLocalVariable")
|
||||
Command group = new ParallelCommandGroup(command1, command2);
|
||||
new ParallelCommandGroup(command1, command2);
|
||||
|
||||
assertThrows(IllegalArgumentException.class, () -> scheduler.schedule(command1));
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ public abstract class CommandTestBase {
|
||||
}
|
||||
}
|
||||
|
||||
public class TestSubsystem extends SubsystemBase {}
|
||||
public static class TestSubsystem extends SubsystemBase {}
|
||||
|
||||
public class MockCommandHolder {
|
||||
public static class MockCommandHolder {
|
||||
private final Command m_mockCommand = mock(Command.class);
|
||||
|
||||
public MockCommandHolder(boolean runWhenDisabled, Subsystem... requirements) {
|
||||
@@ -61,7 +61,7 @@ public abstract class CommandTestBase {
|
||||
}
|
||||
}
|
||||
|
||||
public class Counter {
|
||||
public static class Counter {
|
||||
public int m_counter;
|
||||
|
||||
public void increment() {
|
||||
@@ -69,7 +69,7 @@ public abstract class CommandTestBase {
|
||||
}
|
||||
}
|
||||
|
||||
public class ConditionHolder {
|
||||
public static class ConditionHolder {
|
||||
private boolean m_condition;
|
||||
|
||||
public void setCondition(boolean condition) {
|
||||
|
||||
Reference in New Issue
Block a user