Enforce leading/trailing zeros in Java numeric constants (#2105)

Enforce that integer literals must not have leading zeros and that floating point literals must have leading or trailing zeros in Java.
This commit is contained in:
Austin Shalit
2019-11-20 23:13:15 -05:00
committed by Peter Johnson
parent fa85fbfc1c
commit 4ebae17123
40 changed files with 92 additions and 72 deletions

View File

@@ -124,7 +124,7 @@ public class ProfiledPIDCommand extends CommandBase {
@Override
public void end(boolean interrupted) {
m_useOutput.accept(0., new State());
m_useOutput.accept(0.0, new State());
}
/**

View File

@@ -30,7 +30,7 @@ public abstract class TrapezoidProfileSubsystem extends SubsystemBase {
double initialPosition) {
m_constraints = constraints;
m_state = new TrapezoidProfile.State(initialPosition, 0);
m_period = .02;
m_period = 0.02;
}
/**

View File

@@ -23,10 +23,10 @@ class NotifierCommandTest extends CommandTestBase {
Counter counter = new Counter();
NotifierCommand command = new NotifierCommand(counter::increment, .01);
NotifierCommand command = new NotifierCommand(counter::increment, 0.01);
scheduler.schedule(command);
Timer.delay(.25);
Timer.delay(0.25);
scheduler.cancel(command);
assertTrue(counter.m_counter > 10, "Should have hit at least 10 triggers");