AssertJIntegerRules
SUGGESTION
Simplification
Suppression
Disable all rules by adding
-XepOpt:Refaster:NamePattern=^(?!AssertJIntegerRules\$).*as compiler argument.
Table of contents
AbstractIntegerAssertIsEqualTo
SUGGESTION
Simplification
Suppression
Suppress false positives by adding the suppression annotation
@SuppressWarnings("AbstractIntegerAssertIsEqualTo")to the enclosing element.Disable this rule by adding
-XepOpt:Refaster:NamePattern=^(?!AssertJIntegerRules\$AbstractIntegerAssertIsEqualTo).*as compiler argument.
Samples
Shows the difference in example code before and after the Refaster rule is applied.
ImmutableSet<AbstractIntegerAssert<?>> testAbstractIntegerAssertIsEqualTo() {
- return ImmutableSet.of(
- assertThat(0).isCloseTo(1, offset(0)), assertThat(0).isCloseTo(1, withPercentage(0)));
+ return ImmutableSet.of(assertThat(0).isEqualTo(1), assertThat(0).isEqualTo(1));
}AbstractIntegerAssertIsNotEqualTo
SUGGESTION
Simplification
Suppression
Suppress false positives by adding the suppression annotation
@SuppressWarnings("AbstractIntegerAssertIsNotEqualTo")to the enclosing element.Disable this rule by adding
-XepOpt:Refaster:NamePattern=^(?!AssertJIntegerRules\$AbstractIntegerAssertIsNotEqualTo).*as compiler argument.
Samples
Shows the difference in example code before and after the Refaster rule is applied.
ImmutableSet<AbstractIntegerAssert<?>> testAbstractIntegerAssertIsNotEqualTo() {
- return ImmutableSet.of(
- assertThat(0).isNotCloseTo(1, offset(0)), assertThat(0).isNotCloseTo(1, withPercentage(0)));
+ return ImmutableSet.of(assertThat(0).isNotEqualTo(1), assertThat(0).isNotEqualTo(1));
}AbstractIntegerAssertIsZero
SUGGESTION
Simplification
Suppression
Suppress false positives by adding the suppression annotation
@SuppressWarnings("AbstractIntegerAssertIsZero")to the enclosing element.Disable this rule by adding
-XepOpt:Refaster:NamePattern=^(?!AssertJIntegerRules\$AbstractIntegerAssertIsZero).*as compiler argument.
Samples
Shows the difference in example code before and after the Refaster rule is applied.
AbstractIntegerAssert<?> testAbstractIntegerAssertIsZero() {
- return assertThat(0).isZero();
+ return assertThat(0).isEqualTo(0);
}AbstractIntegerAssertIsNotZero
SUGGESTION
Simplification
Suppression
Suppress false positives by adding the suppression annotation
@SuppressWarnings("AbstractIntegerAssertIsNotZero")to the enclosing element.Disable this rule by adding
-XepOpt:Refaster:NamePattern=^(?!AssertJIntegerRules\$AbstractIntegerAssertIsNotZero).*as compiler argument.
Samples
Shows the difference in example code before and after the Refaster rule is applied.
AbstractIntegerAssert<?> testAbstractIntegerAssertIsNotZero() {
- return assertThat(0).isNotZero();
+ return assertThat(0).isNotEqualTo(0);
}AbstractIntegerAssertIsOne
SUGGESTION
Simplification
Suppression
Suppress false positives by adding the suppression annotation
@SuppressWarnings("AbstractIntegerAssertIsOne")to the enclosing element.Disable this rule by adding
-XepOpt:Refaster:NamePattern=^(?!AssertJIntegerRules\$AbstractIntegerAssertIsOne).*as compiler argument.
Samples
Shows the difference in example code before and after the Refaster rule is applied.
AbstractIntegerAssert<?> testAbstractIntegerAssertIsOne() {
- return assertThat(0).isOne();
+ return assertThat(0).isEqualTo(1);
}