Merge branch 'main' into 2027

This commit is contained in:
Peter Johnson
2025-08-09 00:00:53 -07:00
133 changed files with 304 additions and 279 deletions

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

@@ -359,7 +359,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

@@ -71,7 +71,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

@@ -35,6 +35,7 @@ public class I2C implements AutoCloseable {
private final int m_port;
private final int m_deviceAddress;
private ByteBuffer m_readDataToSendBuffer;
/**
* Constructor.
@@ -254,8 +255,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

@@ -27,7 +27,6 @@ public class AddressableLEDSim {
*
* @param addressableLED AddressableLED to simulate
*/
@SuppressWarnings("PMD.UnusedFormalParameter")
public AddressableLEDSim(AddressableLED addressableLED) {
m_channel = addressableLED.getChannel();
}

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

@@ -28,7 +28,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. */