[build] Upgrade Gradle plugins (#8166)

I upgraded all plugins I could see except org.ysb33r.doxygen. 2.0 made
breaking changes, and I couldn't figure out how to migrate.

Most of the changes are for suppressing new linter purification rites.
This commit is contained in:
Tyler Veness
2025-08-08 23:04:02 -07:00
committed by GitHub
parent 5fd9e1e72a
commit 9ac7e286f5
147 changed files with 289 additions and 243 deletions

View File

@@ -29,7 +29,7 @@ import edu.wpi.first.util.sendable.SendableBuilder;
// CHECKSTYLE.OFF: EmptyCatchBlock
/** This class is for the ADIS16448 IMU that connects to the RoboRIO MXP port. */
@SuppressWarnings({"PMD.RedundantFieldInitializer", "PMD.ImmutableField"})
@SuppressWarnings({"PMD.RedundantFieldInitializer", "PMD.ImmutableField", "PMD.UnusedPrivateField"})
public class ADIS16448_IMU implements AutoCloseable, Sendable {
// ADIS16448 Register Map Declaration
private static final int FLASH_CNT = 0x00; // Flash memory write count

View File

@@ -20,7 +20,7 @@ import edu.wpi.first.util.sendable.SendableBuilder;
// CHECKSTYLE.OFF: EmptyCatchBlock
/** This class is for the ADIS16470 IMU that connects to the RoboRIO SPI port. */
@SuppressWarnings("PMD.RedundantFieldInitializer")
@SuppressWarnings({"PMD.RedundantFieldInitializer", "PMD.UnusedPrivateField"})
public class ADIS16470_IMU implements AutoCloseable, Sendable {
/* ADIS16470 Register Map Declaration */
private static final int FLASH_CNT = 0x00; // Flash memory write count

View File

@@ -8,6 +8,7 @@ import edu.wpi.first.util.sendable.Sendable;
import edu.wpi.first.util.sendable.SendableBuilder;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import java.util.Comparator;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
@@ -186,7 +187,7 @@ public class Alert implements AutoCloseable {
private static final class SendableAlerts implements Sendable {
private static final Map<String, SendableAlerts> groups = new HashMap<String, SendableAlerts>();
private final Map<AlertType, Set<PublishedAlert>> m_alerts = new HashMap<>();
private final EnumMap<AlertType, Set<PublishedAlert>> m_alerts = new EnumMap<>(AlertType.class);
/**
* Returns a reference to the set of active alerts for the given type.

View File

@@ -38,11 +38,10 @@ public class DigitalGlitchFilter implements Sendable, AutoCloseable {
m_mutex.lock();
try {
m_filterAllocated[m_channelIndex] = false;
m_channelIndex = -1;
} finally {
m_mutex.unlock();
}
m_channelIndex = -1;
}
}

View File

@@ -285,7 +285,6 @@ public final class DriverStation {
System.arraycopy(axes.m_axes, 0, m_prevAxes.m_axes, 0, count);
}
@SuppressWarnings("PMD.AvoidArrayLoops")
void appendPOVs(HALJoystickPOVs povs, long timestamp) {
int count = povs.m_count;
if (m_sizedPOVs == null || m_sizedPOVs.length != count) {

View File

@@ -70,7 +70,6 @@ public class GenericHID {
/** HIDType value. */
public final int value;
@SuppressWarnings("PMD.UseConcurrentHashMap")
private static final Map<Integer, HIDType> map = new HashMap<>();
HIDType(int value) {

View File

@@ -40,6 +40,7 @@ public class I2C implements AutoCloseable {
private final int m_port;
private final int m_deviceAddress;
private ByteBuffer m_readDataToSendBuffer;
/**
* Constructor.
@@ -265,8 +266,6 @@ public class I2C implements AutoCloseable {
return transaction(registerAddressArray, registerAddressArray.length, buffer, count);
}
private ByteBuffer m_readDataToSendBuffer;
/**
* Execute a read transaction with the device.
*

View File

@@ -96,29 +96,36 @@ public abstract class RobotBase implements AutoCloseable {
@Override
public void reportUsage(MathUsageId id, int count) {
switch (id) {
case kKinematics_DifferentialDrive -> HAL.report(
tResourceType.kResourceType_Kinematics, tInstances.kKinematics_DifferentialDrive);
case kKinematics_MecanumDrive -> HAL.report(
tResourceType.kResourceType_Kinematics, tInstances.kKinematics_MecanumDrive);
case kKinematics_SwerveDrive -> HAL.report(
tResourceType.kResourceType_Kinematics, tInstances.kKinematics_SwerveDrive);
case kTrajectory_TrapezoidProfile -> HAL.report(
tResourceType.kResourceType_TrapezoidProfile, count);
case kKinematics_DifferentialDrive ->
HAL.report(
tResourceType.kResourceType_Kinematics,
tInstances.kKinematics_DifferentialDrive);
case kKinematics_MecanumDrive ->
HAL.report(
tResourceType.kResourceType_Kinematics, tInstances.kKinematics_MecanumDrive);
case kKinematics_SwerveDrive ->
HAL.report(
tResourceType.kResourceType_Kinematics, tInstances.kKinematics_SwerveDrive);
case kTrajectory_TrapezoidProfile ->
HAL.report(tResourceType.kResourceType_TrapezoidProfile, count);
case kFilter_Linear -> HAL.report(tResourceType.kResourceType_LinearFilter, count);
case kOdometry_DifferentialDrive -> HAL.report(
tResourceType.kResourceType_Odometry, tInstances.kOdometry_DifferentialDrive);
case kOdometry_SwerveDrive -> HAL.report(
tResourceType.kResourceType_Odometry, tInstances.kOdometry_SwerveDrive);
case kOdometry_MecanumDrive -> HAL.report(
tResourceType.kResourceType_Odometry, tInstances.kOdometry_MecanumDrive);
case kController_PIDController2 -> HAL.report(
tResourceType.kResourceType_PIDController2, count);
case kController_ProfiledPIDController -> HAL.report(
tResourceType.kResourceType_ProfiledPIDController, count);
case kController_BangBangController -> HAL.report(
tResourceType.kResourceType_BangBangController, count);
case kTrajectory_PathWeaver -> HAL.report(
tResourceType.kResourceType_PathWeaverTrajectory, count);
case kOdometry_DifferentialDrive ->
HAL.report(
tResourceType.kResourceType_Odometry, tInstances.kOdometry_DifferentialDrive);
case kOdometry_SwerveDrive ->
HAL.report(
tResourceType.kResourceType_Odometry, tInstances.kOdometry_SwerveDrive);
case kOdometry_MecanumDrive ->
HAL.report(
tResourceType.kResourceType_Odometry, tInstances.kOdometry_MecanumDrive);
case kController_PIDController2 ->
HAL.report(tResourceType.kResourceType_PIDController2, count);
case kController_ProfiledPIDController ->
HAL.report(tResourceType.kResourceType_ProfiledPIDController, count);
case kController_BangBangController ->
HAL.report(tResourceType.kResourceType_BangBangController, count);
case kTrajectory_PathWeaver ->
HAL.report(tResourceType.kResourceType_PathWeaverTrajectory, count);
default -> {
// NOP
}

View File

@@ -16,7 +16,6 @@ import edu.wpi.first.hal.InterruptJNI;
* <p>Asynchronous interrupts are handled by the AsynchronousInterrupt class.
*/
public class SynchronousInterrupt implements AutoCloseable {
@SuppressWarnings("PMD.SingularField")
private final DigitalSource m_source;
private final int m_handle;

View File

@@ -44,7 +44,6 @@ public class Ultrasonic implements Sendable, AutoCloseable {
private static Thread m_task;
private static int m_instances;
@SuppressWarnings("PMD.SingularField")
private SimDevice m_simDevice;
private SimBoolean m_simRangeValid;

View File

@@ -10,6 +10,7 @@ package edu.wpi.first.wpilibj.shuffleboard;
*
* @see BuiltInWidgets the built-in widget types
*/
@SuppressWarnings("PMD.ImplicitFunctionalInterface")
public interface LayoutType {
/**
* Gets the string type of the layout as defined by that layout in Shuffleboard.

View File

@@ -10,6 +10,7 @@ package edu.wpi.first.wpilibj.shuffleboard;
*
* @see BuiltInWidgets the built-in widget types
*/
@SuppressWarnings("PMD.ImplicitFunctionalInterface")
public interface WidgetType {
/**
* Gets the string type of the widget as defined by that widget in Shuffleboard.

View File

@@ -7,16 +7,19 @@ package edu.wpi.first.wpilibj.simulation;
/** Manages simulation callbacks; each object is associated with a callback. */
public class CallbackStore implements AutoCloseable {
/** <b>Note: This interface is for simulation classes only. It should not be used by teams!</b> */
@SuppressWarnings("PMD.ImplicitFunctionalInterface")
interface CancelCallbackFunc {
void cancel(int index, int uid);
}
/** <b>Note: This interface is for simulation classes only. It should not be used by teams!</b> */
@SuppressWarnings("PMD.ImplicitFunctionalInterface")
interface CancelCallbackChannelFunc {
void cancel(int index, int channel, int uid);
}
/** <b>Note: This interface is for simulation classes only. It should not be used by teams!</b> */
@SuppressWarnings("PMD.ImplicitFunctionalInterface")
interface CancelCallbackNoIndexFunc {
void cancel(int uid);
}

View File

@@ -58,7 +58,6 @@ import java.util.function.LongSupplier;
import java.util.function.Supplier;
/** Implementation detail for SendableBuilder. */
@SuppressWarnings("PMD.CompareObjectsWithEquals")
public class SendableBuilderImpl implements NTSendableBuilder {
@FunctionalInterface
private interface TimedConsumer<T> {

View File

@@ -30,7 +30,6 @@ public final class SmartDashboard {
/**
* A table linking tables in the SmartDashboard to the {@link Sendable} objects they came from.
*/
@SuppressWarnings("PMD.UseConcurrentHashMap")
private static final Map<String, Sendable> tablesToData = new HashMap<>();
/** The executor for listener tasks; calls listener tasks synchronously from main thread. */