diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/PrimitiveRules.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/PrimitiveRules.java index f39d4e991d..f2d9631c10 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/PrimitiveRules.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/PrimitiveRules.java @@ -192,72 +192,8 @@ int after(double d) { } } - /** Prefer {@link Boolean#compare(boolean, boolean)} over the Guava alternative. */ - static final class BooleanCompare { - @BeforeTemplate - int before(boolean a, boolean b) { - return Booleans.compare(a, b); - } - - @AfterTemplate - int after(boolean a, boolean b) { - return Boolean.compare(a, b); - } - } - - /** Prefer {@link Character#compare(char, char)} over the Guava alternative. */ - static final class CharacterCompare { - @BeforeTemplate - int before(char a, char b) { - return Chars.compare(a, b); - } - - @AfterTemplate - int after(char a, char b) { - return Character.compare(a, b); - } - } - - /** Prefer {@link Short#compare(short, short)} over the Guava alternative. */ - static final class ShortCompare { - @BeforeTemplate - int before(short a, short b) { - return Shorts.compare(a, b); - } - - @AfterTemplate - int after(short a, short b) { - return Short.compare(a, b); - } - } - - /** Prefer {@link Integer#compare(int, int)} over the Guava alternative. */ - static final class IntegerCompare { - @BeforeTemplate - int before(int a, int b) { - return Ints.compare(a, b); - } - - @AfterTemplate - int after(int a, int b) { - return Integer.compare(a, b); - } - } - - /** Prefer {@link Long#compare(long, long)} over the Guava alternative. */ - static final class LongCompare { - @BeforeTemplate - int before(long a, long b) { - return Longs.compare(a, b); - } - - @AfterTemplate - int after(long a, long b) { - return Long.compare(a, b); - } - } - /** Prefer {@link Float#compare(float, float)} over the Guava alternative. */ + // XXX: Drop this rule once https://github.com/google/guava/pull/7371 is released. static final class FloatCompare { @BeforeTemplate int before(float a, float b) { @@ -271,6 +207,7 @@ int after(float a, float b) { } /** Prefer {@link Double#compare(double, double)} over the Guava alternative. */ + // XXX: Drop this rule once https://github.com/google/guava/pull/7371 is released. static final class DoubleCompare { @BeforeTemplate int before(double a, double b) { diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/PrimitiveRulesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/PrimitiveRulesTestInput.java index cc1773c8d4..411e6ece76 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/PrimitiveRulesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/PrimitiveRulesTestInput.java @@ -105,26 +105,6 @@ int testDoubleHashCode() { return Doubles.hashCode(1); } - int testBooleanCompare() { - return Booleans.compare(false, true); - } - - int testCharacterCompare() { - return Chars.compare('a', 'b'); - } - - int testShortCompare() { - return Shorts.compare((short) 1, (short) 2); - } - - int testIntegerCompare() { - return Ints.compare(1, 2); - } - - int testLongCompare() { - return Longs.compare(1, 2); - } - int testFloatCompare() { return Floats.compare(1, 2); } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/PrimitiveRulesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/PrimitiveRulesTestOutput.java index cba9a1a93c..40526a9585 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/PrimitiveRulesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/PrimitiveRulesTestOutput.java @@ -105,26 +105,6 @@ int testDoubleHashCode() { return Double.hashCode(1); } - int testBooleanCompare() { - return Boolean.compare(false, true); - } - - int testCharacterCompare() { - return Character.compare('a', 'b'); - } - - int testShortCompare() { - return Short.compare((short) 1, (short) 2); - } - - int testIntegerCompare() { - return Integer.compare(1, 2); - } - - int testLongCompare() { - return Long.compare(1, 2); - } - int testFloatCompare() { return Float.compare(1, 2); } diff --git a/pom.xml b/pom.xml index f66773113f..34778729df 100644 --- a/pom.xml +++ b/pom.xml @@ -338,7 +338,7 @@ com.google.guava guava-bom - 33.2.1-jre + 33.3.0-jre pom import