mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +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:
@@ -267,21 +267,18 @@ public class PIDBase implements PIDInterface, PIDOutput, Sendable, AutoCloseable
|
||||
|
||||
// Ensures m_enabled check and pidWrite() call occur atomically
|
||||
m_pidWriteMutex.lock();
|
||||
m_thisMutex.lock();
|
||||
try {
|
||||
m_thisMutex.lock();
|
||||
try {
|
||||
if (m_enabled) {
|
||||
// Don't block other PIDController operations on pidWrite()
|
||||
m_thisMutex.unlock();
|
||||
if (m_enabled) {
|
||||
// Don't block other PIDController operations on pidWrite()
|
||||
m_thisMutex.unlock();
|
||||
|
||||
m_pidOutput.pidWrite(result);
|
||||
}
|
||||
} finally {
|
||||
if (m_thisMutex.isHeldByCurrentThread()) {
|
||||
m_thisMutex.unlock();
|
||||
}
|
||||
m_pidOutput.pidWrite(result);
|
||||
}
|
||||
} finally {
|
||||
if (!m_enabled) {
|
||||
m_thisMutex.unlock();
|
||||
}
|
||||
m_pidWriteMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public abstract class AbstractCommandTest {
|
||||
Scheduler.getInstance().enable();
|
||||
}
|
||||
|
||||
public class ASubsystem extends Subsystem {
|
||||
public static class ASubsystem extends Subsystem {
|
||||
Command m_command;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,7 +17,6 @@ class ConditionalCommandTest extends AbstractCommandTest {
|
||||
MockCommand m_onTrue;
|
||||
MockCommand m_onFalse;
|
||||
MockSubsystem m_subsys;
|
||||
Boolean m_condition;
|
||||
|
||||
@BeforeEach
|
||||
void initCommands() {
|
||||
|
||||
Reference in New Issue
Block a user