From dce6db6c593d830bb4a4b6289468c044b3f2c913 Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Wed, 7 Dec 2022 13:48:04 +0100 Subject: [PATCH] Rename rule --- .../tech/picnic/errorprone/refasterrules/BigDecimalRules.java | 2 +- .../errorprone/refasterrules/BigDecimalRulesTestInput.java | 2 +- .../errorprone/refasterrules/BigDecimalRulesTestOutput.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/BigDecimalRules.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/BigDecimalRules.java index 07db497a45..08e3878fa5 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/BigDecimalRules.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/BigDecimalRules.java @@ -54,7 +54,7 @@ BigDecimal after() { // XXX: Ideally we also rewrite `new BigDecimal("")` in cases where the // specified number can be represented as an `int` or `long`, but that requires a custom // `BugChecker`. - static final class BigDecimalFactoryMethod { + static final class BigDecimalValueOf { @BeforeTemplate BigDecimal before(double value) { return new BigDecimal(value); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/BigDecimalRulesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/BigDecimalRulesTestInput.java index 4d60c6339e..4f6a02bfe5 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/BigDecimalRulesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/BigDecimalRulesTestInput.java @@ -17,7 +17,7 @@ ImmutableSet testBigDecimalTen() { return ImmutableSet.of(BigDecimal.valueOf(10), BigDecimal.valueOf(10L), new BigDecimal("10")); } - ImmutableSet testBigDecimalFactoryMethod() { + ImmutableSet testBigDecimalValueOf() { return ImmutableSet.of(new BigDecimal(2), new BigDecimal(2L), new BigDecimal(2.0)); } } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/BigDecimalRulesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/BigDecimalRulesTestOutput.java index 4579ed4bea..37c226eb7a 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/BigDecimalRulesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/BigDecimalRulesTestOutput.java @@ -17,7 +17,7 @@ ImmutableSet testBigDecimalTen() { return ImmutableSet.of(BigDecimal.TEN, BigDecimal.TEN, BigDecimal.TEN); } - ImmutableSet testBigDecimalFactoryMethod() { + ImmutableSet testBigDecimalValueOf() { return ImmutableSet.of(BigDecimal.valueOf(2), BigDecimal.valueOf(2L), BigDecimal.valueOf(2.0)); } }