Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-bom</artifactId>
<version>33.2.1-jre</version>
<version>33.3.0-jre</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down