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 ce4b3a35bb..e579674354 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 @@ -1,7 +1,5 @@ package tech.picnic.errorprone.refasterrules; -import com.google.common.primitives.Booleans; -import com.google.common.primitives.Bytes; import com.google.common.primitives.Chars; import com.google.common.primitives.Doubles; import com.google.common.primitives.Floats; @@ -95,110 +93,6 @@ int after(long l) { } } - /** Prefer {@link Boolean#hashCode(boolean)} over the Guava alternative. */ - static final class BooleanHashCode { - @BeforeTemplate - int before(boolean b) { - return Booleans.hashCode(b); - } - - @AfterTemplate - int after(boolean b) { - return Boolean.hashCode(b); - } - } - - /** Prefer {@link Byte#hashCode(byte)} over the Guava alternative. */ - static final class ByteHashCode { - @BeforeTemplate - int before(byte b) { - return Bytes.hashCode(b); - } - - @AfterTemplate - int after(byte b) { - return Byte.hashCode(b); - } - } - - /** Prefer {@link Character#hashCode(char)} over the Guava alternative. */ - static final class CharacterHashCode { - @BeforeTemplate - int before(char c) { - return Chars.hashCode(c); - } - - @AfterTemplate - int after(char c) { - return Character.hashCode(c); - } - } - - /** Prefer {@link Short#hashCode(short)} over the Guava alternative. */ - static final class ShortHashCode { - @BeforeTemplate - int before(short s) { - return Shorts.hashCode(s); - } - - @AfterTemplate - int after(short s) { - return Short.hashCode(s); - } - } - - /** Prefer {@link Integer#hashCode(int)} over the Guava alternative. */ - static final class IntegerHashCode { - @BeforeTemplate - int before(int i) { - return Ints.hashCode(i); - } - - @AfterTemplate - int after(int i) { - return Integer.hashCode(i); - } - } - - /** Prefer {@link Long#hashCode(long)} over the Guava alternative. */ - static final class LongHashCode { - @BeforeTemplate - int before(long l) { - return Longs.hashCode(l); - } - - @AfterTemplate - int after(long l) { - return Long.hashCode(l); - } - } - - /** Prefer {@link Float#hashCode(float)} over the Guava alternative. */ - static final class FloatHashCode { - @BeforeTemplate - int before(float f) { - return Floats.hashCode(f); - } - - @AfterTemplate - int after(float f) { - return Float.hashCode(f); - } - } - - /** Prefer {@link Double#hashCode(double)} over the Guava alternative. */ - static final class DoubleHashCode { - @BeforeTemplate - int before(double d) { - return Doubles.hashCode(d); - } - - @AfterTemplate - int after(double d) { - return Double.hashCode(d); - } - } - /** Prefer {@link Character#BYTES} over the Guava alternative. */ static final class CharacterBytes { @BeforeTemplate @@ -277,32 +171,6 @@ int after() { } } - /** Prefer {@link Float#isFinite(float)} over the Guava alternative. */ - static final class FloatIsFinite { - @BeforeTemplate - boolean before(float f) { - return Floats.isFinite(f); - } - - @AfterTemplate - boolean after(float f) { - return Float.isFinite(f); - } - } - - /** Prefer {@link Double#isFinite(double)} over the Guava alternative. */ - static final class DoubleIsFinite { - @BeforeTemplate - boolean before(double d) { - return Doubles.isFinite(d); - } - - @AfterTemplate - boolean after(double d) { - return Double.isFinite(d); - } - } - /** Prefer an {@link Integer#signum(int)} comparison to 1 over less clear alternatives. */ static final class IntegerSignumIsPositive { @BeforeTemplate 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 3d045f1e66..d224efc67a 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 @@ -80,38 +80,6 @@ int testLongToIntExact() { return Ints.checkedCast(Long.MAX_VALUE); } - int testBooleanHashCode() { - return Booleans.hashCode(true); - } - - int testByteHashCode() { - return Bytes.hashCode((byte) 1); - } - - int testCharacterHashCode() { - return Chars.hashCode('a'); - } - - int testShortHashCode() { - return Shorts.hashCode((short) 1); - } - - int testIntegerHashCode() { - return Ints.hashCode(1); - } - - int testLongHashCode() { - return Longs.hashCode(1); - } - - int testFloatHashCode() { - return Floats.hashCode(1); - } - - int testDoubleHashCode() { - return Doubles.hashCode(1); - } - int testCharacterBytes() { return Chars.BYTES; } @@ -136,14 +104,6 @@ int testDoubleBytes() { return Doubles.BYTES; } - boolean testFloatIsFinite() { - return Floats.isFinite(1); - } - - boolean testDoubleIsFinite() { - return Doubles.isFinite(1); - } - ImmutableSet testIntegerSignumIsPositive() { return ImmutableSet.of( Integer.signum(1) > 0, 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 404738efc0..22b39a7b00 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 @@ -81,38 +81,6 @@ int testLongToIntExact() { return Math.toIntExact(Long.MAX_VALUE); } - int testBooleanHashCode() { - return Boolean.hashCode(true); - } - - int testByteHashCode() { - return Byte.hashCode((byte) 1); - } - - int testCharacterHashCode() { - return Character.hashCode('a'); - } - - int testShortHashCode() { - return Short.hashCode((short) 1); - } - - int testIntegerHashCode() { - return Integer.hashCode(1); - } - - int testLongHashCode() { - return Long.hashCode(1); - } - - int testFloatHashCode() { - return Float.hashCode(1); - } - - int testDoubleHashCode() { - return Double.hashCode(1); - } - int testCharacterBytes() { return Character.BYTES; } @@ -137,14 +105,6 @@ int testDoubleBytes() { return Double.BYTES; } - boolean testFloatIsFinite() { - return Float.isFinite(1); - } - - boolean testDoubleIsFinite() { - return Double.isFinite(1); - } - ImmutableSet testIntegerSignumIsPositive() { return ImmutableSet.of( Integer.signum(1) == 1, diff --git a/integration-tests/metrics-init.patch b/integration-tests/metrics-init.patch index 9a48e53c24..6cd39bbd46 100644 --- a/integration-tests/metrics-init.patch +++ b/integration-tests/metrics-init.patch @@ -38,7 +38,7 @@ + + com.google.guava + guava -+ 33.4.8-jre ++ 33.5.0-jre + + + diff --git a/pom.xml b/pom.xml index 1d008ae240..b4ff359462 100644 --- a/pom.xml +++ b/pom.xml @@ -346,7 +346,7 @@ com.google.guava guava-bom - 33.4.8-jre + 33.5.0-jre pom import