Fix JDK 21 warnings (#6028)

This commit is contained in:
Tyler Veness
2023-12-09 21:45:02 -08:00
committed by GitHub
parent d40bdd70ba
commit 192a28af47
101 changed files with 164 additions and 57 deletions

View File

@@ -37,6 +37,7 @@ public class BangBangController implements Sendable {
*
* @param tolerance Tolerance for {@link #atSetpoint() atSetpoint}.
*/
@SuppressWarnings("this-escape")
public BangBangController(double tolerance) {
instances++;
@@ -89,7 +90,7 @@ public class BangBangController implements Sendable {
*
* @param tolerance Position error which is tolerable.
*/
public void setTolerance(double tolerance) {
public final void setTolerance(double tolerance) {
m_tolerance = tolerance;
}

View File

@@ -144,13 +144,13 @@ public class ControlAffinePlantInversionFeedforward<States extends Num, Inputs e
*
* @param initialState The initial state vector.
*/
public void reset(Matrix<States, N1> initialState) {
public final void reset(Matrix<States, N1> initialState) {
m_r = initialState;
m_uff.fill(0.0);
}
/** Resets the feedforward with a zero initial state vector. */
public void reset() {
public final void reset() {
m_r.fill(0.0);
m_uff.fill(0.0);
}

View File

@@ -99,7 +99,7 @@ public class ImplicitModelFollower<States extends Num, Inputs extends Num, Outpu
}
/** Resets the controller. */
public void reset() {
public final void reset() {
m_u.fill(0.0);
}

View File

@@ -105,13 +105,13 @@ public class LinearPlantInversionFeedforward<
*
* @param initialState The initial state vector.
*/
public void reset(Matrix<States, N1> initialState) {
public final void reset(Matrix<States, N1> initialState) {
m_r = initialState;
m_uff.fill(0.0);
}
/** Resets the feedforward with a zero initial state vector. */
public void reset() {
public final void reset() {
m_r.fill(0.0);
m_uff.fill(0.0);
}

View File

@@ -221,7 +221,7 @@ public class LinearQuadraticRegulator<States extends Num, Inputs extends Num, Ou
}
/** Resets the controller. */
public void reset() {
public final void reset() {
m_r.fill(0.0);
m_u.fill(0.0);
}

View File

@@ -81,6 +81,7 @@ public class PIDController implements Sendable, AutoCloseable {
* @param kd The derivative coefficient.
* @param period The period between controller updates in seconds. Must be non-zero and positive.
*/
@SuppressWarnings("this-escape")
public PIDController(double kp, double ki, double kd, double period) {
m_kp = kp;
m_ki = ki;

View File

@@ -50,6 +50,7 @@ public class ProfiledPIDController implements Sendable {
* @param constraints Velocity and acceleration constraints for goal.
* @param period The period between controller updates in seconds. The default is 0.02 seconds.
*/
@SuppressWarnings("this-escape")
public ProfiledPIDController(
double Kp, double Ki, double Kd, TrapezoidProfile.Constraints constraints, double period) {
m_controller = new PIDController(Kp, Ki, Kd, period);