AssertJFloatRules

SUGGESTION

Simplification

View source code on GitHub

Suppression

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

Table of contents
  1. AbstractFloatAssertIsCloseToWithOffset
  2. AbstractFloatAssertIsEqualTo
  3. AbstractFloatAssertIsNotEqualTo
  4. AbstractFloatAssertIsZero
  5. AbstractFloatAssertIsNotZero
  6. AbstractFloatAssertIsOne

AbstractFloatAssertIsCloseToWithOffset

SUGGESTION

Simplification

Suppression

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

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

Samples

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

 ImmutableSet<AbstractFloatAssert<?>> testAbstractFloatAssertIsCloseToWithOffset() {
   return ImmutableSet.of(
-      assertThat(0f).isEqualTo(1, offset(0f)),
-      assertThat(0f).isEqualTo(Float.valueOf(1), offset(0f)));
+      assertThat(0f).isCloseTo(1, offset(0f)),
+      assertThat(0f).isCloseTo(Float.valueOf(1), offset(0f)));
 }

AbstractFloatAssertIsEqualTo

SUGGESTION

Simplification

Suppression

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

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

Samples

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

 ImmutableSet<AbstractFloatAssert<?>> testAbstractFloatAssertIsEqualTo() {
-  return ImmutableSet.of(
-      assertThat(0f).isCloseTo(1, offset(0f)), assertThat(0f).isCloseTo(1, withPercentage(0)));
+  return ImmutableSet.of(assertThat(0f).isEqualTo(1), assertThat(0f).isEqualTo(1));
 }

AbstractFloatAssertIsNotEqualTo

SUGGESTION

Simplification

Suppression

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

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

Samples

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

 ImmutableSet<AbstractFloatAssert<?>> testAbstractFloatAssertIsNotEqualTo() {
-  return ImmutableSet.of(
-      assertThat(0f).isNotCloseTo(1, offset(0f)),
-      assertThat(0f).isNotCloseTo(1, withPercentage(0)));
+  return ImmutableSet.of(assertThat(0f).isNotEqualTo(1), assertThat(0f).isNotEqualTo(1));
 }

AbstractFloatAssertIsZero

SUGGESTION

Simplification

Suppression

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

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

Samples

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

 AbstractFloatAssert<?> testAbstractFloatAssertIsZero() {
-  return assertThat(0f).isZero();
+  return assertThat(0f).isEqualTo(0);
 }

AbstractFloatAssertIsNotZero

SUGGESTION

Simplification

Suppression

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

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

Samples

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

 AbstractFloatAssert<?> testAbstractFloatAssertIsNotZero() {
-  return assertThat(0f).isNotZero();
+  return assertThat(0f).isNotEqualTo(0);
 }

AbstractFloatAssertIsOne

SUGGESTION

Simplification

Suppression

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

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

Samples

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

 AbstractFloatAssert<?> testAbstractFloatAssertIsOne() {
-  return assertThat(0f).isOne();
+  return assertThat(0f).isEqualTo(1);
 }

Copyright © 2017-2026 Picnic Technologies BV