From 6e1919414e2bd34d8babfec2aada6a3dcdfc864a Mon Sep 17 00:00:00 2001
From: Austin Shalit
Date: Tue, 29 Dec 2020 09:27:48 -0800
Subject: [PATCH] [build] Bring naming checkstyle rules up to date with Google
Style guide (#1781)
Also update Checkstyle to 8.38.
Google changed their style guide from the last time we imported it. This PR brings in those naming changes. The change they made is allowing single letter member, parameter, and local variable names. They also added a lambda naming scheme and I thought it would be good to bring that in too.
---
.../wpi/first/cameraserver/CameraServer.java | 25 ++--
.../java/edu/wpi/cscore/CameraServerJNI.java | 1 -
.../main/java/edu/wpi/cscore/HttpCamera.java | 1 -
.../main/java/edu/wpi/cscore/VideoEvent.java | 1 -
.../main/java/edu/wpi/cscore/VideoMode.java | 1 -
.../java/edu/wpi/cscore/VideoProperty.java | 1 -
.../main/java/edu/wpi/cscore/VideoSink.java | 1 -
.../main/java/edu/wpi/cscore/VideoSource.java | 2 -
hal/src/main/java/edu/wpi/first/hal/HAL.java | 10 +-
.../java/edu/wpi/first/hal/MatchInfoData.java | 2 +-
.../first/hal/can/CANExceptionFactory.java | 2 +-
.../java/edu/wpi/first/hal/can/CANStatus.java | 2 +-
.../first/networktables/NetworkTableType.java | 1 -
shared/java/javastyle.gradle | 2 +-
styleguide/checkstyle.xml | 109 ++++++++++--------
styleguide/suppressions.xml | 4 +-
.../wpi/first/wpilibj/buttons/Trigger.java | 1 -
.../wpi/first/wpilibj/command/PIDCommand.java | 8 --
.../first/wpilibj/command/PIDSubsystem.java | 8 --
.../shuffleboard/ShuffleboardTabTest.java | 4 +-
.../edu/wpi/first/wpilibj/ADXL345_SPI.java | 1 -
.../java/edu/wpi/first/wpilibj/ADXL362.java | 1 -
.../first/wpilibj/AnalogTriggerOutput.java | 1 -
.../edu/wpi/first/wpilibj/CameraServer.java | 20 ++--
.../java/edu/wpi/first/wpilibj/Counter.java | 1 -
.../edu/wpi/first/wpilibj/CounterBase.java | 1 -
.../java/edu/wpi/first/wpilibj/Encoder.java | 3 -
.../edu/wpi/first/wpilibj/Filesystem.java | 2 +-
.../edu/wpi/first/wpilibj/GenericHID.java | 2 -
.../main/java/edu/wpi/first/wpilibj/I2C.java | 1 -
.../wpilibj/InterruptableSensorBase.java | 3 +-
.../java/edu/wpi/first/wpilibj/Joystick.java | 4 -
.../edu/wpi/first/wpilibj/PIDInterface.java | 1 -
.../java/edu/wpi/first/wpilibj/RobotBase.java | 2 +-
.../edu/wpi/first/wpilibj/RobotDrive.java | 23 ++--
.../edu/wpi/first/wpilibj/RobotState.java | 2 +-
.../main/java/edu/wpi/first/wpilibj/SPI.java | 1 -
.../edu/wpi/first/wpilibj/SensorUtil.java | 54 ++++-----
.../edu/wpi/first/wpilibj/SerialPort.java | 5 -
.../java/edu/wpi/first/wpilibj/Timer.java | 2 +-
.../wpilibj/controller/PIDController.java | 87 +++++++-------
.../first/wpilibj/drive/RobotDriveBase.java | 1 -
.../edu/wpi/first/wpilibj/drive/Vector2d.java | 4 +-
.../first/wpilibj/examples/gyro/Robot.java | 2 +-
.../mecanumcontrollercommand/Constants.java | 8 +-
.../romireference/RobotContainer.java | 4 +-
.../examples/swervebot/SwerveModule.java | 3 +-
.../swervecontrollercommand/Constants.java | 8 +-
.../SwerveModule.java | 3 +-
.../wpilibj/examples/ultrasonic/Robot.java | 2 +-
.../wpilibj/examples/ultrasonicpid/Robot.java | 2 +-
.../java/edu/wpi/first/wpilibj/MockDS.java | 4 +-
.../java/edu/wpi/first/wpilibj/PDPTest.java | 2 +-
.../java/edu/wpi/first/wpilibj/PIDTest.java | 2 +-
.../edu/wpi/first/wpilibj/test/TestBench.java | 4 +-
.../wpilibj/estimator/AngleStatistics.java | 6 +-
.../DifferentialDrivePoseEstimator.java | 2 +-
.../estimator/MecanumDrivePoseEstimator.java | 6 +-
.../estimator/SwerveDrivePoseEstimator.java | 6 +-
.../estimator/UnscentedKalmanFilter.java | 4 +-
.../wpi/first/wpilibj/geometry/Pose2d.java | 2 -
.../first/wpilibj/geometry/Rotation2d.java | 1 -
.../wpilibj/spline/CubicHermiteSpline.java | 2 +-
.../wpilibj/spline/QuinticHermiteSpline.java | 2 +-
.../wpilibj/system/NumericalJacobian.java | 4 +-
.../wpilibj/trajectory/TrapezoidProfile.java | 2 -
.../wpi/first/wpilibj/LinearFilterTest.java | 2 -
.../kinematics/SwerveDriveKinematicsTest.java | 2 +-
.../kinematics/SwerveDriveOdometryTest.java | 4 +-
.../edu/wpi/first/wpiutil/RuntimeLoader.java | 12 +-
70 files changed, 224 insertions(+), 285 deletions(-)
diff --git a/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServer.java b/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServer.java
index 5be2c89a5d..a613187c11 100644
--- a/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServer.java
+++ b/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServer.java
@@ -70,7 +70,7 @@ public final class CameraServer {
private int m_nextPort;
private String[] m_addresses;
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
private static String makeSourceValue(int source) {
switch (VideoSource.getKindFromInt(CameraServerJNI.getSourceKind(source))) {
case kUsb:
@@ -90,15 +90,16 @@ public final class CameraServer {
}
}
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
private static String makeStreamValue(String address, int port) {
return "mjpg:http://" + address + ":" + port + "/?action=stream";
}
- @SuppressWarnings({"JavadocMethod", "PMD.AvoidUsingHardCodedIP"})
+ @SuppressWarnings({"MissingJavadocMethod", "PMD.AvoidUsingHardCodedIP"})
private synchronized String[] getSinkStreamValues(int sink) {
// Ignore all but MjpegServer
- if (VideoSink.getKindFromInt(CameraServerJNI.getSinkKind(sink)) != VideoSink.Kind.kMjpeg) {
+ if (VideoSink.getKindFromInt(CameraServerJNI.getSinkKind(sink))
+ != VideoSink.Kind.kMjpeg) {
return new String[0];
}
@@ -125,7 +126,7 @@ public final class CameraServer {
return values.toArray(new String[0]);
}
- @SuppressWarnings({"JavadocMethod", "PMD.AvoidUsingHardCodedIP"})
+ @SuppressWarnings({"MissingJavadocMethod", "PMD.AvoidUsingHardCodedIP"})
private synchronized String[] getSourceStreamValues(int source) {
// Ignore all but HttpCamera
if (VideoSource.getKindFromInt(CameraServerJNI.getSourceKind(source))
@@ -160,7 +161,9 @@ public final class CameraServer {
return values;
}
- @SuppressWarnings({"JavadocMethod", "PMD.AvoidUsingHardCodedIP", "PMD.CyclomaticComplexity"})
+ @SuppressWarnings({"MissingJavadocMethod",
+ "PMD.AvoidUsingHardCodedIP",
+ "PMD.CyclomaticComplexity"})
private synchronized void updateStreamValues() {
// Over all the sinks...
for (VideoSink i : m_sinks.values()) {
@@ -205,7 +208,7 @@ public final class CameraServer {
}
}
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
private static String pixelFormatToString(PixelFormat pixelFormat) {
switch (pixelFormat) {
case kMJPEG:
@@ -225,13 +228,13 @@ public final class CameraServer {
/// Provide string description of video mode.
/// The returned string is "{width}x{height} {format} {fps} fps".
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
private static String videoModeToString(VideoMode mode) {
return mode.width + "x" + mode.height + " " + pixelFormatToString(mode.pixelFormat)
+ " " + mode.fps + " fps";
}
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
private static String[] getSourceModeValues(int sourceHandle) {
VideoMode[] modes = CameraServerJNI.enumerateSourceVideoModes(sourceHandle);
String[] modeStrings = new String[modes.length];
@@ -241,7 +244,7 @@ public final class CameraServer {
return modeStrings;
}
- @SuppressWarnings({"JavadocMethod", "PMD.CyclomaticComplexity"})
+ @SuppressWarnings({"MissingJavadocMethod", "PMD.CyclomaticComplexity"})
private static void putSourcePropertyValue(NetworkTable table, VideoEvent event, boolean isNew) {
String name;
String infoName;
@@ -294,7 +297,7 @@ public final class CameraServer {
}
}
- @SuppressWarnings({"JavadocMethod", "PMD.UnusedLocalVariable", "PMD.ExcessiveMethodLength",
+ @SuppressWarnings({"MissingJavadocMethod", "PMD.UnusedLocalVariable", "PMD.ExcessiveMethodLength",
"PMD.NPathComplexity"})
private CameraServer() {
m_defaultUsbDevice = new AtomicInteger();
diff --git a/cscore/src/main/java/edu/wpi/cscore/CameraServerJNI.java b/cscore/src/main/java/edu/wpi/cscore/CameraServerJNI.java
index 898883b4b5..abb87bfb0b 100644
--- a/cscore/src/main/java/edu/wpi/cscore/CameraServerJNI.java
+++ b/cscore/src/main/java/edu/wpi/cscore/CameraServerJNI.java
@@ -203,7 +203,6 @@ public class CameraServerJNI {
kSourceBytesReceived(1),
kSourceFramesReceived(2);
- @SuppressWarnings("MemberName")
private final int value;
TelemetryKind(int value) {
diff --git a/cscore/src/main/java/edu/wpi/cscore/HttpCamera.java b/cscore/src/main/java/edu/wpi/cscore/HttpCamera.java
index 9ca7709093..a4ffc27a29 100644
--- a/cscore/src/main/java/edu/wpi/cscore/HttpCamera.java
+++ b/cscore/src/main/java/edu/wpi/cscore/HttpCamera.java
@@ -11,7 +11,6 @@ public class HttpCamera extends VideoCamera {
public enum HttpCameraKind {
kUnknown(0), kMJPGStreamer(1), kCSCore(2), kAxis(3);
- @SuppressWarnings("MemberName")
private final int value;
HttpCameraKind(int value) {
diff --git a/cscore/src/main/java/edu/wpi/cscore/VideoEvent.java b/cscore/src/main/java/edu/wpi/cscore/VideoEvent.java
index 7d5bab75a6..9e634183df 100644
--- a/cscore/src/main/java/edu/wpi/cscore/VideoEvent.java
+++ b/cscore/src/main/java/edu/wpi/cscore/VideoEvent.java
@@ -30,7 +30,6 @@ public class VideoEvent {
kSinkPropertyValueUpdated(0x20000),
kSinkPropertyChoicesUpdated(0x40000);
- @SuppressWarnings("MemberName")
private final int value;
Kind(int value) {
diff --git a/cscore/src/main/java/edu/wpi/cscore/VideoMode.java b/cscore/src/main/java/edu/wpi/cscore/VideoMode.java
index 125f7fe1a8..35fa14828f 100644
--- a/cscore/src/main/java/edu/wpi/cscore/VideoMode.java
+++ b/cscore/src/main/java/edu/wpi/cscore/VideoMode.java
@@ -11,7 +11,6 @@ public class VideoMode {
public enum PixelFormat {
kUnknown(0), kMJPEG(1), kYUYV(2), kRGB565(3), kBGR(4), kGray(5);
- @SuppressWarnings("MemberName")
private final int value;
PixelFormat(int value) {
diff --git a/cscore/src/main/java/edu/wpi/cscore/VideoProperty.java b/cscore/src/main/java/edu/wpi/cscore/VideoProperty.java
index 05726a87d8..2fdf99d1d9 100644
--- a/cscore/src/main/java/edu/wpi/cscore/VideoProperty.java
+++ b/cscore/src/main/java/edu/wpi/cscore/VideoProperty.java
@@ -11,7 +11,6 @@ public class VideoProperty {
public enum Kind {
kNone(0), kBoolean(1), kInteger(2), kString(4), kEnum(8);
- @SuppressWarnings("MemberName")
private final int value;
Kind(int value) {
diff --git a/cscore/src/main/java/edu/wpi/cscore/VideoSink.java b/cscore/src/main/java/edu/wpi/cscore/VideoSink.java
index aeb0ae6df5..149bfb7fbf 100644
--- a/cscore/src/main/java/edu/wpi/cscore/VideoSink.java
+++ b/cscore/src/main/java/edu/wpi/cscore/VideoSink.java
@@ -13,7 +13,6 @@ public class VideoSink implements AutoCloseable {
public enum Kind {
kUnknown(0), kMjpeg(2), kCv(4), kRaw(8);
- @SuppressWarnings("MemberName")
private final int value;
Kind(int value) {
diff --git a/cscore/src/main/java/edu/wpi/cscore/VideoSource.java b/cscore/src/main/java/edu/wpi/cscore/VideoSource.java
index 5831805caa..0df9cdf6e9 100644
--- a/cscore/src/main/java/edu/wpi/cscore/VideoSource.java
+++ b/cscore/src/main/java/edu/wpi/cscore/VideoSource.java
@@ -13,7 +13,6 @@ public class VideoSource implements AutoCloseable {
public enum Kind {
kUnknown(0), kUsb(1), kHttp(2), kCv(4), kRaw(8);
- @SuppressWarnings("MemberName")
private final int value;
Kind(int value) {
@@ -47,7 +46,6 @@ public class VideoSource implements AutoCloseable {
*/
kForceClose(2);
- @SuppressWarnings("MemberName")
private final int value;
ConnectionStrategy(int value) {
diff --git a/hal/src/main/java/edu/wpi/first/hal/HAL.java b/hal/src/main/java/edu/wpi/first/hal/HAL.java
index 879052dfe4..29f876d232 100644
--- a/hal/src/main/java/edu/wpi/first/hal/HAL.java
+++ b/hal/src/main/java/edu/wpi/first/hal/HAL.java
@@ -95,7 +95,7 @@ public final class HAL extends JNIWrapper {
public static native int nativeGetControlWord();
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
public static void getControlWord(ControlWord controlWord) {
int word = nativeGetControlWord();
controlWord.update((word & 1) != 0, ((word >> 1) & 1) != 0, ((word >> 2) & 1) != 0,
@@ -104,7 +104,7 @@ public final class HAL extends JNIWrapper {
private static native int nativeGetAllianceStation();
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
public static AllianceStationID getAllianceStation() {
switch (nativeGetAllianceStation()) {
case 0:
@@ -124,13 +124,13 @@ public final class HAL extends JNIWrapper {
}
}
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
public static native boolean isNewControlData();
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
public static native void releaseDSMutex();
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
public static native boolean waitForDSDataTimeout(double timeout);
public static int kMaxJoystickAxes = 12;
diff --git a/hal/src/main/java/edu/wpi/first/hal/MatchInfoData.java b/hal/src/main/java/edu/wpi/first/hal/MatchInfoData.java
index 6f476b6ef6..53600b5747 100644
--- a/hal/src/main/java/edu/wpi/first/hal/MatchInfoData.java
+++ b/hal/src/main/java/edu/wpi/first/hal/MatchInfoData.java
@@ -41,7 +41,7 @@ public class MatchInfoData {
/**
* Called from JNI to set the structure data.
*/
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
public void setData(String eventName, String gameSpecificMessage,
int matchNumber, int replayNumber, int matchType) {
this.eventName = eventName;
diff --git a/hal/src/main/java/edu/wpi/first/hal/can/CANExceptionFactory.java b/hal/src/main/java/edu/wpi/first/hal/can/CANExceptionFactory.java
index 04c03bd25a..7a8aadd4e8 100644
--- a/hal/src/main/java/edu/wpi/first/hal/can/CANExceptionFactory.java
+++ b/hal/src/main/java/edu/wpi/first/hal/can/CANExceptionFactory.java
@@ -14,7 +14,7 @@ public final class CANExceptionFactory {
static final int ERR_CANSessionMux_NotAllowed = -44088;
static final int ERR_CANSessionMux_NotInitialized = -44089;
- @SuppressWarnings({"JavadocMethod", "PMD.CyclomaticComplexity"})
+ @SuppressWarnings({"MissingJavadocMethod", "PMD.CyclomaticComplexity"})
public static void checkStatus(int status, int messageID) throws CANInvalidBufferException,
CANMessageNotAllowedException, CANNotInitializedException, UncleanStatusException {
switch (status) {
diff --git a/hal/src/main/java/edu/wpi/first/hal/can/CANStatus.java b/hal/src/main/java/edu/wpi/first/hal/can/CANStatus.java
index 20f6ef9ddf..448b08d952 100644
--- a/hal/src/main/java/edu/wpi/first/hal/can/CANStatus.java
+++ b/hal/src/main/java/edu/wpi/first/hal/can/CANStatus.java
@@ -38,7 +38,7 @@ public class CANStatus {
@SuppressWarnings("MemberName")
public int transmitErrorCount;
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
public void setStatus(double percentBusUtilization, int busOffCount, int txFullCount,
int receiveErrorCount, int transmitErrorCount) {
this.percentBusUtilization = percentBusUtilization;
diff --git a/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTableType.java b/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTableType.java
index 58a6a9bf91..4c85fad50b 100644
--- a/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTableType.java
+++ b/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTableType.java
@@ -18,7 +18,6 @@ public enum NetworkTableType {
kStringArray(0x40),
kRpc(0x80);
- @SuppressWarnings("MemberName")
private final int value;
NetworkTableType(int value) {
diff --git a/shared/java/javastyle.gradle b/shared/java/javastyle.gradle
index ecd551bb27..17057cea5c 100644
--- a/shared/java/javastyle.gradle
+++ b/shared/java/javastyle.gradle
@@ -2,7 +2,7 @@
apply plugin: 'checkstyle'
checkstyle {
- toolVersion = "8.12"
+ toolVersion = "8.38"
configDirectory = file("${project.rootDir}/styleguide")
config = resources.text.fromFile(new File(configDirectory.get().getAsFile(), "checkstyle.xml"))
}
diff --git a/styleguide/checkstyle.xml b/styleguide/checkstyle.xml
index eeeaf08e18..5c1d2d207c 100644
--- a/styleguide/checkstyle.xml
+++ b/styleguide/checkstyle.xml
@@ -30,10 +30,12 @@ module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
-
-
+
+
+
+
+
@@ -79,12 +81,6 @@ module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
-
-
-
-
@@ -107,13 +103,33 @@ module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH" />
-
-
-
-
+
+ value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF,
+ INTERFACE_DEF, LAMBDA, LITERAL_CASE, LITERAL_CATCH, LITERAL_DEFAULT,
+ LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF,
+ LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF,
+ OBJBLOCK, STATIC_INIT, RECORD_DEF, COMPACT_CTOR_DEF"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ value="^(m_[a-z]([a-zA-Z0-9]*)|value)$" />
+ value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
+
+
+
+
+ value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
@@ -190,7 +211,7 @@ module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
+ value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
-
-
-
-
-
-
+
+
+
+
+
+
+ value="4" />
@@ -280,24 +295,18 @@ module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF" />
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ checks="MissingJavadocMethod" />
+
diff --git a/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/buttons/Trigger.java b/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/buttons/Trigger.java
index 0ffa7dff10..bc56895d58 100644
--- a/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/buttons/Trigger.java
+++ b/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/buttons/Trigger.java
@@ -37,7 +37,6 @@ public abstract class Trigger implements Sendable {
*
* @return whether get() return true or the internal table for SmartDashboard use is pressed.
*/
- @SuppressWarnings("PMD.UselessParentheses")
private boolean grab() {
return get() || m_sendablePressed;
}
diff --git a/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/command/PIDCommand.java b/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/command/PIDCommand.java
index 1ab4463da3..1b55003cc5 100644
--- a/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/command/PIDCommand.java
+++ b/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/command/PIDCommand.java
@@ -53,7 +53,6 @@ public abstract class PIDCommand extends Command {
* @param i the integral value
* @param d the derivative value
*/
- @SuppressWarnings("ParameterName")
public PIDCommand(String name, double p, double i, double d) {
super(name);
m_controller = new PIDController(p, i, d, m_source, m_output);
@@ -69,7 +68,6 @@ public abstract class PIDCommand extends Command {
* @param d the derivative value
* @param period the time (in seconds) between calculations
*/
- @SuppressWarnings("ParameterName")
public PIDCommand(String name, double p, double i, double d, double period) {
super(name);
m_controller = new PIDController(p, i, d, m_source, m_output, period);
@@ -83,7 +81,6 @@ public abstract class PIDCommand extends Command {
* @param i the integral value
* @param d the derivative value
*/
- @SuppressWarnings("ParameterName")
public PIDCommand(double p, double i, double d) {
m_controller = new PIDController(p, i, d, m_source, m_output);
}
@@ -98,7 +95,6 @@ public abstract class PIDCommand extends Command {
* @param d the derivative value
* @param period the time (in seconds) between calculations
*/
- @SuppressWarnings("ParameterName")
public PIDCommand(double p, double i, double d, double period) {
m_controller = new PIDController(p, i, d, m_source, m_output, period);
}
@@ -112,7 +108,6 @@ public abstract class PIDCommand extends Command {
* @param d the derivative value
* @param subsystem the subsystem that this command requires
*/
- @SuppressWarnings("ParameterName")
public PIDCommand(String name, double p, double i, double d, Subsystem subsystem) {
super(name, subsystem);
m_controller = new PIDController(p, i, d, m_source, m_output);
@@ -129,7 +124,6 @@ public abstract class PIDCommand extends Command {
* @param period the time (in seconds) between calculations
* @param subsystem the subsystem that this command requires
*/
- @SuppressWarnings("ParameterName")
public PIDCommand(String name, double p, double i, double d, double period,
Subsystem subsystem) {
super(name, subsystem);
@@ -145,7 +139,6 @@ public abstract class PIDCommand extends Command {
* @param d the derivative value
* @param subsystem the subsystem that this command requires
*/
- @SuppressWarnings("ParameterName")
public PIDCommand(double p, double i, double d, Subsystem subsystem) {
super(subsystem);
m_controller = new PIDController(p, i, d, m_source, m_output);
@@ -162,7 +155,6 @@ public abstract class PIDCommand extends Command {
* @param period the time (in seconds) between calculations
* @param subsystem the subsystem that this command requires
*/
- @SuppressWarnings("ParameterName")
public PIDCommand(double p, double i, double d, double period, Subsystem subsystem) {
super(subsystem);
m_controller = new PIDController(p, i, d, m_source, m_output, period);
diff --git a/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/command/PIDSubsystem.java b/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/command/PIDSubsystem.java
index febf7ae8a7..4bce91df25 100644
--- a/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/command/PIDSubsystem.java
+++ b/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/command/PIDSubsystem.java
@@ -55,7 +55,6 @@ public abstract class PIDSubsystem extends Subsystem {
* @param i the integral value
* @param d the derivative value
*/
- @SuppressWarnings("ParameterName")
public PIDSubsystem(String name, double p, double i, double d) {
super(name);
m_controller = new PIDController(p, i, d, m_source, m_output);
@@ -71,7 +70,6 @@ public abstract class PIDSubsystem extends Subsystem {
* @param d the derivative value
* @param f the feed forward value
*/
- @SuppressWarnings("ParameterName")
public PIDSubsystem(String name, double p, double i, double d, double f) {
super(name);
m_controller = new PIDController(p, i, d, f, m_source, m_output);
@@ -89,7 +87,6 @@ public abstract class PIDSubsystem extends Subsystem {
* @param f the feed forward value
* @param period the time (in seconds) between calculations
*/
- @SuppressWarnings("ParameterName")
public PIDSubsystem(String name, double p, double i, double d, double f, double period) {
super(name);
m_controller = new PIDController(p, i, d, f, m_source, m_output, period);
@@ -104,7 +101,6 @@ public abstract class PIDSubsystem extends Subsystem {
* @param i the integral value
* @param d the derivative value
*/
- @SuppressWarnings("ParameterName")
public PIDSubsystem(double p, double i, double d) {
m_controller = new PIDController(p, i, d, m_source, m_output);
addChild("PIDController", m_controller);
@@ -121,7 +117,6 @@ public abstract class PIDSubsystem extends Subsystem {
* @param f the feed forward coefficient
* @param period the time (in seconds) between calculations
*/
- @SuppressWarnings("ParameterName")
public PIDSubsystem(double p, double i, double d, double f, double period) {
m_controller = new PIDController(p, i, d, f, m_source, m_output, period);
addChild("PIDController", m_controller);
@@ -137,7 +132,6 @@ public abstract class PIDSubsystem extends Subsystem {
* @param d the derivative value
* @param period the time (in seconds) between calculations
*/
- @SuppressWarnings("ParameterName")
public PIDSubsystem(double p, double i, double d, double period) {
m_controller = new PIDController(p, i, d, m_source, m_output, period);
addChild("PIDController", m_controller);
@@ -219,7 +213,6 @@ public abstract class PIDSubsystem extends Subsystem {
*
* @param t the absolute tolerance
*/
- @SuppressWarnings("ParameterName")
public void setAbsoluteTolerance(double t) {
m_controller.setAbsoluteTolerance(t);
}
@@ -230,7 +223,6 @@ public abstract class PIDSubsystem extends Subsystem {
*
* @param p the percent tolerance
*/
- @SuppressWarnings("ParameterName")
public void setPercentTolerance(double p) {
m_controller.setPercentTolerance(p);
}
diff --git a/wpilibOldCommands/src/test/java/edu/wpi/first/wpilibj/shuffleboard/ShuffleboardTabTest.java b/wpilibOldCommands/src/test/java/edu/wpi/first/wpilibj/shuffleboard/ShuffleboardTabTest.java
index c38d931fb5..b8623e20c3 100644
--- a/wpilibOldCommands/src/test/java/edu/wpi/first/wpilibj/shuffleboard/ShuffleboardTabTest.java
+++ b/wpilibOldCommands/src/test/java/edu/wpi/first/wpilibj/shuffleboard/ShuffleboardTabTest.java
@@ -85,8 +85,8 @@ public class ShuffleboardTabTest {
Sendable sendable = new InstantCommand("Command");
String widgetType = "Command Widget";
m_tab.add(sendable)
- .withWidget(widgetType)
- .withProperties(mapOf("foo", 1234, "bar", "baz"));
+ .withWidget(widgetType)
+ .withProperties(mapOf("foo", 1234, "bar", "baz"));
m_instance.update();
String meta = "/Shuffleboard/.metadata/Tab/Command";
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXL345_SPI.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXL345_SPI.java
index c8ed953828..a630736c67 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXL345_SPI.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXL345_SPI.java
@@ -50,7 +50,6 @@ public class ADXL345_SPI implements Accelerometer, Sendable, AutoCloseable {
/**
* The integer value representing this enumeration.
*/
- @SuppressWarnings("MemberName")
public final byte value;
Axes(byte value) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXL362.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXL362.java
index baa8324342..64d3cbe5e8 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXL362.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXL362.java
@@ -46,7 +46,6 @@ public class ADXL362 implements Accelerometer, Sendable, AutoCloseable {
kY((byte) 0x02),
kZ((byte) 0x04);
- @SuppressWarnings("MemberName")
public final byte value;
Axes(byte value) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogTriggerOutput.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogTriggerOutput.java
index 1094efd7b4..2544b6642f 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogTriggerOutput.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogTriggerOutput.java
@@ -112,7 +112,6 @@ public class AnalogTriggerOutput extends DigitalSource implements Sendable {
kRisingPulse(AnalogJNI.AnalogTriggerType.kRisingPulse),
kFallingPulse(AnalogJNI.AnalogTriggerType.kFallingPulse);
- @SuppressWarnings("MemberName")
private final int value;
AnalogTriggerType(int value) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/CameraServer.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/CameraServer.java
index 6126626ebc..769d1570ee 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/CameraServer.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/CameraServer.java
@@ -71,7 +71,7 @@ public final class CameraServer {
private int m_nextPort;
private String[] m_addresses;
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
private static String makeSourceValue(int source) {
switch (VideoSource.getKindFromInt(CameraServerJNI.getSourceKind(source))) {
case kUsb:
@@ -93,12 +93,12 @@ public final class CameraServer {
}
}
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
private static String makeStreamValue(String address, int port) {
return "mjpg:http://" + address + ":" + port + "/?action=stream";
}
- @SuppressWarnings({"JavadocMethod", "PMD.AvoidUsingHardCodedIP"})
+ @SuppressWarnings({"MissingJavadocMethod", "PMD.AvoidUsingHardCodedIP"})
private synchronized String[] getSinkStreamValues(int sink) {
// Ignore all but MjpegServer
if (VideoSink.getKindFromInt(CameraServerJNI.getSinkKind(sink)) != VideoSink.Kind.kMjpeg) {
@@ -128,7 +128,7 @@ public final class CameraServer {
return values.toArray(new String[0]);
}
- @SuppressWarnings({"JavadocMethod", "PMD.AvoidUsingHardCodedIP"})
+ @SuppressWarnings({"MissingJavadocMethod", "PMD.AvoidUsingHardCodedIP"})
private synchronized String[] getSourceStreamValues(int source) {
// Ignore all but HttpCamera
if (VideoSource.getKindFromInt(CameraServerJNI.getSourceKind(source))
@@ -163,7 +163,7 @@ public final class CameraServer {
return values;
}
- @SuppressWarnings({"JavadocMethod", "PMD.AvoidUsingHardCodedIP"})
+ @SuppressWarnings({"MissingJavadocMethod", "PMD.AvoidUsingHardCodedIP"})
private synchronized void updateStreamValues() {
// Over all the sinks...
for (VideoSink i : m_sinks.values()) {
@@ -206,7 +206,7 @@ public final class CameraServer {
}
}
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
private static String pixelFormatToString(PixelFormat pixelFormat) {
switch (pixelFormat) {
case kMJPEG:
@@ -226,13 +226,13 @@ public final class CameraServer {
/// Provide string description of video mode.
/// The returned string is "{width}x{height} {format} {fps} fps".
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
private static String videoModeToString(VideoMode mode) {
return mode.width + "x" + mode.height + " " + pixelFormatToString(mode.pixelFormat)
+ " " + mode.fps + " fps";
}
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
private static String[] getSourceModeValues(int sourceHandle) {
VideoMode[] modes = CameraServerJNI.enumerateSourceVideoModes(sourceHandle);
String[] modeStrings = new String[modes.length];
@@ -242,7 +242,7 @@ public final class CameraServer {
return modeStrings;
}
- @SuppressWarnings({"JavadocMethod", "PMD.CyclomaticComplexity"})
+ @SuppressWarnings({"MissingJavadocMethod", "PMD.CyclomaticComplexity"})
private static void putSourcePropertyValue(NetworkTable table, VideoEvent event, boolean isNew) {
String name;
String infoName;
@@ -295,7 +295,7 @@ public final class CameraServer {
}
}
- @SuppressWarnings({"JavadocMethod", "PMD.UnusedLocalVariable", "PMD.ExcessiveMethodLength",
+ @SuppressWarnings({"MissingJavadocMethod", "PMD.UnusedLocalVariable", "PMD.ExcessiveMethodLength",
"PMD.NPathComplexity"})
private CameraServer() {
m_defaultUsbDevice = new AtomicInteger();
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Counter.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Counter.java
index 1b6f5cb512..a2004a6bca 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Counter.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Counter.java
@@ -49,7 +49,6 @@ public class Counter implements CounterBase, PIDSource, Sendable, AutoCloseable
*/
kExternalDirection(3);
- @SuppressWarnings("MemberName")
public final int value;
Mode(int value) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/CounterBase.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/CounterBase.java
index 3b88629308..302c1f3e3a 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/CounterBase.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/CounterBase.java
@@ -30,7 +30,6 @@ public interface CounterBase {
*/
k4X(2);
- @SuppressWarnings("MemberName")
public final int value;
EncodingType(int value) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Encoder.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Encoder.java
index 8525ac7b2b..7c421c48c1 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Encoder.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Encoder.java
@@ -31,7 +31,6 @@ public class Encoder implements CounterBase, PIDSource, Sendable, AutoCloseable
public enum IndexingType {
kResetWhileHigh(0), kResetWhileLow(1), kResetOnFallingEdge(2), kResetOnRisingEdge(3);
- @SuppressWarnings("MemberName")
public final int value;
IndexingType(int value) {
@@ -42,12 +41,10 @@ public class Encoder implements CounterBase, PIDSource, Sendable, AutoCloseable
/**
* The a source.
*/
- @SuppressWarnings("MemberName")
protected DigitalSource m_aSource; // the A phase of the quad encoder
/**
* The b source.
*/
- @SuppressWarnings("MemberName")
protected DigitalSource m_bSource; // the B phase of the quad encoder
/**
* The index source.
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Filesystem.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Filesystem.java
index 8ad92cb021..8b3f698023 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Filesystem.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Filesystem.java
@@ -14,7 +14,7 @@ import java.io.File;
* the RoboRIO path /home/lvuser in a simulation-compatible way.
*/
public final class Filesystem {
- private Filesystem() { }
+ private Filesystem() {}
/**
* Obtains the current working path that the program was launched with.
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/GenericHID.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/GenericHID.java
index 5c97491f8c..54f3bc8395 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/GenericHID.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/GenericHID.java
@@ -39,7 +39,6 @@ public abstract class GenericHID {
kHIDFlight(23),
kHID1stPerson(24);
- @SuppressWarnings("MemberName")
public final int value;
@SuppressWarnings("PMD.UseConcurrentHashMap")
private static final Map map = new HashMap<>();
@@ -65,7 +64,6 @@ public abstract class GenericHID {
public enum Hand {
kLeft(0), kRight(1);
- @SuppressWarnings("MemberName")
public final int value;
Hand(int value) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/I2C.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/I2C.java
index 6902abd2ef..4aae4d08d3 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/I2C.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/I2C.java
@@ -24,7 +24,6 @@ public class I2C implements AutoCloseable {
public enum Port {
kOnboard(0), kMXP(1);
- @SuppressWarnings("MemberName")
public final int value;
Port(int value) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/InterruptableSensorBase.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/InterruptableSensorBase.java
index 756495213b..2134b14591 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/InterruptableSensorBase.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/InterruptableSensorBase.java
@@ -14,11 +14,10 @@ import edu.wpi.first.hal.util.AllocationException;
* Base for sensors to be used with interrupts.
*/
public abstract class InterruptableSensorBase implements AutoCloseable {
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
public enum WaitResult {
kTimeout(0x0), kRisingEdge(0x1), kFallingEdge(0x100), kBoth(0x101);
- @SuppressWarnings("MemberName")
public final int value;
WaitResult(int value) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Joystick.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Joystick.java
index 7ce90e17b7..5433c1d1ae 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Joystick.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Joystick.java
@@ -27,7 +27,6 @@ public class Joystick extends GenericHID {
public enum AxisType {
kX(0), kY(1), kZ(2), kTwist(3), kThrottle(4);
- @SuppressWarnings("MemberName")
public final int value;
AxisType(int value) {
@@ -41,7 +40,6 @@ public class Joystick extends GenericHID {
public enum ButtonType {
kTrigger(1), kTop(2);
- @SuppressWarnings("MemberName")
public final int value;
ButtonType(int value) {
@@ -55,7 +53,6 @@ public class Joystick extends GenericHID {
private enum Button {
kTrigger(1), kTop(2);
- @SuppressWarnings("MemberName")
public final int value;
Button(int value) {
@@ -69,7 +66,6 @@ public class Joystick extends GenericHID {
private enum Axis {
kX(0), kY(1), kZ(2), kTwist(3), kThrottle(4), kNumAxes(5);
- @SuppressWarnings("MemberName")
public final int value;
Axis(int value) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDInterface.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDInterface.java
index 8325f70e71..0e8b2f1b6d 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDInterface.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDInterface.java
@@ -7,7 +7,6 @@ package edu.wpi.first.wpilibj;
@Deprecated(since = "2020", forRemoval = true)
@SuppressWarnings("SummaryJavadoc")
public interface PIDInterface {
- @SuppressWarnings("ParameterName")
void setPID(double p, double i, double d);
double getP();
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java
index 16abb9df4d..78af1102d3 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java
@@ -267,7 +267,7 @@ public abstract class RobotBase implements AutoCloseable {
*/
public abstract void endCompetition();
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
public static boolean getBooleanProperty(String name, boolean defaultValue) {
String propVal = System.getProperty(name);
if (propVal == null) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotDrive.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotDrive.java
index 47443989cf..0025d05fd4 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotDrive.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotDrive.java
@@ -30,7 +30,6 @@ public class RobotDrive extends MotorSafety implements AutoCloseable {
public enum MotorType {
kFrontLeft(0), kFrontRight(1), kRearLeft(2), kRearRight(3);
- @SuppressWarnings("MemberName")
public final int value;
MotorType(int value) {
@@ -445,29 +444,24 @@ public class RobotDrive extends MotorSafety implements AutoCloseable {
* @param gyroAngle The current angle reading from the gyro. Use this to implement field-oriented
* controls.
*/
- @SuppressWarnings("ParameterName")
public void mecanumDrive_Cartesian(double x, double y, double rotation, double gyroAngle) {
if (!kMecanumCartesian_Reported) {
HAL.report(tResourceType.kResourceType_RobotDrive, tInstances.kRobotDrive_MecanumCartesian,
getNumMotors());
kMecanumCartesian_Reported = true;
}
- @SuppressWarnings("LocalVariableName")
- double xIn = x;
- @SuppressWarnings("LocalVariableName")
- double yIn = y;
// Negate y for the joystick.
- yIn = -yIn;
+ y = -y;
// Compensate for gyro angle.
- double[] rotated = rotateVector(xIn, yIn, gyroAngle);
- xIn = rotated[0];
- yIn = rotated[1];
+ double[] rotated = rotateVector(x, y, gyroAngle);
+ x = rotated[0];
+ y = rotated[1];
double[] wheelSpeeds = new double[kMaxNumberOfMotors];
- wheelSpeeds[MotorType.kFrontLeft.value] = xIn + yIn + rotation;
- wheelSpeeds[MotorType.kFrontRight.value] = -xIn + yIn - rotation;
- wheelSpeeds[MotorType.kRearLeft.value] = -xIn + yIn + rotation;
- wheelSpeeds[MotorType.kRearRight.value] = xIn + yIn - rotation;
+ wheelSpeeds[MotorType.kFrontLeft.value] = x + y + rotation;
+ wheelSpeeds[MotorType.kFrontRight.value] = -x + y - rotation;
+ wheelSpeeds[MotorType.kRearLeft.value] = -x + y + rotation;
+ wheelSpeeds[MotorType.kRearRight.value] = x + y - rotation;
normalize(wheelSpeeds);
m_frontLeftMotor.set(wheelSpeeds[MotorType.kFrontLeft.value] * m_maxOutput);
@@ -592,7 +586,6 @@ public class RobotDrive extends MotorSafety implements AutoCloseable {
/**
* Rotate a vector in Cartesian space.
*/
- @SuppressWarnings("ParameterName")
protected static double[] rotateVector(double x, double y, double angle) {
double cosA = Math.cos(angle * (Math.PI / 180.0));
double sinA = Math.sin(angle * (Math.PI / 180.0));
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotState.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotState.java
index 2711596c2b..efe12cc0ef 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotState.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotState.java
@@ -4,7 +4,7 @@
package edu.wpi.first.wpilibj;
-@SuppressWarnings("JavadocMethod")
+@SuppressWarnings("MissingJavadocMethod")
public final class RobotState {
public static boolean isDisabled() {
return DriverStation.getInstance().isDisabled();
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java
index 682e12c10a..0caf7aa43c 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java
@@ -21,7 +21,6 @@ public class SPI implements AutoCloseable {
public enum Port {
kOnboardCS0(0), kOnboardCS1(1), kOnboardCS2(2), kOnboardCS3(3), kMXP(4);
- @SuppressWarnings("MemberName")
public final int value;
Port(int value) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SensorUtil.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SensorUtil.java
index 1f300a5c8e..d68ab463e2 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SensorUtil.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SensorUtil.java
@@ -78,9 +78,9 @@ public final class SensorUtil {
if (!SolenoidJNI.checkSolenoidModule(moduleNumber)) {
StringBuilder buf = new StringBuilder();
buf.append("Requested solenoid module is out of range. Minimum: 0, Maximum: ")
- .append(kPCMModules)
- .append(", Requested: ")
- .append(moduleNumber);
+ .append(kPCMModules)
+ .append(", Requested: ")
+ .append(moduleNumber);
throw new IllegalArgumentException(buf.toString());
}
}
@@ -95,9 +95,9 @@ public final class SensorUtil {
if (!DIOJNI.checkDIOChannel(channel)) {
StringBuilder buf = new StringBuilder();
buf.append("Requested DIO channel is out of range. Minimum: 0, Maximum: ")
- .append(kDigitalChannels)
- .append(", Requested: ")
- .append(channel);
+ .append(kDigitalChannels)
+ .append(", Requested: ")
+ .append(channel);
throw new IllegalArgumentException(buf.toString());
}
}
@@ -112,9 +112,9 @@ public final class SensorUtil {
if (!RelayJNI.checkRelayChannel(channel)) {
StringBuilder buf = new StringBuilder();
buf.append("Requested relay channel is out of range. Minimum: 0, Maximum: ")
- .append(kRelayChannels)
- .append(", Requested: ")
- .append(channel);
+ .append(kRelayChannels)
+ .append(", Requested: ")
+ .append(channel);
throw new IllegalArgumentException(buf.toString());
}
}
@@ -129,9 +129,9 @@ public final class SensorUtil {
if (!PWMJNI.checkPWMChannel(channel)) {
StringBuilder buf = new StringBuilder();
buf.append("Requested PWM channel is out of range. Minimum: 0, Maximum: ")
- .append(kPwmChannels)
- .append(", Requested: ")
- .append(channel);
+ .append(kPwmChannels)
+ .append(", Requested: ")
+ .append(channel);
throw new IllegalArgumentException(buf.toString());
}
}
@@ -146,9 +146,9 @@ public final class SensorUtil {
if (!AnalogJNI.checkAnalogInputChannel(channel)) {
StringBuilder buf = new StringBuilder();
buf.append("Requested analog input channel is out of range. Minimum: 0, Maximum: ")
- .append(kAnalogInputChannels)
- .append(", Requested: ")
- .append(channel);
+ .append(kAnalogInputChannels)
+ .append(", Requested: ")
+ .append(channel);
throw new IllegalArgumentException(buf.toString());
}
}
@@ -163,9 +163,9 @@ public final class SensorUtil {
if (!AnalogJNI.checkAnalogOutputChannel(channel)) {
StringBuilder buf = new StringBuilder();
buf.append("Requested analog output channel is out of range. Minimum: 0, Maximum: ")
- .append(kAnalogOutputChannels)
- .append(", Requested: ")
- .append(channel);
+ .append(kAnalogOutputChannels)
+ .append(", Requested: ")
+ .append(channel);
throw new IllegalArgumentException(buf.toString());
}
}
@@ -179,9 +179,9 @@ public final class SensorUtil {
if (!SolenoidJNI.checkSolenoidChannel(channel)) {
StringBuilder buf = new StringBuilder();
buf.append("Requested solenoid channel is out of range. Minimum: 0, Maximum: ")
- .append(kSolenoidChannels)
- .append(", Requested: ")
- .append(channel);
+ .append(kSolenoidChannels)
+ .append(", Requested: ")
+ .append(channel);
throw new IllegalArgumentException(buf.toString());
}
}
@@ -196,9 +196,9 @@ public final class SensorUtil {
if (!PDPJNI.checkPDPChannel(channel)) {
StringBuilder buf = new StringBuilder();
buf.append("Requested PDP channel is out of range. Minimum: 0, Maximum: ")
- .append(kPDPChannels)
- .append(", Requested: ")
- .append(channel);
+ .append(kPDPChannels)
+ .append(", Requested: ")
+ .append(channel);
throw new IllegalArgumentException(buf.toString());
}
}
@@ -212,9 +212,9 @@ public final class SensorUtil {
if (!PDPJNI.checkPDPModule(module)) {
StringBuilder buf = new StringBuilder();
buf.append("Requested PDP module is out of range. Minimum: 0, Maximum: ")
- .append(kPDPModules)
- .append(", Requested: ")
- .append(module);
+ .append(kPDPModules)
+ .append(", Requested: ")
+ .append(module);
throw new IllegalArgumentException(buf.toString());
}
}
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SerialPort.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SerialPort.java
index 547773a03f..b1b5f1c8e0 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SerialPort.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SerialPort.java
@@ -19,7 +19,6 @@ public class SerialPort implements AutoCloseable {
public enum Port {
kOnboard(0), kMXP(1), kUSB(2), kUSB1(2), kUSB2(3);
- @SuppressWarnings("MemberName")
public final int value;
Port(int value) {
@@ -33,7 +32,6 @@ public class SerialPort implements AutoCloseable {
public enum Parity {
kNone(0), kOdd(1), kEven(2), kMark(3), kSpace(4);
- @SuppressWarnings("MemberName")
public final int value;
Parity(int value) {
@@ -47,7 +45,6 @@ public class SerialPort implements AutoCloseable {
public enum StopBits {
kOne(10), kOnePointFive(15), kTwo(20);
- @SuppressWarnings("MemberName")
public final int value;
StopBits(int value) {
@@ -61,7 +58,6 @@ public class SerialPort implements AutoCloseable {
public enum FlowControl {
kNone(0), kXonXoff(1), kRtsCts(2), kDtsDsr(4);
- @SuppressWarnings("MemberName")
public final int value;
FlowControl(int value) {
@@ -75,7 +71,6 @@ public class SerialPort implements AutoCloseable {
public enum WriteBufferMode {
kFlushOnAccess(1), kFlushWhenFull(2);
- @SuppressWarnings("MemberName")
public final int value;
WriteBufferMode(int value) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Timer.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Timer.java
index 7e34a33a6c..b3547ab36c 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Timer.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Timer.java
@@ -54,7 +54,7 @@ public class Timer {
*/
private final Object m_lock = new Object();
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
public Timer() {
reset();
}
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/controller/PIDController.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/controller/PIDController.java
index 215068381c..b94ad9b077 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/controller/PIDController.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/controller/PIDController.java
@@ -19,16 +19,13 @@ public class PIDController implements Sendable, AutoCloseable {
private static int instances;
// Factor for "proportional" control
- @SuppressWarnings("MemberName")
- private double m_Kp;
+ private double m_kp;
// Factor for "integral" control
- @SuppressWarnings("MemberName")
- private double m_Ki;
+ private double m_ki;
// Factor for "derivative" control
- @SuppressWarnings("MemberName")
- private double m_Kd;
+ private double m_kd;
// The period (in seconds) of the loop that calls the controller
private final double m_period;
@@ -62,31 +59,29 @@ public class PIDController implements Sendable, AutoCloseable {
private double m_measurement;
/**
- * Allocates a PIDController with the given constants for Kp, Ki, and Kd and a default period of
+ * Allocates a PIDController with the given constants for kp, ki, and kd and a default period of
* 0.02 seconds.
*
- * @param Kp The proportional coefficient.
- * @param Ki The integral coefficient.
- * @param Kd The derivative coefficient.
+ * @param kp The proportional coefficient.
+ * @param ki The integral coefficient.
+ * @param kd The derivative coefficient.
*/
- @SuppressWarnings("ParameterName")
- public PIDController(double Kp, double Ki, double Kd) {
- this(Kp, Ki, Kd, 0.02);
+ public PIDController(double kp, double ki, double kd) {
+ this(kp, ki, kd, 0.02);
}
/**
- * Allocates a PIDController with the given constants for Kp, Ki, and Kd.
+ * Allocates a PIDController with the given constants for kp, ki, and kd.
*
- * @param Kp The proportional coefficient.
- * @param Ki The integral coefficient.
- * @param Kd The derivative coefficient.
+ * @param kp The proportional coefficient.
+ * @param ki The integral coefficient.
+ * @param kd The derivative coefficient.
* @param period The period between controller updates in seconds.
*/
- @SuppressWarnings("ParameterName")
- public PIDController(double Kp, double Ki, double Kd, double period) {
- m_Kp = Kp;
- m_Ki = Ki;
- m_Kd = Kd;
+ public PIDController(double kp, double ki, double kd, double period) {
+ m_kp = kp;
+ m_ki = ki;
+ m_kd = kd;
m_period = period;
@@ -106,45 +101,41 @@ public class PIDController implements Sendable, AutoCloseable {
*
* Set the proportional, integral, and differential coefficients.
*
- * @param Kp The proportional coefficient.
- * @param Ki The integral coefficient.
- * @param Kd The derivative coefficient.
+ * @param kp The proportional coefficient.
+ * @param ki The integral coefficient.
+ * @param kd The derivative coefficient.
*/
- @SuppressWarnings("ParameterName")
- public void setPID(double Kp, double Ki, double Kd) {
- m_Kp = Kp;
- m_Ki = Ki;
- m_Kd = Kd;
+ public void setPID(double kp, double ki, double kd) {
+ m_kp = kp;
+ m_ki = ki;
+ m_kd = kd;
}
/**
* Sets the Proportional coefficient of the PID controller gain.
*
- * @param Kp proportional coefficient
+ * @param kp proportional coefficient
*/
- @SuppressWarnings("ParameterName")
- public void setP(double Kp) {
- m_Kp = Kp;
+ public void setP(double kp) {
+ m_kp = kp;
}
/**
* Sets the Integral coefficient of the PID controller gain.
*
- * @param Ki integral coefficient
+ * @param ki integral coefficient
*/
- @SuppressWarnings("ParameterName")
- public void setI(double Ki) {
- m_Ki = Ki;
+ public void setI(double ki) {
+ m_ki = ki;
}
/**
* Sets the Differential coefficient of the PID controller gain.
*
- * @param Kd differential coefficient
+ * @param kd differential coefficient
*/
- @SuppressWarnings("ParameterName")
- public void setD(double Kd) {
- m_Kd = Kd;
+ public void setD(double kd) {
+ m_kd = kd;
}
/**
@@ -153,7 +144,7 @@ public class PIDController implements Sendable, AutoCloseable {
* @return proportional coefficient
*/
public double getP() {
- return m_Kp;
+ return m_kp;
}
/**
@@ -162,7 +153,7 @@ public class PIDController implements Sendable, AutoCloseable {
* @return integral coefficient
*/
public double getI() {
- return m_Ki;
+ return m_ki;
}
/**
@@ -171,7 +162,7 @@ public class PIDController implements Sendable, AutoCloseable {
* @return differential coefficient
*/
public double getD() {
- return m_Kd;
+ return m_kd;
}
/**
@@ -333,12 +324,12 @@ public class PIDController implements Sendable, AutoCloseable {
m_velocityError = (m_positionError - m_prevError) / m_period;
- if (m_Ki != 0) {
+ if (m_ki != 0) {
m_totalError = MathUtil.clamp(m_totalError + m_positionError * m_period,
- m_minimumIntegral / m_Ki, m_maximumIntegral / m_Ki);
+ m_minimumIntegral / m_ki, m_maximumIntegral / m_ki);
}
- return m_Kp * m_positionError + m_Ki * m_totalError + m_Kd * m_velocityError;
+ return m_kp * m_positionError + m_ki * m_totalError + m_kd * m_velocityError;
}
/**
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java
index 096588b174..121f7c142b 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java
@@ -23,7 +23,6 @@ public abstract class RobotDriveBase extends MotorSafety {
kFrontLeft(0), kFrontRight(1), kRearLeft(2), kRearRight(3), kLeft(0),
kRight(1), kBack(2);
- @SuppressWarnings("MemberName")
public final int value;
MotorType(int value) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/Vector2d.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/Vector2d.java
index 000d8eb3dc..8825b57e6c 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/Vector2d.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/Vector2d.java
@@ -7,14 +7,14 @@ package edu.wpi.first.wpilibj.drive;
/**
* This is a 2D vector struct that supports basic vector operations.
*/
-@SuppressWarnings("MemberName")
public class Vector2d {
+ @SuppressWarnings("MemberName")
public double x;
+ @SuppressWarnings("MemberName")
public double y;
public Vector2d() {}
- @SuppressWarnings("ParameterName")
public Vector2d(double x, double y) {
this.x = x;
this.y = y;
diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gyro/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gyro/Robot.java
index 6f6844dc48..61048be037 100644
--- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gyro/Robot.java
+++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gyro/Robot.java
@@ -30,7 +30,7 @@ public class Robot extends TimedRobot {
private final DifferentialDrive m_myRobot
= new DifferentialDrive(new PWMVictorSPX(kLeftMotorPort),
- new PWMVictorSPX(kRightMotorPort));
+ new PWMVictorSPX(kRightMotorPort));
private final AnalogGyro m_gyro = new AnalogGyro(kGyroPort);
private final Joystick m_joystick = new Joystick(kJoystickPort);
diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumcontrollercommand/Constants.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumcontrollercommand/Constants.java
index 20f19ecd02..e2cd322393 100644
--- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumcontrollercommand/Constants.java
+++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumcontrollercommand/Constants.java
@@ -41,10 +41,10 @@ public final class Constants {
public static final MecanumDriveKinematics kDriveKinematics =
new MecanumDriveKinematics(
- new Translation2d(kWheelBase / 2, kTrackWidth / 2),
- new Translation2d(kWheelBase / 2, -kTrackWidth / 2),
- new Translation2d(-kWheelBase / 2, kTrackWidth / 2),
- new Translation2d(-kWheelBase / 2, -kTrackWidth / 2));
+ new Translation2d(kWheelBase / 2, kTrackWidth / 2),
+ new Translation2d(kWheelBase / 2, -kTrackWidth / 2),
+ new Translation2d(-kWheelBase / 2, kTrackWidth / 2),
+ new Translation2d(-kWheelBase / 2, -kTrackWidth / 2));
public static final int kEncoderCPR = 1024;
public static final double kWheelDiameterMeters = 0.15;
diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/romireference/RobotContainer.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/romireference/RobotContainer.java
index 92c0a8ddbb..def9c47b0c 100644
--- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/romireference/RobotContainer.java
+++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/romireference/RobotContainer.java
@@ -65,8 +65,8 @@ public class RobotContainer {
// Example of how to use the onboard IO
Button onboardButtonA = new Button(m_onboardIO::getButtonAPressed);
onboardButtonA
- .whenActive(new PrintCommand("Button A Pressed"))
- .whenInactive(new PrintCommand("Button A Released"));
+ .whenActive(new PrintCommand("Button A Pressed"))
+ .whenInactive(new PrintCommand("Button A Released"));
}
diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervebot/SwerveModule.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervebot/SwerveModule.java
index 7f1b553aea..ccf8dcd5f0 100644
--- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervebot/SwerveModule.java
+++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervebot/SwerveModule.java
@@ -32,7 +32,8 @@ public class SwerveModule {
private final ProfiledPIDController m_turningPIDController
= new ProfiledPIDController(1, 0, 0,
- new TrapezoidProfile.Constraints(kModuleMaxAngularVelocity, kModuleMaxAngularAcceleration));
+ new TrapezoidProfile.Constraints(kModuleMaxAngularVelocity,
+ kModuleMaxAngularAcceleration));
// Gains are for example purposes only - must be determined for your own robot!
private final SimpleMotorFeedforward m_driveFeedforward = new SimpleMotorFeedforward(1, 3);
diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervecontrollercommand/Constants.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervecontrollercommand/Constants.java
index 18d2f2137b..c0d3e959e6 100644
--- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervecontrollercommand/Constants.java
+++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervecontrollercommand/Constants.java
@@ -55,10 +55,10 @@ public final class Constants {
//Distance between front and back wheels on robot
public static final SwerveDriveKinematics kDriveKinematics =
new SwerveDriveKinematics(
- new Translation2d(kWheelBase / 2, kTrackWidth / 2),
- new Translation2d(kWheelBase / 2, -kTrackWidth / 2),
- new Translation2d(-kWheelBase / 2, kTrackWidth / 2),
- new Translation2d(-kWheelBase / 2, -kTrackWidth / 2));
+ new Translation2d(kWheelBase / 2, kTrackWidth / 2),
+ new Translation2d(kWheelBase / 2, -kTrackWidth / 2),
+ new Translation2d(-kWheelBase / 2, kTrackWidth / 2),
+ new Translation2d(-kWheelBase / 2, -kTrackWidth / 2));
public static final boolean kGyroReversed = false;
diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervesdriveposeestimator/SwerveModule.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervesdriveposeestimator/SwerveModule.java
index 28dd47b9bf..dfb985d07e 100644
--- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervesdriveposeestimator/SwerveModule.java
+++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervesdriveposeestimator/SwerveModule.java
@@ -32,7 +32,8 @@ public class SwerveModule {
private final ProfiledPIDController m_turningPIDController
= new ProfiledPIDController(1, 0, 0,
- new TrapezoidProfile.Constraints(kModuleMaxAngularVelocity, kModuleMaxAngularAcceleration));
+ new TrapezoidProfile.Constraints(kModuleMaxAngularVelocity,
+ kModuleMaxAngularAcceleration));
// Gains are for example purposes only - must be determined for your own robot!
private final SimpleMotorFeedforward m_driveFeedforward = new SimpleMotorFeedforward(1, 3);
diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ultrasonic/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ultrasonic/Robot.java
index 14f62a8946..a3202b18d1 100644
--- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ultrasonic/Robot.java
+++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ultrasonic/Robot.java
@@ -35,7 +35,7 @@ public class Robot extends TimedRobot {
private final AnalogInput m_ultrasonic = new AnalogInput(kUltrasonicPort);
private final DifferentialDrive m_robotDrive
= new DifferentialDrive(new PWMVictorSPX(kLeftMotorPort),
- new PWMVictorSPX(kRightMotorPort));
+ new PWMVictorSPX(kRightMotorPort));
/**
* Tells the robot to drive to a set distance (in inches) from an object
diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ultrasonicpid/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ultrasonicpid/Robot.java
index 8ea83958bd..b2ba1ac4c9 100644
--- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ultrasonicpid/Robot.java
+++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ultrasonicpid/Robot.java
@@ -41,7 +41,7 @@ public class Robot extends TimedRobot {
private final AnalogInput m_ultrasonic = new AnalogInput(kUltrasonicPort);
private final DifferentialDrive m_robotDrive
= new DifferentialDrive(new PWMVictorSPX(kLeftMotorPort),
- new PWMVictorSPX(kRightMotorPort));
+ new PWMVictorSPX(kRightMotorPort));
private final PIDController m_pidController = new PIDController(kP, kI, kD);
@Override
diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/MockDS.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/MockDS.java
index 8e6c2c24a3..dcb64ca30d 100644
--- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/MockDS.java
+++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/MockDS.java
@@ -22,7 +22,7 @@ public class MockDS {
data[5] = 0x00; // red 1 station
}
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
public void start() {
m_thread = new Thread(() -> {
DatagramSocket socket;
@@ -65,7 +65,7 @@ public class MockDS {
m_thread.start();
}
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
public void stop() {
if (m_thread == null) {
return;
diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PDPTest.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PDPTest.java
index c23d62595f..c2d3ab3268 100644
--- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PDPTest.java
+++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PDPTest.java
@@ -50,7 +50,7 @@ public class PDPTest extends AbstractComsSetup {
}
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
public PDPTest(MotorEncoderFixture> mef, Double expectedCurrentDraw) {
logger.fine("Constructor with: " + mef.getType());
if (me != null && !me.equals(mef)) {
diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PIDTest.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PIDTest.java
index e58a1718de..a632f1229b 100644
--- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PIDTest.java
+++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PIDTest.java
@@ -56,7 +56,7 @@ public class PIDTest extends AbstractComsSetup {
}
- @SuppressWarnings({"ParameterName", "JavadocMethod"})
+ @SuppressWarnings({"ParameterName", "MissingJavadocMethod"})
public PIDTest(Double p, Double i, Double d, MotorEncoderFixture> mef) {
logger.fine("Constructor with: " + mef.getType());
if (PIDTest.me != null && !PIDTest.me.equals(mef)) {
diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/TestBench.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/TestBench.java
index 268b1f4c52..01a8963a7c 100644
--- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/TestBench.java
+++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/TestBench.java
@@ -218,7 +218,7 @@ public final class TestBench {
return pairs;
}
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
public static AnalogCrossConnectFixture getAnalogCrossConnectFixture() {
return new AnalogCrossConnectFixture() {
@Override
@@ -233,7 +233,7 @@ public final class TestBench {
};
}
- @SuppressWarnings("JavadocMethod")
+ @SuppressWarnings("MissingJavadocMethod")
public static RelayCrossConnectFixture getRelayCrossConnectFixture() {
return new RelayCrossConnectFixture() {
@Override
diff --git a/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/AngleStatistics.java b/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/AngleStatistics.java
index 98c473eeba..93a6e5c91b 100644
--- a/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/AngleStatistics.java
+++ b/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/AngleStatistics.java
@@ -26,7 +26,6 @@ public final class AngleStatistics {
* @param b A vector to subtract with.
* @param angleStateIdx The row containing angles to be normalized.
*/
- @SuppressWarnings("checkstyle:ParameterName")
public static Matrix angleResidual(Matrix a, Matrix b,
int angleStateIdx) {
Matrix ret = a.minus(b);
@@ -41,7 +40,6 @@ public final class AngleStatistics {
*
* @param angleStateIdx The row containing angles to be normalized.
*/
- @SuppressWarnings("checkstyle:ParameterName")
public static BiFunction, Matrix, Matrix>
angleResidual(int angleStateIdx) {
return (a, b) -> angleResidual(a, b, angleStateIdx);
@@ -54,7 +52,6 @@ public final class AngleStatistics {
* @param b A vector to add with.
* @param angleStateIdx The row containing angles to be normalized.
*/
- @SuppressWarnings("checkstyle:ParameterName")
public static Matrix angleAdd(Matrix a, Matrix b,
int angleStateIdx) {
Matrix ret = a.plus(b);
@@ -69,7 +66,6 @@ public final class AngleStatistics {
*
* @param angleStateIdx The row containing angles to be normalized.
*/
- @SuppressWarnings("checkstyle:ParameterName")
public static BiFunction, Matrix, Matrix>
angleAdd(int angleStateIdx) {
return (a, b) -> angleAdd(a, b, angleStateIdx);
@@ -119,7 +115,7 @@ public final class AngleStatistics {
*
* @param angleStateIdx The row containing the angles.
*/
- @SuppressWarnings("checkstyle:ParameterName")
+ @SuppressWarnings("LambdaParameterName")
public static BiFunction, Matrix, N1>, Matrix>
angleMean(int angleStateIdx) {
return (sigmas, Wm) -> angleMean(sigmas, Wm, angleStateIdx);
diff --git a/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/DifferentialDrivePoseEstimator.java b/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/DifferentialDrivePoseEstimator.java
index f21858e94e..27990c0066 100644
--- a/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/DifferentialDrivePoseEstimator.java
+++ b/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/DifferentialDrivePoseEstimator.java
@@ -141,7 +141,7 @@ public class DifferentialDrivePoseEstimator {
m_visionCorrect = (u, y) -> m_observer.correct(
Nat.N3(), u, y,
- (x, u_) -> new Matrix<>(x.getStorage().extractMatrix(0, 3, 0, 1)),
+ (x, u1) -> new Matrix<>(x.getStorage().extractMatrix(0, 3, 0, 1)),
m_visionDiscreteR,
AngleStatistics.angleMean(2),
AngleStatistics.angleResidual(2),
diff --git a/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/MecanumDrivePoseEstimator.java b/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/MecanumDrivePoseEstimator.java
index 4f71e8280a..6d8e005ec4 100644
--- a/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/MecanumDrivePoseEstimator.java
+++ b/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/MecanumDrivePoseEstimator.java
@@ -117,8 +117,8 @@ public class MecanumDrivePoseEstimator {
m_observer = new UnscentedKalmanFilter<>(
Nat.N3(), Nat.N1(),
- (x_, u) -> u,
- (x, u_) -> x.extractRowVector(2),
+ (x, u) -> u,
+ (x, u) -> x.extractRowVector(2),
stateStdDevs,
localMeasurementStdDevs,
AngleStatistics.angleMean(2),
@@ -136,7 +136,7 @@ public class MecanumDrivePoseEstimator {
m_visionCorrect = (u, y) -> m_observer.correct(
Nat.N3(), u, y,
- (x, u_) -> x,
+ (x, u1) -> x,
m_visionDiscreteR,
AngleStatistics.angleMean(2),
AngleStatistics.angleResidual(2),
diff --git a/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/SwerveDrivePoseEstimator.java b/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/SwerveDrivePoseEstimator.java
index 72106a11d0..3eda89c32e 100644
--- a/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/SwerveDrivePoseEstimator.java
+++ b/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/SwerveDrivePoseEstimator.java
@@ -117,8 +117,8 @@ public class SwerveDrivePoseEstimator {
m_observer = new UnscentedKalmanFilter<>(
Nat.N3(), Nat.N1(),
- (x_, u) -> u,
- (x, u_) -> x.extractRowVector(2),
+ (x, u) -> u,
+ (x, u) -> x.extractRowVector(2),
stateStdDevs,
localMeasurementStdDevs,
AngleStatistics.angleMean(2),
@@ -136,7 +136,7 @@ public class SwerveDrivePoseEstimator {
m_visionCorrect = (u, y) -> m_observer.correct(
Nat.N3(), u, y,
- (x, u_) -> x,
+ (x, u1) -> x,
m_visionDiscreteR,
AngleStatistics.angleMean(2),
AngleStatistics.angleResidual(2),
diff --git a/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/UnscentedKalmanFilter.java b/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/UnscentedKalmanFilter.java
index 43f977153c..498314175d 100644
--- a/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/UnscentedKalmanFilter.java
+++ b/wpimath/src/main/java/edu/wpi/first/wpilibj/estimator/UnscentedKalmanFilter.java
@@ -66,7 +66,7 @@ public class UnscentedKalmanFilter states, Nat outputs,
BiFunction, Matrix,
Matrix> f,
@@ -329,7 +329,7 @@ public class UnscentedKalmanFilter void correct(
Nat rows, Matrix u,
Matrix y,
diff --git a/wpimath/src/main/java/edu/wpi/first/wpilibj/geometry/Pose2d.java b/wpimath/src/main/java/edu/wpi/first/wpilibj/geometry/Pose2d.java
index 422fbec064..e6b4dc0fb6 100644
--- a/wpimath/src/main/java/edu/wpi/first/wpilibj/geometry/Pose2d.java
+++ b/wpimath/src/main/java/edu/wpi/first/wpilibj/geometry/Pose2d.java
@@ -50,7 +50,6 @@ public class Pose2d {
* @param y The y component of the translational component of the pose.
* @param rotation The rotational component of the pose.
*/
- @SuppressWarnings("ParameterName")
public Pose2d(double x, double y, Rotation2d rotation) {
m_translation = new Translation2d(x, y);
m_rotation = rotation;
@@ -170,7 +169,6 @@ public class Pose2d {
* the twist would be Twist2d{0.01, 0.0, toRadians(0.5)}
* @return The new pose of the robot.
*/
- @SuppressWarnings("LocalVariableName")
public Pose2d exp(Twist2d twist) {
double dx = twist.dx;
double dy = twist.dy;
diff --git a/wpimath/src/main/java/edu/wpi/first/wpilibj/geometry/Rotation2d.java b/wpimath/src/main/java/edu/wpi/first/wpilibj/geometry/Rotation2d.java
index b6df147d95..5b200f696f 100644
--- a/wpimath/src/main/java/edu/wpi/first/wpilibj/geometry/Rotation2d.java
+++ b/wpimath/src/main/java/edu/wpi/first/wpilibj/geometry/Rotation2d.java
@@ -51,7 +51,6 @@ public class Rotation2d {
* @param x The x component or cosine of the rotation.
* @param y The y component or sine of the rotation.
*/
- @SuppressWarnings("ParameterName")
public Rotation2d(double x, double y) {
double magnitude = Math.hypot(x, y);
if (magnitude > 1e-6) {
diff --git a/wpimath/src/main/java/edu/wpi/first/wpilibj/spline/CubicHermiteSpline.java b/wpimath/src/main/java/edu/wpi/first/wpilibj/spline/CubicHermiteSpline.java
index df8586594d..02c570795a 100644
--- a/wpimath/src/main/java/edu/wpi/first/wpilibj/spline/CubicHermiteSpline.java
+++ b/wpimath/src/main/java/edu/wpi/first/wpilibj/spline/CubicHermiteSpline.java
@@ -88,7 +88,7 @@ public class CubicHermiteSpline extends Spline {
-3.0, -2.0, +3.0, -1.0,
+0.0, +1.0, +0.0, +0.0,
+1.0, +0.0, +0.0, +0.0
- });
+ });
}
return hermiteBasis;
}
diff --git a/wpimath/src/main/java/edu/wpi/first/wpilibj/spline/QuinticHermiteSpline.java b/wpimath/src/main/java/edu/wpi/first/wpilibj/spline/QuinticHermiteSpline.java
index b0c72798c9..0ed7fc93ff 100644
--- a/wpimath/src/main/java/edu/wpi/first/wpilibj/spline/QuinticHermiteSpline.java
+++ b/wpimath/src/main/java/edu/wpi/first/wpilibj/spline/QuinticHermiteSpline.java
@@ -89,7 +89,7 @@ public class QuinticHermiteSpline extends Spline {
+00.0, +00.0, +00.5, +00.0, +00.0, +00.0,
+00.0, +01.0, +00.0, +00.0, +00.0, +00.0,
+01.0, +00.0, +00.0, +00.0, +00.0, +00.0
- });
+ });
}
return hermiteBasis;
}
diff --git a/wpimath/src/main/java/edu/wpi/first/wpilibj/system/NumericalJacobian.java b/wpimath/src/main/java/edu/wpi/first/wpilibj/system/NumericalJacobian.java
index 2f0fb02d74..4d416ab397 100644
--- a/wpimath/src/main/java/edu/wpi/first/wpilibj/system/NumericalJacobian.java
+++ b/wpimath/src/main/java/edu/wpi/first/wpilibj/system/NumericalJacobian.java
@@ -69,7 +69,7 @@ public final class NumericalJacobian {
* @param u Input vector.
* @return The numerical Jacobian with respect to x for f(x, u, ...).
*/
- @SuppressWarnings({"ParameterName", "MethodTypeParameterName"})
+ @SuppressWarnings({"LambdaParameterName", "MethodTypeParameterName"})
public static
Matrix numericalJacobianX(
Nat rows,
@@ -94,7 +94,7 @@ public final class NumericalJacobian {
* @param u Input vector.
* @return the numerical Jacobian with respect to u for f(x, u).
*/
- @SuppressWarnings({"ParameterName", "MethodTypeParameterName"})
+ @SuppressWarnings({"LambdaParameterName", "MethodTypeParameterName"})
public static Matrix
numericalJacobianU(
Nat rows,
diff --git a/wpimath/src/main/java/edu/wpi/first/wpilibj/trajectory/TrapezoidProfile.java b/wpimath/src/main/java/edu/wpi/first/wpilibj/trajectory/TrapezoidProfile.java
index cda5a441db..a4b5fa89f2 100644
--- a/wpimath/src/main/java/edu/wpi/first/wpilibj/trajectory/TrapezoidProfile.java
+++ b/wpimath/src/main/java/edu/wpi/first/wpilibj/trajectory/TrapezoidProfile.java
@@ -168,7 +168,6 @@ public class TrapezoidProfile {
*
* @param t The time since the beginning of the profile.
*/
- @SuppressWarnings("ParameterName")
public State calculate(double t) {
State result = new State(m_initial.position, m_initial.velocity);
@@ -274,7 +273,6 @@ public class TrapezoidProfile {
*
* @param t The time since the beginning of the profile.
*/
- @SuppressWarnings("ParameterName")
public boolean isFinished(double t) {
return t >= totalTime();
}
diff --git a/wpimath/src/test/java/edu/wpi/first/wpilibj/LinearFilterTest.java b/wpimath/src/test/java/edu/wpi/first/wpilibj/LinearFilterTest.java
index bfdaf7aa35..820432b1a8 100644
--- a/wpimath/src/test/java/edu/wpi/first/wpilibj/LinearFilterTest.java
+++ b/wpimath/src/test/java/edu/wpi/first/wpilibj/LinearFilterTest.java
@@ -29,12 +29,10 @@ class LinearFilterTest {
private static final double kHighPassExpectedOutput = 10.074717;
private static final double kMovAvgExpectedOutput = -10.191644;
- @SuppressWarnings("ParameterName")
private static double getData(double t) {
return 100.0 * Math.sin(2.0 * Math.PI * t) + 20.0 * Math.cos(50.0 * Math.PI * t);
}
- @SuppressWarnings("ParameterName")
private static double getPulseData(double t) {
if (Math.abs(t - 1.0) < 0.001) {
return 1.0;
diff --git a/wpimath/src/test/java/edu/wpi/first/wpilibj/kinematics/SwerveDriveKinematicsTest.java b/wpimath/src/test/java/edu/wpi/first/wpilibj/kinematics/SwerveDriveKinematicsTest.java
index ba1c17efb5..ac949d5afc 100644
--- a/wpimath/src/test/java/edu/wpi/first/wpilibj/kinematics/SwerveDriveKinematicsTest.java
+++ b/wpimath/src/test/java/edu/wpi/first/wpilibj/kinematics/SwerveDriveKinematicsTest.java
@@ -203,7 +203,7 @@ class SwerveDriveKinematicsTest {
new SwerveModuleState(23.43, Rotation2d.fromDegrees(-39.81)),
new SwerveModuleState(54.08, Rotation2d.fromDegrees(-109.44)),
new SwerveModuleState(54.08, Rotation2d.fromDegrees(-70.56))
- };
+ };
var stateTolerance = new SwerveModuleState(0.1, Rotation2d.fromDegrees(0.1));
for (int i = 0; i < expectedStates.length; i++) {
diff --git a/wpimath/src/test/java/edu/wpi/first/wpilibj/kinematics/SwerveDriveOdometryTest.java b/wpimath/src/test/java/edu/wpi/first/wpilibj/kinematics/SwerveDriveOdometryTest.java
index 181c688564..775a1f7202 100644
--- a/wpimath/src/test/java/edu/wpi/first/wpilibj/kinematics/SwerveDriveOdometryTest.java
+++ b/wpimath/src/test/java/edu/wpi/first/wpilibj/kinematics/SwerveDriveOdometryTest.java
@@ -33,7 +33,7 @@ class SwerveDriveOdometryTest {
new SwerveModuleState(5, Rotation2d.fromDegrees(0)),
new SwerveModuleState(5, Rotation2d.fromDegrees(0)),
new SwerveModuleState(5, Rotation2d.fromDegrees(0))
- };
+ };
m_odometry.updateWithTime(0.0, new Rotation2d(),
new SwerveModuleState(), new SwerveModuleState(),
@@ -60,7 +60,7 @@ class SwerveDriveOdometryTest {
new SwerveModuleState(42.15, Rotation2d.fromDegrees(26.565)),
new SwerveModuleState(18.85, Rotation2d.fromDegrees(-90)),
new SwerveModuleState(42.15, Rotation2d.fromDegrees(-26.565))
- };
+ };
final var zero = new SwerveModuleState();
m_odometry.updateWithTime(0.0, new Rotation2d(), zero, zero, zero, zero);
diff --git a/wpiutil/src/main/java/edu/wpi/first/wpiutil/RuntimeLoader.java b/wpiutil/src/main/java/edu/wpi/first/wpiutil/RuntimeLoader.java
index 5c3bc9d0ff..fa3b086eec 100644
--- a/wpiutil/src/main/java/edu/wpi/first/wpiutil/RuntimeLoader.java
+++ b/wpiutil/src/main/java/edu/wpi/first/wpiutil/RuntimeLoader.java
@@ -51,12 +51,12 @@ public final class RuntimeLoader {
private String getLoadErrorMessage(UnsatisfiedLinkError ule) {
StringBuilder msg = new StringBuilder(512);
msg.append(m_libraryName)
- .append(" could not be loaded from path or an embedded resource.\n"
- + "\tattempted to load for platform ")
- .append(RuntimeDetector.getPlatformPath())
- .append("\nLast Load Error: \n")
- .append(ule.getMessage())
- .append('\n');
+ .append(" could not be loaded from path or an embedded resource.\n"
+ + "\tattempted to load for platform ")
+ .append(RuntimeDetector.getPlatformPath())
+ .append("\nLast Load Error: \n")
+ .append(ule.getMessage())
+ .append('\n');
if (RuntimeDetector.isWindows()) {
msg.append("A common cause of this error is missing the C++ runtime.\n"
+ "Download the latest at https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads\n");