Checkstyle 8.1 (#584)

Added a few checks too:
- SimplifyBooleanExpression
- SimplifyBooleanReturn
- StringLiteralEquality
- UnnecessaryParentheses
This commit is contained in:
Austin Shalit
2017-07-28 22:24:05 -07:00
committed by Peter Johnson
parent 3cfcbe9a95
commit ddd5aeba19
27 changed files with 68 additions and 37 deletions

View File

@@ -44,7 +44,7 @@ public class MotorEncoderTest extends AbstractComsSetup {
}
/**
* Constructs the test
* Constructs the test.
*
* @param mef The fixture under test.
*/

View File

@@ -161,21 +161,21 @@ public class PCMTest extends AbstractComsSetup {
Timer.delay(kSolenoidDelayTime);
assertTrue("Solenoid #1 did not turn off", fakeSolenoid1.get());
assertTrue("Solenoid #2 did not turn off", fakeSolenoid2.get());
assertTrue("DoubleSolenoid did not report off", (solenoid.get() == DoubleSolenoid.Value.kOff));
assertTrue("DoubleSolenoid did not report off", solenoid.get() == DoubleSolenoid.Value.kOff);
solenoid.set(DoubleSolenoid.Value.kForward);
Timer.delay(kSolenoidDelayTime);
assertFalse("Solenoid #1 did not turn on", fakeSolenoid1.get());
assertTrue("Solenoid #2 did not turn off", fakeSolenoid2.get());
assertTrue("DoubleSolenoid did not report Forward", (solenoid.get() == DoubleSolenoid.Value
.kForward));
assertTrue("DoubleSolenoid did not report Forward", solenoid.get() == DoubleSolenoid.Value
.kForward);
solenoid.set(DoubleSolenoid.Value.kReverse);
Timer.delay(kSolenoidDelayTime);
assertTrue("Solenoid #1 did not turn off", fakeSolenoid1.get());
assertFalse("Solenoid #2 did not turn on", fakeSolenoid2.get());
assertTrue("DoubleSolenoid did not report Reverse", (solenoid.get() == DoubleSolenoid.Value
.kReverse));
assertTrue("DoubleSolenoid did not report Reverse", solenoid.get() == DoubleSolenoid.Value
.kReverse);
solenoid.free();
}

View File

@@ -139,7 +139,7 @@ public abstract class MotorEncoderFixture<T extends SpeedController> implements
*/
public boolean isMotorSpeedWithinRange(double value, double accuracy) {
initialize();
return Math.abs((Math.abs(m_motor.get()) - Math.abs(value))) < Math.abs(accuracy);
return Math.abs(Math.abs(m_motor.get()) - Math.abs(value)) < Math.abs(accuracy);
}
@Override

View File

@@ -23,7 +23,7 @@ import java.io.File;
public class AntJunitLanucher {
/**
* Main entry point for jenkins
* Main entry point for jenkins.
*
* @param args Arguments passed to java.
*/

View File

@@ -343,7 +343,7 @@ public final class TestBench {
false));
encoderPortPairs.addAll(getPairArray(getDIOCrossConnect().get(1), getDIOCrossConnect().get(0),
false));
assert (encoderPortPairs.size() == 8);
assert encoderPortPairs.size() == 8;
return encoderPortPairs;
}

View File

@@ -153,7 +153,7 @@ public class TestSuite extends AbstractTestSuite {
/**
* Parses the arguments passed at runtime and runs the appropriate tests based upon these
* arguments
* arguments.
*
* @param args the args passed into the program at runtime
* @return the restults of the tests that have run. If no tests were run then null is returned.