Don't force public variables to use Hungarian notation (#8774)

People generally have expressed a dislike for the Hungarian notation
used in member variables, especially in examples/templates, and our
styleguide shouldn't be forced on downstream consumers, so this removes
all Hungarian notation from the examples/templates.

There are _some_ benefits to Hungarian for private member variables
(like knowing what's a member vs. local in a PR review) so we'll keep
private member variables the same for now, but public variables should
no longer use Hungarian notation, since it looks much worse. A new PMD
XPath rule has been added to accomplish this goal. Some other
non-compliant variables were fixed for the new rule.
This commit is contained in:
Gold856
2026-04-25 14:32:08 -04:00
committed by GitHub
parent e7e51c9c05
commit 35e8abedeb
443 changed files with 4584 additions and 4789 deletions

View File

@@ -57,7 +57,6 @@ public class ADXL345_I2C implements NTSendable, AutoCloseable {
}
/** Container type for accelerations from all axes. */
@SuppressWarnings("MemberName")
public static class AllAxes {
/** Acceleration along the X axis in g-forces. */
public double x;

View File

@@ -13,7 +13,7 @@ import org.wpilib.system.Timer;
/** This class controls a REV ExpansionHub plugged in over USB to Systemcore. */
public class ExpansionHub implements AutoCloseable {
private static class DataStore implements AutoCloseable {
public final int m_usbId;
private final int m_usbId;
private int m_refCount;
private int m_reservedMotorMask;
private int m_reservedServoMask;

View File

@@ -17,13 +17,13 @@ import org.wpilib.system.SensorUtil;
/** Module class for controlling a REV Robotics Pneumatic Hub. */
public class PneumaticHub implements PneumaticsBase {
private static class DataStore implements AutoCloseable {
public final int m_module;
public final int m_handle;
private final int m_module;
private final int m_handle;
private final int m_busId;
private int m_refCount;
private int m_reservedMask;
private boolean m_compressorReserved;
public final int[] m_oneShotDurMs = new int[PortsJNI.getNumREVPHChannels()];
private final int[] m_oneShotDurMs = new int[PortsJNI.getNumREVPHChannels()];
private final Object m_reserveLock = new Object();
DataStore(int busId, int module) {

View File

@@ -14,8 +14,8 @@ import org.wpilib.system.SensorUtil;
/** Module class for controlling a Cross The Road Electronics Pneumatics Control Module. */
public class PneumaticsControlModule implements PneumaticsBase {
private static class DataStore implements AutoCloseable {
public final int m_module;
public final int m_handle;
private final int m_module;
private final int m_handle;
private final int m_busId;
private int m_refCount;
private int m_reservedMask;