mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Clean up Java warning suppressions (#4433)
Checkstyle naming conventions were changed to allow most of what's in wpimath. Naming rules were disabled completely in wpimath since almost all suppressions are for math notation.
This commit is contained in:
@@ -22,7 +22,7 @@ public class MockDS {
|
||||
data[5] = 0x00; // red 1 station
|
||||
}
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/** Start the mock DS thread. */
|
||||
public void start() {
|
||||
m_thread =
|
||||
new Thread(
|
||||
@@ -67,7 +67,7 @@ public class MockDS {
|
||||
m_thread.start();
|
||||
}
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/** Stop the mock DS thread. */
|
||||
public void stop() {
|
||||
if (m_thread == null) {
|
||||
return;
|
||||
|
||||
@@ -45,7 +45,12 @@ public class PDPTest extends AbstractComsSetup {
|
||||
me = null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/**
|
||||
* PDPTest constructor.
|
||||
*
|
||||
* @param mef Motor encoder fixture.
|
||||
* @param expectedCurrentDraw Expected current draw in Amps.
|
||||
*/
|
||||
public PDPTest(MotorEncoderFixture<?> mef, Double expectedCurrentDraw) {
|
||||
logger.fine("Constructor with: " + mef.getType());
|
||||
if (me != null && !me.equals(mef)) {
|
||||
|
||||
@@ -41,24 +41,32 @@ public class PIDTest extends AbstractComsSetup {
|
||||
private PIDController m_controller = null;
|
||||
private static MotorEncoderFixture<?> me = null;
|
||||
|
||||
@SuppressWarnings({"MemberName", "EmptyLineSeparator", "MultipleVariableDeclarations"})
|
||||
private final Double k_p, k_i, k_d;
|
||||
private final Double m_p;
|
||||
private final Double m_i;
|
||||
private final Double m_d;
|
||||
|
||||
@Override
|
||||
protected Logger getClassLogger() {
|
||||
return logger;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"ParameterName", "MissingJavadocMethod"})
|
||||
/**
|
||||
* PIDTest constructor.
|
||||
*
|
||||
* @param p P gain.
|
||||
* @param i I gain.
|
||||
* @param d D gain.
|
||||
* @param mef Motor encoder fixture.
|
||||
*/
|
||||
public PIDTest(Double p, Double i, Double d, MotorEncoderFixture<?> mef) {
|
||||
logger.fine("Constructor with: " + mef.getType());
|
||||
if (PIDTest.me != null && !PIDTest.me.equals(mef)) {
|
||||
PIDTest.me.teardown();
|
||||
}
|
||||
PIDTest.me = mef;
|
||||
this.k_p = p;
|
||||
this.k_i = i;
|
||||
this.k_d = d;
|
||||
this.m_p = p;
|
||||
this.m_i = i;
|
||||
this.m_d = d;
|
||||
}
|
||||
|
||||
@Parameters
|
||||
@@ -97,7 +105,7 @@ public class PIDTest extends AbstractComsSetup {
|
||||
m_table = NetworkTableInstance.getDefault().getTable("TEST_PID");
|
||||
m_builder = new SendableBuilderImpl();
|
||||
m_builder.setTable(m_table);
|
||||
m_controller = new PIDController(k_p, k_i, k_d);
|
||||
m_controller = new PIDController(m_p, m_i, m_d);
|
||||
m_controller.initSendable(m_builder);
|
||||
}
|
||||
|
||||
@@ -128,9 +136,9 @@ public class PIDTest extends AbstractComsSetup {
|
||||
m_controller.getPositionError(),
|
||||
0);
|
||||
m_builder.update();
|
||||
assertEquals(k_p, m_table.getEntry("Kp").getDouble(9999999), 0);
|
||||
assertEquals(k_i, m_table.getEntry("Ki").getDouble(9999999), 0);
|
||||
assertEquals(k_d, m_table.getEntry("Kd").getDouble(9999999), 0);
|
||||
assertEquals(m_p, m_table.getEntry("Kp").getDouble(9999999), 0);
|
||||
assertEquals(m_i, m_table.getEntry("Ki").getDouble(9999999), 0);
|
||||
assertEquals(m_d, m_table.getEntry("Kd").getDouble(9999999), 0);
|
||||
assertEquals(reference, m_table.getEntry("reference").getDouble(9999999), 0);
|
||||
assertFalse(m_table.getEntry("enabled").getBoolean(true));
|
||||
}
|
||||
|
||||
@@ -152,7 +152,6 @@ public abstract class MotorEncoderFixture<T extends MotorController> implements
|
||||
* deallocated.
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("Regexp")
|
||||
public void teardown() {
|
||||
if (!m_tornDown) {
|
||||
if (m_motor != null) {
|
||||
|
||||
@@ -122,8 +122,7 @@ class FirstSubSuiteTest {
|
||||
public static final String METHODNAME = "aTestMethod";
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("MethodName")
|
||||
public void aTestMethod() {}
|
||||
public void testMethod() {}
|
||||
}
|
||||
|
||||
@SuppressWarnings("OneTopLevelClass")
|
||||
|
||||
@@ -210,7 +210,7 @@ public final class TestBench {
|
||||
return pairs;
|
||||
}
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/** Returns the analog I/O cross-connect fixture. */
|
||||
public static AnalogCrossConnectFixture getAnalogCrossConnectFixture() {
|
||||
return new AnalogCrossConnectFixture() {
|
||||
@Override
|
||||
@@ -225,7 +225,7 @@ public final class TestBench {
|
||||
};
|
||||
}
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/** Returns the relay cross-connect fixture. */
|
||||
public static RelayCrossConnectFixture getRelayCrossConnectFixture() {
|
||||
return new RelayCrossConnectFixture() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user