diff --git a/build.gradle b/build.gradle index d2ecfb9781..c424857a39 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,15 @@ +buildscript { + repositories { + maven { + url "https://plugins.gradle.org/m2/" + } + } + + dependencies { + classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.8' + } +} + def enableSimulation = hasProperty('enableSimulation') if (!hasProperty('repo')) { diff --git a/wpilibj/build.gradle b/wpilibj/build.gradle index b899bd16cd..b15d6d8d59 100644 --- a/wpilibj/build.gradle +++ b/wpilibj/build.gradle @@ -1,5 +1,10 @@ apply plugin: 'java' apply plugin: 'maven-publish' +apply plugin: 'net.ltgt.errorprone' + +configurations.errorprone { + resolutionStrategy.force 'com.google.errorprone:error_prone_core:2.0.9' +} sourceSets { shared diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CANJaguar.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CANJaguar.java index 7dab0d8974..e1b44f23a9 100644 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CANJaguar.java +++ b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CANJaguar.java @@ -2255,6 +2255,7 @@ public class CANJaguar implements MotorSafety, PIDOutput, CANSpeedController { * @deprecated Use disableControl instead. */ @Override + @Deprecated public void stopMotor() { disableControl(); m_stopped = true; diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CANTalon.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CANTalon.java index 547b928e2e..1af15907fc 100644 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CANTalon.java +++ b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CANTalon.java @@ -1255,6 +1255,7 @@ public class CANTalon implements MotorSafety, PIDOutput, PIDSource, CANSpeedCont * @deprecated Use disableControl instead. */ @Override + @Deprecated public void stopMotor() { disableControl(); m_stopped = true; diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Encoder.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Encoder.java index 4937cc9106..c50af11376 100644 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Encoder.java +++ b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Encoder.java @@ -426,6 +426,7 @@ public class Encoder extends SensorBase implements CounterBase, PIDSource, LiveW * @return Period in seconds of the most recent pulse. * @deprecated Use getRate() in favor of this method. */ + @Deprecated public double getPeriod() { double measuredPeriod; if (m_counter != null) { diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/PWM.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/PWM.java index 8b82401447..88dc2abcd3 100644 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/PWM.java +++ b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/PWM.java @@ -172,6 +172,7 @@ public class PWM extends SensorBase implements LiveWindowSendable { * @deprecated Recommended to set bounds in ms using {@link #setBounds(double, double, double, * double, double)} */ + @Deprecated public void setBounds(final int max, final int deadbandMax, final int center, final int deadbandMin, final int min) { m_maxPwm = max; diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Preferences.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Preferences.java index 626a38fcdb..0a0d160bb3 100644 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Preferences.java +++ b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Preferences.java @@ -273,6 +273,7 @@ public class Preferences { * * @deprecated backwards compatibility shim */ + @Deprecated public void save() { } } diff --git a/wpilibj/src/shared/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.java b/wpilibj/src/shared/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.java index 61cc21eb11..ea16b7b21b 100644 --- a/wpilibj/src/shared/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.java +++ b/wpilibj/src/shared/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.java @@ -224,6 +224,7 @@ public class SmartDashboard { * @throws IllegalArgumentException if key is null * @deprecated Use {@link #putNumber(java.lang.String, double) putNumber method} instead */ + @Deprecated public static void putInt(String key, int value) { table.putNumber(key, value); } @@ -238,6 +239,7 @@ public class SmartDashboard { * @throws IllegalArgumentException if the key is null * @deprecated Use {@link #getNumber(java.lang.String) getNumber} instead */ + @Deprecated public static int getInt(String key) throws TableKeyNotDefinedException { return (int) table.getNumber(key); } @@ -253,6 +255,7 @@ public class SmartDashboard { * @throws IllegalArgumentException if the key is null * @deprecated Use {@link #getNumber(java.lang.String, double) getNumber} instead */ + @Deprecated public static int getInt(String key, int defaultValue) throws TableKeyNotDefinedException { try { return (int) table.getNumber(key); @@ -272,6 +275,7 @@ public class SmartDashboard { * @throws IllegalArgumentException if key is null * @deprecated Use{@link #putNumber(java.lang.String, double) putNumber} instead */ + @Deprecated public static void putDouble(String key, double value) { table.putNumber(key, value); } @@ -286,6 +290,7 @@ public class SmartDashboard { * @throws IllegalArgumentException if the key is null * @deprecated Use {@link #getNumber(java.lang.String) getNumber} instead */ + @Deprecated public static double getDouble(String key) throws TableKeyNotDefinedException { return table.getNumber(key); } @@ -300,6 +305,7 @@ public class SmartDashboard { * @throws IllegalArgumentException if the key is null * @deprecated Use {@link #getNumber(java.lang.String, double) getNumber} instead. */ + @Deprecated public static double getDouble(String key, double defaultValue) { return table.getNumber(key, defaultValue); } diff --git a/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Encoder.java b/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Encoder.java index b6b1674e18..fc79879ef2 100644 --- a/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Encoder.java +++ b/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Encoder.java @@ -188,6 +188,7 @@ public class Encoder extends SensorBase implements CounterBase, PIDSource, LiveW * @return Period in seconds of the most recent pulse. * @deprecated Use getRate() in favor of this method. This returns unscale */ + @Deprecated public double getPeriod() { throw new UnsupportedOperationException("Simulation doesn't currently support this method."); } diff --git a/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Jaguar.java b/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Jaguar.java index 43516da871..b2b41a2ed9 100644 --- a/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Jaguar.java +++ b/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Jaguar.java @@ -54,6 +54,7 @@ public class Jaguar implements SpeedController, PIDOutput, MotorSafety, LiveWind * The PWM value is set using a range of -1.0 to 1.0, appropriately scaling the value for the * FPGA. */ + @Deprecated public void set(double speed, byte syncGroup) { impl.set(speed, syncGroup); } diff --git a/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Preferences.java b/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Preferences.java index 7073a6aa78..1df80a6568 100644 --- a/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Preferences.java +++ b/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Preferences.java @@ -675,7 +675,7 @@ public class Preferences { synchronized (lock) { if (!ImproperPreferenceKeyException.isAcceptable(key) || value.toString().indexOf ('"') != -1) { - if (values.contains(key) || keys.contains(key)) { + if (values.containsKey(key) || keys.contains(key)) { values.remove(key); keys.removeElement(key); NetworkTable.getTable(TABLE_NAME).putString(key, "\""); diff --git a/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Servo.java b/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Servo.java index a1bc141f71..88774b0dc8 100644 --- a/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Servo.java +++ b/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Servo.java @@ -50,6 +50,7 @@ public class Servo implements SpeedController, LiveWindowSendable { * @deprecated The PWM value is set using a range of -1.0 to 1.0, appropriately scaling the value * for the FPGA. */ + @Deprecated public void set(double speed, byte syncGroup) { impl.set(speed, syncGroup); } diff --git a/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Talon.java b/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Talon.java index 2b21aa2fdd..ef14c82af1 100644 --- a/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Talon.java +++ b/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Talon.java @@ -64,6 +64,7 @@ public class Talon implements SpeedController, PIDOutput, MotorSafety, LiveWindo * update immediately. * @deprecated For compatibility with CANJaguar */ + @Deprecated public void set(double speed, byte syncGroup) { m_impl.set(speed, syncGroup); } diff --git a/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Victor.java b/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Victor.java index a1e794577d..3ff9a0f3a2 100644 --- a/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Victor.java +++ b/wpilibj/src/sim/java/edu/wpi/first/wpilibj/Victor.java @@ -66,6 +66,7 @@ public class Victor implements SpeedController, PIDOutput, MotorSafety, LiveWind * update immediately. * @deprecated For compatibility with CANJaguar. */ + @Deprecated public void set(double speed, byte syncGroup) { m_impl.set(speed, syncGroup); } diff --git a/wpilibj/src/sim/java/edu/wpi/first/wpilibj/internal/SimTimer.java b/wpilibj/src/sim/java/edu/wpi/first/wpilibj/internal/SimTimer.java index 4850ec1ff1..9dbce1a894 100644 --- a/wpilibj/src/sim/java/edu/wpi/first/wpilibj/internal/SimTimer.java +++ b/wpilibj/src/sim/java/edu/wpi/first/wpilibj/internal/SimTimer.java @@ -101,6 +101,7 @@ public class SimTimer implements Timer.StaticInterface { * @return Robot running time in milliseconds. * @deprecated Use getFPGATimestamp instead. */ + @Deprecated private double getMsClock() { return (simTime * 1e3); } diff --git a/wpilibj/src/sim/java/edu/wpi/first/wpilibj/simulation/SimSpeedController.java b/wpilibj/src/sim/java/edu/wpi/first/wpilibj/simulation/SimSpeedController.java index 2c90836b6a..e78c8d7f81 100644 --- a/wpilibj/src/sim/java/edu/wpi/first/wpilibj/simulation/SimSpeedController.java +++ b/wpilibj/src/sim/java/edu/wpi/first/wpilibj/simulation/SimSpeedController.java @@ -37,6 +37,7 @@ public class SimSpeedController { * update immediately. * @deprecated For compatibility with CANJaguar */ + @Deprecated public void set(double speed, byte syncGroup) { set(speed); } diff --git a/wpilibjIntegrationTests/build.gradle b/wpilibjIntegrationTests/build.gradle index f12e91155f..a4b532d351 100644 --- a/wpilibjIntegrationTests/build.gradle +++ b/wpilibjIntegrationTests/build.gradle @@ -1,6 +1,11 @@ apply plugin: 'java' apply plugin: 'application' apply plugin: 'com.github.johnrengelman.shadow' +apply plugin: 'net.ltgt.errorprone' + +configurations.errorprone { + resolutionStrategy.force 'com.google.errorprone:error_prone_core:2.0.9' +} evaluationDependsOn(':wpilibj')