From aebc272449dcbe49670e7e9e103ae6584792e662 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Tue, 14 Jun 2022 20:26:53 -0700 Subject: [PATCH] [build] Upgrade to spotbugs Gradle plugin 5.0.8 (#4310) This fixes a SecurityManager deprecation warning generated by spotbugs. --- build.gradle | 2 +- styleguide/spotbugs-exclude.xml | 13 +++++++++++++ .../wpilibj/counter/ExternalDirectionCounter.java | 2 +- .../edu/wpi/first/wpilibj/counter/Tachometer.java | 2 +- .../wpi/first/wpilibj/counter/UpDownCounter.java | 2 +- .../wpi/first/wpilibj/AbstractInterruptTest.java | 2 +- .../main/java/edu/wpi/first/wpilibj/PCMTest.java | 6 +++--- 7 files changed, 21 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index fab1197da7..2edfeeca11 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ plugins { id 'net.ltgt.errorprone' version '2.0.2' apply false id 'com.github.johnrengelman.shadow' version '7.1.2' apply false id 'com.diffplug.spotless' version '6.4.2' apply false - id 'com.github.spotbugs' version '5.0.6' apply false + id 'com.github.spotbugs' version '5.0.8' apply false } wpilibVersioning.buildServerMode = project.hasProperty('buildServer') diff --git a/styleguide/spotbugs-exclude.xml b/styleguide/spotbugs-exclude.xml index 2393c86468..7b83038a9e 100644 --- a/styleguide/spotbugs-exclude.xml +++ b/styleguide/spotbugs-exclude.xml @@ -19,6 +19,9 @@ + + + @@ -69,9 +72,19 @@ + + + + + + + + + + diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/counter/ExternalDirectionCounter.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/counter/ExternalDirectionCounter.java index e10274b98d..706a28754f 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/counter/ExternalDirectionCounter.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/counter/ExternalDirectionCounter.java @@ -95,7 +95,7 @@ public class ExternalDirectionCounter implements Sendable, AutoCloseable { } @Override - public void close() throws Exception { + public void close() { SendableRegistry.remove(this); CounterJNI.freeCounter(m_handle); CounterJNI.suppressUnused(m_countSource); diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/counter/Tachometer.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/counter/Tachometer.java index 90ae734626..5864233db7 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/counter/Tachometer.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/counter/Tachometer.java @@ -52,7 +52,7 @@ public class Tachometer implements Sendable, AutoCloseable { } @Override - public void close() throws Exception { + public void close() { SendableRegistry.remove(this); CounterJNI.freeCounter(m_handle); CounterJNI.suppressUnused(m_source); diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/counter/UpDownCounter.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/counter/UpDownCounter.java index 491e9222b3..c89c11811c 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/counter/UpDownCounter.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/counter/UpDownCounter.java @@ -66,7 +66,7 @@ public class UpDownCounter implements Sendable, AutoCloseable { } @Override - public void close() throws Exception { + public void close() { SendableRegistry.remove(this); CounterJNI.freeCounter(m_handle); CounterJNI.suppressUnused(m_upSource); diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/AbstractInterruptTest.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/AbstractInterruptTest.java index 219a611a26..bdc467578f 100644 --- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/AbstractInterruptTest.java +++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/AbstractInterruptTest.java @@ -52,7 +52,7 @@ public abstract class AbstractInterruptTest extends AbstractComsSetup { abstract void setInterruptLow(); @Test(timeout = 1000) - public void testSingleInterruptsTriggering() throws Exception { + public void testSingleInterruptsTriggering() { // Given // final InterruptCounter counter = new InterruptCounter(); // TestInterruptHandlerFunction function = new diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PCMTest.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PCMTest.java index 07e0139485..e571ffa87d 100644 --- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PCMTest.java +++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PCMTest.java @@ -70,7 +70,7 @@ public class PCMTest extends AbstractComsSetup { /** Test if the compressor turns on and off when the pressure switch is toggled. */ @Test - public void testPressureSwitch() throws Exception { + public void testPressureSwitch() { final double range = 0.5; reset(); pcm.enableCompressorDigital(); @@ -96,7 +96,7 @@ public class PCMTest extends AbstractComsSetup { /** Test if the correct solenoids turn on and off when they should. */ @Test - public void testSolenoid() throws Exception { + public void testSolenoid() { reset(); Solenoid solenoid1 = new Solenoid(PneumaticsModuleType.CTREPCM, 0); @@ -174,7 +174,7 @@ public class PCMTest extends AbstractComsSetup { /** Test if the correct solenoids turn on and off when they should. */ @Test - public void testOneShot() throws Exception { + public void testOneShot() { reset(); Solenoid solenoid1 = new Solenoid(PneumaticsModuleType.CTREPCM, 0);