mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Adds Error Prone as compile time check to java projects (#13)
This commit is contained in:
committed by
Peter Johnson
parent
a834fff7b2
commit
975568c774
12
build.gradle
12
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')) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2255,6 +2255,7 @@ public class CANJaguar implements MotorSafety, PIDOutput, CANSpeedController {
|
||||
* @deprecated Use disableControl instead.
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public void stopMotor() {
|
||||
disableControl();
|
||||
m_stopped = true;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -273,6 +273,7 @@ public class Preferences {
|
||||
*
|
||||
* @deprecated backwards compatibility shim
|
||||
*/
|
||||
@Deprecated
|
||||
public void save() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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, "\"");
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ public class SimSpeedController {
|
||||
* update immediately.
|
||||
* @deprecated For compatibility with CANJaguar
|
||||
*/
|
||||
@Deprecated
|
||||
public void set(double speed, byte syncGroup) {
|
||||
set(speed);
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user