Adds Error Prone as compile time check to java projects (#13)

This commit is contained in:
Jonathan Leitschuh
2016-05-20 13:48:41 -04:00
committed by Peter Johnson
parent a834fff7b2
commit 975568c774
17 changed files with 41 additions and 1 deletions

View File

@@ -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')) {

View File

@@ -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

View File

@@ -2255,6 +2255,7 @@ public class CANJaguar implements MotorSafety, PIDOutput, CANSpeedController {
* @deprecated Use disableControl instead.
*/
@Override
@Deprecated
public void stopMotor() {
disableControl();
m_stopped = true;

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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;

View File

@@ -273,6 +273,7 @@ public class Preferences {
*
* @deprecated backwards compatibility shim
*/
@Deprecated
public void save() {
}
}

View File

@@ -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);
}

View File

@@ -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.");
}

View File

@@ -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);
}

View File

@@ -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, "\"");

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -37,6 +37,7 @@ public class SimSpeedController {
* update immediately.
* @deprecated For compatibility with CANJaguar
*/
@Deprecated
public void set(double speed, byte syncGroup) {
set(speed);
}

View File

@@ -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')