AssertJBigIntegerRules

SUGGESTION

Simplification

View source code on GitHub

Suppression

Disable all rules by adding -XepOpt:Refaster:NamePattern=^(?!AssertJBigIntegerRules\$).* as compiler argument.

Table of contents
  1. AbstractBigIntegerAssertIsEqualTo
  2. AbstractBigIntegerAssertIsNotEqualTo
  3. AbstractBigIntegerAssertIsZero
  4. AbstractBigIntegerAssertIsNotZero
  5. AbstractBigIntegerAssertIsOne

AbstractBigIntegerAssertIsEqualTo

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AbstractBigIntegerAssertIsEqualTo") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!AssertJBigIntegerRules\$AbstractBigIntegerAssertIsEqualTo).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<AbstractBigIntegerAssert<?>> testAbstractBigIntegerAssertIsEqualTo() {
   return ImmutableSet.of(
-      assertThat(BigInteger.ZERO).isCloseTo(BigInteger.ONE, offset(BigInteger.ZERO)),
-      assertThat(BigInteger.ZERO).isCloseTo(BigInteger.ONE, withPercentage(0)));
+      assertThat(BigInteger.ZERO).isEqualTo(BigInteger.ONE),
+      assertThat(BigInteger.ZERO).isEqualTo(BigInteger.ONE));
 }

AbstractBigIntegerAssertIsNotEqualTo

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AbstractBigIntegerAssertIsNotEqualTo") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!AssertJBigIntegerRules\$AbstractBigIntegerAssertIsNotEqualTo).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<AbstractBigIntegerAssert<?>> testAbstractBigIntegerAssertIsNotEqualTo() {
   return ImmutableSet.of(
-      assertThat(BigInteger.ZERO).isNotCloseTo(BigInteger.ONE, offset(BigInteger.ZERO)),
-      assertThat(BigInteger.ZERO).isNotCloseTo(BigInteger.ONE, withPercentage(0)));
+      assertThat(BigInteger.ZERO).isNotEqualTo(BigInteger.ONE),
+      assertThat(BigInteger.ZERO).isNotEqualTo(BigInteger.ONE));
 }

AbstractBigIntegerAssertIsZero

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AbstractBigIntegerAssertIsZero") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!AssertJBigIntegerRules\$AbstractBigIntegerAssertIsZero).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<AbstractBigIntegerAssert<?>> testAbstractBigIntegerAssertIsZero() {
   return ImmutableSet.of(
-      assertThat(BigInteger.ZERO).isZero(),
-      assertThat(BigInteger.ZERO).isEqualTo(0L),
-      assertThat(BigInteger.ZERO).isEqualTo(BigInteger.ZERO));
+      assertThat(BigInteger.ZERO).isEqualTo(0),
+      assertThat(BigInteger.ZERO).isEqualTo(0),
+      assertThat(BigInteger.ZERO).isEqualTo(0));
 }

AbstractBigIntegerAssertIsNotZero

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AbstractBigIntegerAssertIsNotZero") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!AssertJBigIntegerRules\$AbstractBigIntegerAssertIsNotZero).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<AbstractBigIntegerAssert<?>> testAbstractBigIntegerAssertIsNotZero() {
   return ImmutableSet.of(
-      assertThat(BigInteger.ZERO).isNotZero(),
-      assertThat(BigInteger.ZERO).isNotEqualTo(0L),
-      assertThat(BigInteger.ZERO).isNotEqualTo(BigInteger.ZERO));
+      assertThat(BigInteger.ZERO).isNotEqualTo(0),
+      assertThat(BigInteger.ZERO).isNotEqualTo(0),
+      assertThat(BigInteger.ZERO).isNotEqualTo(0));
 }

AbstractBigIntegerAssertIsOne

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AbstractBigIntegerAssertIsOne") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!AssertJBigIntegerRules\$AbstractBigIntegerAssertIsOne).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<AbstractBigIntegerAssert<?>> testAbstractBigIntegerAssertIsOne() {
   return ImmutableSet.of(
-      assertThat(BigInteger.ZERO).isOne(),
-      assertThat(BigInteger.ZERO).isEqualTo(1L),
-      assertThat(BigInteger.ZERO).isEqualTo(BigInteger.ONE));
+      assertThat(BigInteger.ZERO).isEqualTo(1),
+      assertThat(BigInteger.ZERO).isEqualTo(1),
+      assertThat(BigInteger.ZERO).isEqualTo(1));
 }

Copyright © 2017-2024 Picnic Technologies BV