-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade OpenRewrite Templating 1.20.0 -> 1.20.1 #1474
Conversation
Suggested commit message:
|
45167f2
to
df0ec77
Compare
Looks good. No mutations were possible for these changes. |
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below is the diff relative to before #1470. Assuming that the recipes now cover more @BeforeTemplate
branches, this likely makes sense ✔️. (Again, didn't investigate more deeply.) CC @jevanlingen and @timtebeek.
Changes relative to f212e94
diff -u -r AssertJBigIntegerRulesRecipes.java AssertJBigIntegerRulesRecipes.java
--- AssertJBigIntegerRulesRecipes.java 2024-12-22 11:47:37.993024925 +0100
+++ AssertJBigIntegerRulesRecipes.java 2024-12-22 11:47:44.766052569 +0100
@@ -288,8 +288,8 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
Preconditions.or(
- new UsesMethod<>("org.assertj.core.api.AbstractBigIntegerAssert isZero(..)", true),
new UsesMethod<>("org.assertj.core.api.AbstractBigIntegerAssert isEqualTo(..)", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractBigIntegerAssert isZero(..)", true),
Preconditions.and(
new UsesType<>("java.math.BigInteger", true),
new UsesMethod<>("org.assertj.core.api.AbstractAssert isEqualTo(..)", true)
@@ -380,8 +380,8 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
Preconditions.or(
- new UsesMethod<>("org.assertj.core.api.AbstractBigIntegerAssert isNotZero(..)", true),
new UsesMethod<>("org.assertj.core.api.AbstractAssert isNotEqualTo(..)", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractBigIntegerAssert isNotZero(..)", true),
Preconditions.and(
new UsesType<>("java.math.BigInteger", true),
new UsesMethod<>("org.assertj.core.api.AbstractAssert isNotEqualTo(..)", true)
@@ -472,8 +472,8 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
Preconditions.or(
- new UsesMethod<>("org.assertj.core.api.AbstractBigIntegerAssert isOne(..)", true),
new UsesMethod<>("org.assertj.core.api.AbstractBigIntegerAssert isEqualTo(..)", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractBigIntegerAssert isOne(..)", true),
Preconditions.and(
new UsesType<>("java.math.BigInteger", true),
new UsesMethod<>("org.assertj.core.api.AbstractAssert isEqualTo(..)", true)
diff -u -r AssertJBooleanRulesRecipes.java AssertJBooleanRulesRecipes.java
--- AssertJBooleanRulesRecipes.java 2024-12-22 11:47:38.002024962 +0100
+++ AssertJBooleanRulesRecipes.java 2024-12-22 11:47:44.774052602 +0100
@@ -262,10 +262,10 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractBooleanAssert", true),
Preconditions.or(
- new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isEqualTo(..)", true),
new UsesMethod<>("org.assertj.core.api.AbstractAssert isEqualTo(..)", true),
- new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isNotEqualTo(..)", true),
- new UsesMethod<>("org.assertj.core.api.AbstractAssert isNotEqualTo(..)", true)
+ new UsesMethod<>("org.assertj.core.api.AbstractAssert isNotEqualTo(..)", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isEqualTo(..)", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isNotEqualTo(..)", true)
)
),
javaVisitor
@@ -424,10 +424,10 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractBooleanAssert", true),
Preconditions.or(
- new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isEqualTo(..)", true),
new UsesMethod<>("org.assertj.core.api.AbstractAssert isEqualTo(..)", true),
- new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isNotEqualTo(..)", true),
- new UsesMethod<>("org.assertj.core.api.AbstractAssert isNotEqualTo(..)", true)
+ new UsesMethod<>("org.assertj.core.api.AbstractAssert isNotEqualTo(..)", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isEqualTo(..)", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isNotEqualTo(..)", true)
)
),
javaVisitor
diff -u -r AssertJCharSequenceRulesRecipes.java AssertJCharSequenceRulesRecipes.java
--- AssertJCharSequenceRulesRecipes.java 2024-12-22 11:47:38.014025011 +0100
+++ AssertJCharSequenceRulesRecipes.java 2024-12-22 11:47:44.786052651 +0100
@@ -113,8 +113,8 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
new UsesMethod<>("java.lang.CharSequence length(..)", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
Preconditions.or(
new UsesMethod<>("org.assertj.core.api.AbstractIntegerAssert isEqualTo(..)", true),
new UsesMethod<>("org.assertj.core.api.AbstractIntegerAssert isNotPositive(..)", true)
@@ -190,8 +190,8 @@
return Preconditions.check(
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractAssert", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
new UsesMethod<>("java.lang.CharSequence length(..)", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
Preconditions.or(
new UsesMethod<>("org.assertj.core.api.AbstractIntegerAssert isNotEqualTo(..)", true),
new UsesMethod<>("org.assertj.core.api.AbstractIntegerAssert isPositive(..)", true)
@@ -255,9 +255,9 @@
return Preconditions.check(
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractAssert", true),
+ new UsesMethod<>("java.lang.CharSequence length(..)", true),
new UsesMethod<>("org.assertj.core.api.AbstractIntegerAssert isEqualTo(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
- new UsesMethod<>("java.lang.CharSequence length(..)", true)
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true)
),
javaVisitor
);
diff -u -r AssertJNumberRulesRecipes.java AssertJNumberRulesRecipes.java
--- AssertJNumberRulesRecipes.java 2024-12-22 11:47:38.045025137 +0100
+++ AssertJNumberRulesRecipes.java 2024-12-22 11:47:44.817052777 +0100
@@ -263,21 +263,61 @@
return Preconditions.check(
Preconditions.or(
Preconditions.and(
- new UsesType<>("java.math.BigInteger", true),
- new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
- new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isGreaterThan(..)", true)
- ),
- Preconditions.and(
- new UsesType<>("java.math.BigInteger", true),
- new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
- new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isGreaterThanOrEqualTo(..)", true),
- new UsesMethod<>("java.math.BigInteger valueOf(..)", true)
- ),
- Preconditions.and(
- new UsesType<>("java.math.BigDecimal", true),
- new UsesType<>("org.assertj.core.api.AbstractBigDecimalAssert", true),
- new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isGreaterThan(..)", true)
- )
+ new UsesType<>("java.math.BigDecimal", true),
+ new UsesType<>("org.assertj.core.api.AbstractBigDecimalAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isGreaterThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("java.math.BigInteger", true),
+ new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
+ new UsesMethod<>("java.math.BigInteger valueOf(..)", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isGreaterThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("java.math.BigInteger", true),
+ new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isGreaterThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractByteAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractByteAssert isGreaterThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractByteAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractByteAssert isGreaterThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractDoubleAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractDoubleAssert isGreaterThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractFloatAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractFloatAssert isGreaterThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractIntegerAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractIntegerAssert isGreaterThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractIntegerAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractIntegerAssert isGreaterThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractLongAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractLongAssert isGreaterThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractLongAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractLongAssert isGreaterThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractShortAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractShortAssert isGreaterThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractShortAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractShortAssert isGreaterThanOrEqualTo(..)", true)
+ )
),
javaVisitor
);
@@ -497,21 +537,61 @@
return Preconditions.check(
Preconditions.or(
Preconditions.and(
- new UsesType<>("java.math.BigInteger", true),
- new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
- new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isLessThanOrEqualTo(..)", true)
- ),
- Preconditions.and(
- new UsesType<>("java.math.BigInteger", true),
- new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
- new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isLessThan(..)", true),
- new UsesMethod<>("java.math.BigInteger valueOf(..)", true)
- ),
- Preconditions.and(
- new UsesType<>("java.math.BigDecimal", true),
- new UsesType<>("org.assertj.core.api.AbstractBigDecimalAssert", true),
- new UsesMethod<>("org.assertj.core.api.AbstractBigDecimalAssert isLessThanOrEqualTo(..)", true)
- )
+ new UsesType<>("java.math.BigDecimal", true),
+ new UsesType<>("org.assertj.core.api.AbstractBigDecimalAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractBigDecimalAssert isLessThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("java.math.BigInteger", true),
+ new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
+ new UsesMethod<>("java.math.BigInteger valueOf(..)", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isLessThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("java.math.BigInteger", true),
+ new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isLessThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractByteAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractByteAssert isLessThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractByteAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractByteAssert isLessThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractDoubleAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractDoubleAssert isLessThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractFloatAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractFloatAssert isLessThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractIntegerAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractIntegerAssert isLessThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractIntegerAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractIntegerAssert isLessThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractLongAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractLongAssert isLessThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractLongAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractLongAssert isLessThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractShortAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractShortAssert isLessThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractShortAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractShortAssert isLessThanOrEqualTo(..)", true)
+ )
),
javaVisitor
);
@@ -731,21 +811,61 @@
return Preconditions.check(
Preconditions.or(
Preconditions.and(
- new UsesType<>("java.math.BigInteger", true),
- new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
- new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isLessThan(..)", true)
- ),
- Preconditions.and(
- new UsesType<>("java.math.BigInteger", true),
- new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
- new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isLessThanOrEqualTo(..)", true),
- new UsesMethod<>("java.math.BigInteger valueOf(..)", true)
- ),
- Preconditions.and(
- new UsesType<>("java.math.BigDecimal", true),
- new UsesType<>("org.assertj.core.api.AbstractBigDecimalAssert", true),
- new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isLessThan(..)", true)
- )
+ new UsesType<>("java.math.BigDecimal", true),
+ new UsesType<>("org.assertj.core.api.AbstractBigDecimalAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isLessThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("java.math.BigInteger", true),
+ new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
+ new UsesMethod<>("java.math.BigInteger valueOf(..)", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isLessThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("java.math.BigInteger", true),
+ new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isLessThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractByteAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractByteAssert isLessThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractByteAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractByteAssert isLessThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractDoubleAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractDoubleAssert isLessThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractFloatAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractFloatAssert isLessThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractIntegerAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractIntegerAssert isLessThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractIntegerAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractIntegerAssert isLessThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractLongAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractLongAssert isLessThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractLongAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractLongAssert isLessThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractShortAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractShortAssert isLessThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractShortAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractShortAssert isLessThanOrEqualTo(..)", true)
+ )
),
javaVisitor
);
@@ -965,21 +1085,61 @@
return Preconditions.check(
Preconditions.or(
Preconditions.and(
- new UsesType<>("java.math.BigInteger", true),
- new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
- new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isGreaterThanOrEqualTo(..)", true)
- ),
- Preconditions.and(
- new UsesType<>("java.math.BigInteger", true),
- new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
- new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isGreaterThan(..)", true),
- new UsesMethod<>("java.math.BigInteger valueOf(..)", true)
- ),
- Preconditions.and(
- new UsesType<>("java.math.BigDecimal", true),
- new UsesType<>("org.assertj.core.api.AbstractBigDecimalAssert", true),
- new UsesMethod<>("org.assertj.core.api.AbstractBigDecimalAssert isGreaterThanOrEqualTo(..)", true)
- )
+ new UsesType<>("java.math.BigDecimal", true),
+ new UsesType<>("org.assertj.core.api.AbstractBigDecimalAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractBigDecimalAssert isGreaterThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("java.math.BigInteger", true),
+ new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
+ new UsesMethod<>("java.math.BigInteger valueOf(..)", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isGreaterThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("java.math.BigInteger", true),
+ new UsesType<>("org.assertj.core.api.AbstractBigIntegerAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractComparableAssert isGreaterThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractByteAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractByteAssert isGreaterThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractByteAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractByteAssert isGreaterThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractDoubleAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractDoubleAssert isGreaterThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractFloatAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractFloatAssert isGreaterThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractIntegerAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractIntegerAssert isGreaterThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractIntegerAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractIntegerAssert isGreaterThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractLongAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractLongAssert isGreaterThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractLongAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractLongAssert isGreaterThanOrEqualTo(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractShortAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractShortAssert isGreaterThan(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.assertj.core.api.AbstractShortAssert", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractShortAssert isGreaterThanOrEqualTo(..)", true)
+ )
),
javaVisitor
);
diff -u -r AssertJPrimitiveRulesRecipes.java AssertJPrimitiveRulesRecipes.java
--- AssertJPrimitiveRulesRecipes.java 2024-12-22 11:47:38.063025211 +0100
+++ AssertJPrimitiveRulesRecipes.java 2024-12-22 11:47:44.836052855 +0100
@@ -143,8 +143,8 @@
new UsesType<>("org.assertj.core.api.AbstractBooleanAssert", true),
new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
Preconditions.or(
- new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isTrue(..)", true),
- new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isFalse(..)", true)
+ new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isFalse(..)", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isTrue(..)", true)
)
),
javaVisitor
@@ -243,8 +243,8 @@
new UsesType<>("org.assertj.core.api.AbstractBooleanAssert", true),
new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
Preconditions.or(
- new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isTrue(..)", true),
- new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isFalse(..)", true)
+ new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isFalse(..)", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isTrue(..)", true)
)
),
javaVisitor
@@ -321,8 +321,8 @@
new UsesType<>("org.assertj.core.api.AbstractBooleanAssert", true),
new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
Preconditions.or(
- new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isTrue(..)", true),
- new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isFalse(..)", true)
+ new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isFalse(..)", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isTrue(..)", true)
)
),
javaVisitor
@@ -399,8 +399,8 @@
new UsesType<>("org.assertj.core.api.AbstractBooleanAssert", true),
new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
Preconditions.or(
- new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isTrue(..)", true),
- new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isFalse(..)", true)
+ new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isFalse(..)", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isTrue(..)", true)
)
),
javaVisitor
@@ -477,8 +477,8 @@
new UsesType<>("org.assertj.core.api.AbstractBooleanAssert", true),
new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
Preconditions.or(
- new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isTrue(..)", true),
- new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isFalse(..)", true)
+ new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isFalse(..)", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isTrue(..)", true)
)
),
javaVisitor
@@ -555,8 +555,8 @@
new UsesType<>("org.assertj.core.api.AbstractBooleanAssert", true),
new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
Preconditions.or(
- new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isTrue(..)", true),
- new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isFalse(..)", true)
+ new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isFalse(..)", true),
+ new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isTrue(..)", true)
)
),
javaVisitor
diff -u -r AssertJRulesRecipes.java AssertJRulesRecipes.java
--- AssertJRulesRecipes.java 2024-12-22 11:47:38.070025239 +0100
+++ AssertJRulesRecipes.java 2024-12-22 11:47:44.843052884 +0100
@@ -102,11 +102,11 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("org.assertj.core.api.AbstractDoubleAssert", true),
new UsesType<>("java.util.OptionalDouble", true),
+ new UsesType<>("org.assertj.core.api.AbstractDoubleAssert", true),
+ new UsesMethod<>("java.util.OptionalDouble getAsDouble(..)", true),
new UsesMethod<>("org.assertj.core.api.AbstractDoubleAssert isEqualTo(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
- new UsesMethod<>("java.util.OptionalDouble getAsDouble(..)", true)
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true)
),
javaVisitor
);
@@ -166,11 +166,11 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("org.assertj.core.api.AbstractIntegerAssert", true),
new UsesType<>("java.util.OptionalInt", true),
+ new UsesType<>("org.assertj.core.api.AbstractIntegerAssert", true),
+ new UsesMethod<>("java.util.OptionalInt getAsInt(..)", true),
new UsesMethod<>("org.assertj.core.api.AbstractIntegerAssert isEqualTo(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
- new UsesMethod<>("java.util.OptionalInt getAsInt(..)", true)
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true)
),
javaVisitor
);
@@ -230,11 +230,11 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("org.assertj.core.api.AbstractLongAssert", true),
new UsesType<>("java.util.OptionalLong", true),
+ new UsesType<>("org.assertj.core.api.AbstractLongAssert", true),
+ new UsesMethod<>("java.util.OptionalLong getAsLong(..)", true),
new UsesMethod<>("org.assertj.core.api.AbstractLongAssert isEqualTo(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
- new UsesMethod<>("java.util.OptionalLong getAsLong(..)", true)
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true)
),
javaVisitor
);
diff -u -r AssertJStringRulesRecipes.java AssertJStringRulesRecipes.java
--- AssertJStringRulesRecipes.java 2024-12-22 11:47:38.101025366 +0100
+++ AssertJStringRulesRecipes.java 2024-12-22 11:47:44.859052949 +0100
@@ -166,9 +166,9 @@
};
return Preconditions.check(
Preconditions.and(
+ new UsesMethod<>("java.lang.String isEmpty(..)", true),
new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isTrue(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
- new UsesMethod<>("java.lang.String isEmpty(..)", true)
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true)
),
javaVisitor
);
@@ -288,9 +288,9 @@
return Preconditions.check(
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractAssert", true),
+ new UsesMethod<>("java.lang.String isEmpty(..)", true),
new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isFalse(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
- new UsesMethod<>("java.lang.String isEmpty(..)", true)
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true)
),
javaVisitor
);
@@ -350,9 +350,9 @@
return Preconditions.check(
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractAssert", true),
+ new UsesMethod<>("java.lang.String matches(..)", true),
new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isTrue(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
- new UsesMethod<>("java.lang.String matches(..)", true)
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true)
),
javaVisitor
);
@@ -412,9 +412,9 @@
return Preconditions.check(
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractAssert", true),
+ new UsesMethod<>("java.lang.String matches(..)", true),
new UsesMethod<>("org.assertj.core.api.AbstractBooleanAssert isFalse(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
- new UsesMethod<>("java.lang.String matches(..)", true)
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true)
),
javaVisitor
);
@@ -474,12 +474,12 @@
};
return Preconditions.check(
Preconditions.and(
+ new UsesType<>("java.nio.charset.Charset", true),
new UsesType<>("java.nio.file.Files", true),
- new UsesType<>("org.assertj.core.api.AbstractStringAssert", true),
new UsesType<>("java.nio.file.Path", true),
- new UsesType<>("java.nio.charset.Charset", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
- new UsesMethod<>("java.nio.file.Files readString(..)", true)
+ new UsesType<>("org.assertj.core.api.AbstractStringAssert", true),
+ new UsesMethod<>("java.nio.file.Files readString(..)", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true)
),
javaVisitor
);
@@ -540,10 +540,10 @@
return Preconditions.check(
Preconditions.and(
new UsesType<>("java.nio.file.Files", true),
- new UsesType<>("org.assertj.core.api.AbstractStringAssert", true),
new UsesType<>("java.nio.file.Path", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true),
- new UsesMethod<>("java.nio.file.Files readString(..)", true)
+ new UsesType<>("org.assertj.core.api.AbstractStringAssert", true),
+ new UsesMethod<>("java.nio.file.Files readString(..)", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThat(..)", true)
),
javaVisitor
);
diff -u -r AssertJThrowingCallableRulesRecipes.java AssertJThrowingCallableRulesRecipes.java
--- AssertJThrowingCallableRulesRecipes.java 2024-12-22 11:47:38.120025443 +0100
+++ AssertJThrowingCallableRulesRecipes.java 2024-12-22 11:47:44.880053035 +0100
@@ -125,8 +125,8 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalArgumentException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalArgumentException(..)", true),
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -188,9 +188,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalArgumentException(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessage(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalArgumentException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -252,9 +252,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalArgumentException(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessageStartingWith(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalArgumentException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -316,9 +316,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalArgumentException(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessageContaining(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalArgumentException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -380,8 +380,8 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalStateException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalStateException(..)", true),
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -443,9 +443,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalStateException(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessage(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalStateException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -507,9 +507,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalStateException(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessageStartingWith(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalStateException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -571,9 +571,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalStateException(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessageContaining(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalStateException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -635,9 +635,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalStateException(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessageNotContaining(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatIllegalStateException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -699,8 +699,8 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatNullPointerException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatNullPointerException(..)", true),
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -762,9 +762,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatNullPointerException(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessage(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatNullPointerException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -826,9 +826,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatNullPointerException(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessageStartingWith(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatNullPointerException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -890,9 +890,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatNullPointerException(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessageContaining(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatNullPointerException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -954,9 +954,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatNullPointerException(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessageNotContaining(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatNullPointerException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -1018,8 +1018,8 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatIOException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatIOException(..)", true),
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -1081,9 +1081,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatIOException(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessage(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatIOException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -1145,9 +1145,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatIOException(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessageStartingWith(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatIOException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -1209,9 +1209,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatIOException(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessageContaining(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatIOException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -1273,9 +1273,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatIOException(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessageNotContaining(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatIOException(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -1337,8 +1337,8 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatExceptionOfType(..)", true)
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatExceptionOfType(..)", true),
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -1400,9 +1400,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatExceptionOfType(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessage(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatExceptionOfType(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -1464,9 +1464,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatExceptionOfType(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessageStartingWith(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatExceptionOfType(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -1528,9 +1528,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatExceptionOfType(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessageContaining(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatExceptionOfType(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
@@ -1592,9 +1592,9 @@
Preconditions.and(
new UsesType<>("org.assertj.core.api.AbstractObjectAssert", true),
new UsesType<>("org.assertj.core.api.ThrowableAssert.ThrowingCallable", true),
+ new UsesMethod<>("org.assertj.core.api.Assertions assertThatExceptionOfType(..)", true),
new UsesMethod<>("org.assertj.core.api.ThrowableAssertAlternative withMessageNotContaining(..)", true),
- new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true),
- new UsesMethod<>("org.assertj.core.api.Assertions assertThatExceptionOfType(..)", true)
+ new UsesMethod<>("org.assertj.core.api.ThrowableTypeAssert isThrownBy(..)", true)
),
javaVisitor
);
diff -u -r AssortedRulesRecipes.java AssortedRulesRecipes.java
--- AssortedRulesRecipes.java 2024-12-22 11:47:38.124025460 +0100
+++ AssortedRulesRecipes.java 2024-12-22 11:47:44.883053047 +0100
@@ -222,17 +222,17 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.util.stream.Stream", true),
new UsesType<>("com.google.common.base.Splitter", true),
+ new UsesType<>("java.util.stream.Stream", true),
Preconditions.or(
Preconditions.and(
- new UsesType<>("com.google.common.collect.Streams", true),
- new UsesMethod<>("com.google.common.collect.Streams stream(..)", true),
- new UsesMethod<>("com.google.common.base.Splitter split(..)", true)
+ new UsesMethod<>("com.google.common.base.Splitter splitToList(..)", true),
+ new UsesMethod<>("java.util.Collection stream(..)", true)
),
Preconditions.and(
- new UsesMethod<>("java.util.Collection stream(..)", true),
- new UsesMethod<>("com.google.common.base.Splitter splitToList(..)", true)
+ new UsesType<>("com.google.common.collect.Streams", true),
+ new UsesMethod<>("com.google.common.base.Splitter split(..)", true),
+ new UsesMethod<>("com.google.common.collect.Streams stream(..)", true)
)
)
),
diff -u -r BigDecimalRulesRecipes.java BigDecimalRulesRecipes.java
--- BigDecimalRulesRecipes.java 2024-12-22 11:47:38.128025476 +0100
+++ BigDecimalRulesRecipes.java 2024-12-22 11:47:44.887053063 +0100
@@ -116,8 +116,8 @@
Preconditions.and(
new UsesType<>("java.math.BigDecimal", true),
Preconditions.or(
- new UsesMethod<>("java.math.BigDecimal valueOf(..)", true),
- new UsesMethod<>("java.math.BigDecimal <constructor>(..)", true)
+ new UsesMethod<>("java.math.BigDecimal <constructor>(..)", true),
+ new UsesMethod<>("java.math.BigDecimal valueOf(..)", true)
)
),
javaVisitor
@@ -188,8 +188,8 @@
Preconditions.and(
new UsesType<>("java.math.BigDecimal", true),
Preconditions.or(
- new UsesMethod<>("java.math.BigDecimal valueOf(..)", true),
- new UsesMethod<>("java.math.BigDecimal <constructor>(..)", true)
+ new UsesMethod<>("java.math.BigDecimal <constructor>(..)", true),
+ new UsesMethod<>("java.math.BigDecimal valueOf(..)", true)
)
),
javaVisitor
@@ -260,8 +260,8 @@
Preconditions.and(
new UsesType<>("java.math.BigDecimal", true),
Preconditions.or(
- new UsesMethod<>("java.math.BigDecimal valueOf(..)", true),
- new UsesMethod<>("java.math.BigDecimal <constructor>(..)", true)
+ new UsesMethod<>("java.math.BigDecimal <constructor>(..)", true),
+ new UsesMethod<>("java.math.BigDecimal valueOf(..)", true)
)
),
javaVisitor
@@ -482,8 +482,6 @@
new UsesType<>("java.math.BigDecimal", true),
Preconditions.or(
new UsesMethod<>("java.math.BigDecimal compareTo(..)", true),
- new UsesMethod<>("java.math.BigDecimal compareTo(..)", true),
- new UsesMethod<>("java.math.BigDecimal signum(..)", true),
new UsesMethod<>("java.math.BigDecimal signum(..)", true)
)
),
@@ -578,8 +576,6 @@
new UsesType<>("java.math.BigDecimal", true),
Preconditions.or(
new UsesMethod<>("java.math.BigDecimal compareTo(..)", true),
- new UsesMethod<>("java.math.BigDecimal compareTo(..)", true),
- new UsesMethod<>("java.math.BigDecimal signum(..)", true),
new UsesMethod<>("java.math.BigDecimal signum(..)", true)
)
),
diff -u -r BugCheckerRulesRecipes.java BugCheckerRulesRecipes.java
--- BugCheckerRulesRecipes.java 2024-12-22 11:47:38.130025484 +0100
+++ BugCheckerRulesRecipes.java 2024-12-22 11:47:44.890053075 +0100
@@ -116,11 +116,11 @@
Preconditions.and(
new UsesType<>("com.google.errorprone.BugCheckerRefactoringTestHelper", true),
Preconditions.or(
+ new UsesMethod<>("com.google.errorprone.BugCheckerRefactoringTestHelper setImportOrder(..)", true),
Preconditions.and(
new UsesType<>("com.google.errorprone.BugCheckerRefactoringTestHelper.FixChoosers", true),
new UsesMethod<>("com.google.errorprone.BugCheckerRefactoringTestHelper setFixChooser(..)", true)
- ),
- new UsesMethod<>("com.google.errorprone.BugCheckerRefactoringTestHelper setImportOrder(..)", true)
+ )
)
),
javaVisitor
@@ -181,8 +181,8 @@
return Preconditions.check(
Preconditions.and(
new UsesType<>("com.google.errorprone.BugCheckerRefactoringTestHelper", true),
- new UsesMethod<>("com.google.errorprone.BugCheckerRefactoringTestHelper.ExpectOutput addOutputLines(..)", true),
- new UsesMethod<>("com.google.errorprone.BugCheckerRefactoringTestHelper addInputLines(..)", true)
+ new UsesMethod<>("com.google.errorprone.BugCheckerRefactoringTestHelper addInputLines(..)", true),
+ new UsesMethod<>("com.google.errorprone.BugCheckerRefactoringTestHelper.ExpectOutput addOutputLines(..)", true)
),
javaVisitor
);
@@ -251,8 +251,8 @@
return Preconditions.check(
Preconditions.and(
new UsesType<>("javax.lang.model.element.Name", true),
- new UsesMethod<>("java.lang.String equals(..)", true),
- new UsesMethod<>("java.lang.CharSequence toString(..)", true)
+ new UsesMethod<>("java.lang.CharSequence toString(..)", true),
+ new UsesMethod<>("java.lang.String equals(..)", true)
),
javaVisitor
);
diff -u -r DoubleStreamRulesRecipes.java DoubleStreamRulesRecipes.java
--- DoubleStreamRulesRecipes.java 2024-12-22 11:47:38.135025505 +0100
+++ DoubleStreamRulesRecipes.java 2024-12-22 11:47:44.896053100 +0100
@@ -228,8 +228,8 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.util.stream.DoubleStream", true),
new UsesType<>("java.util.function.DoublePredicate", true),
+ new UsesType<>("java.util.stream.DoubleStream", true),
new UsesMethod<>("java.util.stream.DoubleStream filter(..)", true),
new UsesMethod<>("java.util.stream.DoubleStream sorted(..)", true)
),
@@ -324,8 +324,6 @@
new UsesType<>("java.util.stream.DoubleStream", true),
Preconditions.or(
new UsesMethod<>("java.util.stream.DoubleStream count(..)", true),
- new UsesMethod<>("java.util.stream.DoubleStream count(..)", true),
- new UsesMethod<>("java.util.stream.DoubleStream count(..)", true),
Preconditions.and(
new UsesMethod<>("java.util.OptionalDouble isEmpty(..)", true),
new UsesMethod<>("java.util.stream.DoubleStream findFirst(..)", true)
@@ -423,8 +421,6 @@
new UsesType<>("java.util.stream.DoubleStream", true),
Preconditions.or(
new UsesMethod<>("java.util.stream.DoubleStream count(..)", true),
- new UsesMethod<>("java.util.stream.DoubleStream count(..)", true),
- new UsesMethod<>("java.util.stream.DoubleStream count(..)", true),
Preconditions.and(
new UsesMethod<>("java.util.OptionalDouble isPresent(..)", true),
new UsesMethod<>("java.util.stream.DoubleStream findFirst(..)", true)
@@ -568,18 +564,18 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.util.stream.DoubleStream", true),
new UsesType<>("java.util.function.DoublePredicate", true),
+ new UsesType<>("java.util.stream.DoubleStream", true),
Preconditions.or(
new UsesMethod<>("java.util.stream.DoubleStream anyMatch(..)", true),
Preconditions.and(
- new UsesMethod<>("java.util.stream.DoubleStream allMatch(..)", true),
- new UsesMethod<>("java.util.function.DoublePredicate negate(..)", true)
+ new UsesMethod<>("java.util.OptionalDouble isEmpty(..)", true),
+ new UsesMethod<>("java.util.stream.DoubleStream filter(..)", true),
+ new UsesMethod<>("java.util.stream.DoubleStream findAny(..)", true)
),
Preconditions.and(
- new UsesMethod<>("java.util.OptionalDouble isEmpty(..)", true),
- new UsesMethod<>("java.util.stream.DoubleStream findAny(..)", true),
- new UsesMethod<>("java.util.stream.DoubleStream filter(..)", true)
+ new UsesMethod<>("java.util.function.DoublePredicate negate(..)", true),
+ new UsesMethod<>("java.util.stream.DoubleStream allMatch(..)", true)
)
)
),
@@ -649,14 +645,14 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.util.stream.DoubleStream", true),
new UsesType<>("java.util.function.DoublePredicate", true),
+ new UsesType<>("java.util.stream.DoubleStream", true),
Preconditions.or(
new UsesMethod<>("java.util.stream.DoubleStream noneMatch(..)", true),
Preconditions.and(
new UsesMethod<>("java.util.OptionalDouble isPresent(..)", true),
- new UsesMethod<>("java.util.stream.DoubleStream findAny(..)", true),
- new UsesMethod<>("java.util.stream.DoubleStream filter(..)", true)
+ new UsesMethod<>("java.util.stream.DoubleStream filter(..)", true),
+ new UsesMethod<>("java.util.stream.DoubleStream findAny(..)", true)
)
)
),
@@ -715,10 +711,10 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.util.stream.DoubleStream", true),
new UsesType<>("java.util.function.DoublePredicate", true),
- new UsesMethod<>("java.util.stream.DoubleStream noneMatch(..)", true),
- new UsesMethod<>("java.util.function.DoublePredicate negate(..)", true)
+ new UsesType<>("java.util.stream.DoubleStream", true),
+ new UsesMethod<>("java.util.function.DoublePredicate negate(..)", true),
+ new UsesMethod<>("java.util.stream.DoubleStream noneMatch(..)", true)
),
javaVisitor
);
@@ -775,8 +771,8 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.util.stream.DoubleStream", true),
new UsesType<>("java.util.function.DoublePredicate", true),
+ new UsesType<>("java.util.stream.DoubleStream", true),
new UsesMethod<>("java.util.stream.DoubleStream filter(..)", true),
new UsesMethod<>("java.util.stream.DoubleStream takeWhile(..)", true)
),
diff -u -r FileRulesRecipes.java FileRulesRecipes.java
--- FileRulesRecipes.java 2024-12-22 11:47:38.140025525 +0100
+++ FileRulesRecipes.java 2024-12-22 11:47:44.901053120 +0100
@@ -103,9 +103,9 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.nio.file.Paths", true),
- new UsesType<>("java.nio.file.Path", true),
new UsesType<>("java.net.URI", true),
+ new UsesType<>("java.nio.file.Path", true),
+ new UsesType<>("java.nio.file.Paths", true),
new UsesMethod<>("java.nio.file.Paths get(..)", true)
),
javaVisitor
@@ -222,9 +222,9 @@
};
return Preconditions.check(
Preconditions.and(
+ new UsesType<>("java.nio.charset.Charset", true),
new UsesType<>("java.nio.file.Files", true),
new UsesType<>("java.nio.file.Path", true),
- new UsesType<>("java.nio.charset.Charset", true),
new UsesMethod<>("java.lang.String <constructor>(..)", true),
new UsesMethod<>("java.nio.file.Files readAllBytes(..)", true)
),
diff -u -r InputStreamRulesRecipes.java InputStreamRulesRecipes.java
--- InputStreamRulesRecipes.java 2024-12-22 11:47:38.142025533 +0100
+++ InputStreamRulesRecipes.java 2024-12-22 11:47:44.903053128 +0100
@@ -227,8 +227,8 @@
Preconditions.and(
new UsesType<>("com.google.common.io.ByteStreams", true),
new UsesType<>("java.io.InputStream", true),
- new UsesMethod<>("java.io.InputStream readAllBytes(..)", true),
- new UsesMethod<>("com.google.common.io.ByteStreams limit(..)", true)
+ new UsesMethod<>("com.google.common.io.ByteStreams limit(..)", true),
+ new UsesMethod<>("java.io.InputStream readAllBytes(..)", true)
),
javaVisitor
);
diff -u -r IntStreamRulesRecipes.java IntStreamRulesRecipes.java
--- IntStreamRulesRecipes.java 2024-12-22 11:47:38.147025553 +0100
+++ IntStreamRulesRecipes.java 2024-12-22 11:47:44.910053157 +0100
@@ -287,8 +287,8 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.util.stream.IntStream", true),
new UsesType<>("java.util.function.IntPredicate", true),
+ new UsesType<>("java.util.stream.IntStream", true),
new UsesMethod<>("java.util.stream.IntStream filter(..)", true),
new UsesMethod<>("java.util.stream.IntStream sorted(..)", true)
),
@@ -383,8 +383,6 @@
new UsesType<>("java.util.stream.IntStream", true),
Preconditions.or(
new UsesMethod<>("java.util.stream.IntStream count(..)", true),
- new UsesMethod<>("java.util.stream.IntStream count(..)", true),
- new UsesMethod<>("java.util.stream.IntStream count(..)", true),
Preconditions.and(
new UsesMethod<>("java.util.OptionalInt isEmpty(..)", true),
new UsesMethod<>("java.util.stream.IntStream findFirst(..)", true)
@@ -482,8 +480,6 @@
new UsesType<>("java.util.stream.IntStream", true),
Preconditions.or(
new UsesMethod<>("java.util.stream.IntStream count(..)", true),
- new UsesMethod<>("java.util.stream.IntStream count(..)", true),
- new UsesMethod<>("java.util.stream.IntStream count(..)", true),
Preconditions.and(
new UsesMethod<>("java.util.OptionalInt isPresent(..)", true),
new UsesMethod<>("java.util.stream.IntStream findFirst(..)", true)
@@ -627,18 +623,18 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.util.stream.IntStream", true),
new UsesType<>("java.util.function.IntPredicate", true),
+ new UsesType<>("java.util.stream.IntStream", true),
Preconditions.or(
new UsesMethod<>("java.util.stream.IntStream anyMatch(..)", true),
Preconditions.and(
- new UsesMethod<>("java.util.stream.IntStream allMatch(..)", true),
- new UsesMethod<>("java.util.function.IntPredicate negate(..)", true)
+ new UsesMethod<>("java.util.OptionalInt isEmpty(..)", true),
+ new UsesMethod<>("java.util.stream.IntStream filter(..)", true),
+ new UsesMethod<>("java.util.stream.IntStream findAny(..)", true)
),
Preconditions.and(
- new UsesMethod<>("java.util.OptionalInt isEmpty(..)", true),
- new UsesMethod<>("java.util.stream.IntStream findAny(..)", true),
- new UsesMethod<>("java.util.stream.IntStream filter(..)", true)
+ new UsesMethod<>("java.util.function.IntPredicate negate(..)", true),
+ new UsesMethod<>("java.util.stream.IntStream allMatch(..)", true)
)
)
),
@@ -708,14 +704,14 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.util.stream.IntStream", true),
new UsesType<>("java.util.function.IntPredicate", true),
+ new UsesType<>("java.util.stream.IntStream", true),
Preconditions.or(
new UsesMethod<>("java.util.stream.IntStream noneMatch(..)", true),
Preconditions.and(
new UsesMethod<>("java.util.OptionalInt isPresent(..)", true),
- new UsesMethod<>("java.util.stream.IntStream findAny(..)", true),
- new UsesMethod<>("java.util.stream.IntStream filter(..)", true)
+ new UsesMethod<>("java.util.stream.IntStream filter(..)", true),
+ new UsesMethod<>("java.util.stream.IntStream findAny(..)", true)
)
)
),
@@ -774,10 +770,10 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.util.stream.IntStream", true),
new UsesType<>("java.util.function.IntPredicate", true),
- new UsesMethod<>("java.util.stream.IntStream noneMatch(..)", true),
- new UsesMethod<>("java.util.function.IntPredicate negate(..)", true)
+ new UsesType<>("java.util.stream.IntStream", true),
+ new UsesMethod<>("java.util.function.IntPredicate negate(..)", true),
+ new UsesMethod<>("java.util.stream.IntStream noneMatch(..)", true)
),
javaVisitor
);
@@ -834,8 +830,8 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.util.stream.IntStream", true),
new UsesType<>("java.util.function.IntPredicate", true),
+ new UsesType<>("java.util.stream.IntStream", true),
new UsesMethod<>("java.util.stream.IntStream filter(..)", true),
new UsesMethod<>("java.util.stream.IntStream takeWhile(..)", true)
),
diff -u -r JUnitToAssertJRulesRecipes.java JUnitToAssertJRulesRecipes.java
--- JUnitToAssertJRulesRecipes.java 2024-12-22 11:47:38.165025627 +0100
+++ JUnitToAssertJRulesRecipes.java 2024-12-22 11:47:44.929053235 +0100
@@ -1197,8 +1197,11 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("org.junit.jupiter.api.function.ThrowingSupplier", true),
- new UsesMethod<>("org.junit.jupiter.api.Assertions assertDoesNotThrow(..)", true)
+ new UsesMethod<>("org.junit.jupiter.api.Assertions assertDoesNotThrow(..)", true),
+ Preconditions.or(
+ new UsesType<>("org.junit.jupiter.api.function.Executable", true),
+ new UsesType<>("org.junit.jupiter.api.function.ThrowingSupplier", true)
+ )
),
javaVisitor
);
@@ -1273,8 +1276,11 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("org.junit.jupiter.api.function.ThrowingSupplier", true),
- new UsesMethod<>("org.junit.jupiter.api.Assertions assertDoesNotThrow(..)", true)
+ new UsesMethod<>("org.junit.jupiter.api.Assertions assertDoesNotThrow(..)", true),
+ Preconditions.or(
+ new UsesType<>("org.junit.jupiter.api.function.Executable", true),
+ new UsesType<>("org.junit.jupiter.api.function.ThrowingSupplier", true)
+ )
),
javaVisitor
);
@@ -1349,9 +1355,12 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("org.junit.jupiter.api.function.ThrowingSupplier", true),
new UsesType<>("java.util.function.Supplier", true),
- new UsesMethod<>("org.junit.jupiter.api.Assertions assertDoesNotThrow(..)", true)
+ new UsesMethod<>("org.junit.jupiter.api.Assertions assertDoesNotThrow(..)", true),
+ Preconditions.or(
+ new UsesType<>("org.junit.jupiter.api.function.Executable", true),
+ new UsesType<>("org.junit.jupiter.api.function.ThrowingSupplier", true)
+ )
),
javaVisitor
);
diff -u -r LongStreamRulesRecipes.java LongStreamRulesRecipes.java
--- LongStreamRulesRecipes.java 2024-12-22 11:47:38.169025643 +0100
+++ LongStreamRulesRecipes.java 2024-12-22 11:47:44.934053255 +0100
@@ -287,8 +287,8 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.util.stream.LongStream", true),
new UsesType<>("java.util.function.LongPredicate", true),
+ new UsesType<>("java.util.stream.LongStream", true),
new UsesMethod<>("java.util.stream.LongStream filter(..)", true),
new UsesMethod<>("java.util.stream.LongStream sorted(..)", true)
),
@@ -383,8 +383,6 @@
new UsesType<>("java.util.stream.LongStream", true),
Preconditions.or(
new UsesMethod<>("java.util.stream.LongStream count(..)", true),
- new UsesMethod<>("java.util.stream.LongStream count(..)", true),
- new UsesMethod<>("java.util.stream.LongStream count(..)", true),
Preconditions.and(
new UsesMethod<>("java.util.OptionalLong isEmpty(..)", true),
new UsesMethod<>("java.util.stream.LongStream findFirst(..)", true)
@@ -482,8 +480,6 @@
new UsesType<>("java.util.stream.LongStream", true),
Preconditions.or(
new UsesMethod<>("java.util.stream.LongStream count(..)", true),
- new UsesMethod<>("java.util.stream.LongStream count(..)", true),
- new UsesMethod<>("java.util.stream.LongStream count(..)", true),
Preconditions.and(
new UsesMethod<>("java.util.OptionalLong isPresent(..)", true),
new UsesMethod<>("java.util.stream.LongStream findFirst(..)", true)
@@ -627,18 +623,18 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.util.stream.LongStream", true),
new UsesType<>("java.util.function.LongPredicate", true),
+ new UsesType<>("java.util.stream.LongStream", true),
Preconditions.or(
new UsesMethod<>("java.util.stream.LongStream anyMatch(..)", true),
Preconditions.and(
- new UsesMethod<>("java.util.stream.LongStream allMatch(..)", true),
- new UsesMethod<>("java.util.function.LongPredicate negate(..)", true)
+ new UsesMethod<>("java.util.OptionalLong isEmpty(..)", true),
+ new UsesMethod<>("java.util.stream.LongStream filter(..)", true),
+ new UsesMethod<>("java.util.stream.LongStream findAny(..)", true)
),
Preconditions.and(
- new UsesMethod<>("java.util.OptionalLong isEmpty(..)", true),
- new UsesMethod<>("java.util.stream.LongStream findAny(..)", true),
- new UsesMethod<>("java.util.stream.LongStream filter(..)", true)
+ new UsesMethod<>("java.util.function.LongPredicate negate(..)", true),
+ new UsesMethod<>("java.util.stream.LongStream allMatch(..)", true)
)
)
),
@@ -708,14 +704,14 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.util.stream.LongStream", true),
new UsesType<>("java.util.function.LongPredicate", true),
+ new UsesType<>("java.util.stream.LongStream", true),
Preconditions.or(
new UsesMethod<>("java.util.stream.LongStream noneMatch(..)", true),
Preconditions.and(
new UsesMethod<>("java.util.OptionalLong isPresent(..)", true),
- new UsesMethod<>("java.util.stream.LongStream findAny(..)", true),
- new UsesMethod<>("java.util.stream.LongStream filter(..)", true)
+ new UsesMethod<>("java.util.stream.LongStream filter(..)", true),
+ new UsesMethod<>("java.util.stream.LongStream findAny(..)", true)
)
)
),
@@ -774,10 +770,10 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.util.stream.LongStream", true),
new UsesType<>("java.util.function.LongPredicate", true),
- new UsesMethod<>("java.util.stream.LongStream noneMatch(..)", true),
- new UsesMethod<>("java.util.function.LongPredicate negate(..)", true)
+ new UsesType<>("java.util.stream.LongStream", true),
+ new UsesMethod<>("java.util.function.LongPredicate negate(..)", true),
+ new UsesMethod<>("java.util.stream.LongStream noneMatch(..)", true)
),
javaVisitor
);
@@ -834,8 +830,8 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.util.stream.LongStream", true),
new UsesType<>("java.util.function.LongPredicate", true),
+ new UsesType<>("java.util.stream.LongStream", true),
new UsesMethod<>("java.util.stream.LongStream filter(..)", true),
new UsesMethod<>("java.util.stream.LongStream takeWhile(..)", true)
),
diff -u -r MicrometerRulesRecipes.java MicrometerRulesRecipes.java
--- MicrometerRulesRecipes.java 2024-12-22 11:47:38.174025664 +0100
+++ MicrometerRulesRecipes.java 2024-12-22 11:47:44.939053276 +0100
@@ -123,12 +123,12 @@
new UsesType<>("io.micrometer.core.instrument.Tag", true),
Preconditions.or(
Preconditions.and(
- new UsesType<>("com.google.common.collect.ImmutableSet", true),
- new UsesMethod<>("com.google.common.collect.ImmutableSet of(..)", true)
- ),
- Preconditions.and(
new UsesType<>("com.google.common.collect.ImmutableList", true),
new UsesMethod<>("com.google.common.collect.ImmutableList of(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("com.google.common.collect.ImmutableSet", true),
+ new UsesMethod<>("com.google.common.collect.ImmutableSet of(..)", true)
)
)
),
@@ -209,12 +209,12 @@
new UsesType<>("io.micrometer.core.instrument.Tag", true),
Preconditions.or(
Preconditions.and(
- new UsesType<>("com.google.common.collect.ImmutableSet", true),
- new UsesMethod<>("com.google.common.collect.ImmutableSet of(..)", true)
- ),
- Preconditions.and(
new UsesType<>("com.google.common.collect.ImmutableList", true),
new UsesMethod<>("com.google.common.collect.ImmutableList of(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("com.google.common.collect.ImmutableSet", true),
+ new UsesMethod<>("com.google.common.collect.ImmutableSet of(..)", true)
)
)
),
@@ -295,12 +295,12 @@
new UsesType<>("io.micrometer.core.instrument.Tag", true),
Preconditions.or(
Preconditions.and(
- new UsesType<>("com.google.common.collect.ImmutableSet", true),
- new UsesMethod<>("com.google.common.collect.ImmutableSet of(..)", true)
- ),
- Preconditions.and(
new UsesType<>("com.google.common.collect.ImmutableList", true),
new UsesMethod<>("com.google.common.collect.ImmutableList of(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("com.google.common.collect.ImmutableSet", true),
+ new UsesMethod<>("com.google.common.collect.ImmutableSet of(..)", true)
)
)
),
@@ -381,12 +381,12 @@
new UsesType<>("io.micrometer.core.instrument.Tag", true),
Preconditions.or(
Preconditions.and(
- new UsesType<>("com.google.common.collect.ImmutableSet", true),
- new UsesMethod<>("com.google.common.collect.ImmutableSet of(..)", true)
- ),
- Preconditions.and(
new UsesType<>("com.google.common.collect.ImmutableList", true),
new UsesMethod<>("com.google.common.collect.ImmutableList of(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("com.google.common.collect.ImmutableSet", true),
+ new UsesMethod<>("com.google.common.collect.ImmutableSet of(..)", true)
)
)
),
@@ -467,12 +467,12 @@
new UsesType<>("io.micrometer.core.instrument.Tag", true),
Preconditions.or(
Preconditions.and(
- new UsesType<>("com.google.common.collect.ImmutableSet", true),
- new UsesMethod<>("com.google.common.collect.ImmutableSet of(..)", true)
- ),
- Preconditions.and(
new UsesType<>("com.google.common.collect.ImmutableList", true),
new UsesMethod<>("com.google.common.collect.ImmutableList of(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("com.google.common.collect.ImmutableSet", true),
+ new UsesMethod<>("com.google.common.collect.ImmutableSet of(..)", true)
)
)
),
diff -u -r NullRulesRecipes.java NullRulesRecipes.java
--- NullRulesRecipes.java 2024-12-22 11:47:38.176025672 +0100
+++ NullRulesRecipes.java 2024-12-22 11:47:44.942053288 +0100
@@ -73,7 +73,7 @@
@Override
public TreeVisitor<?, ExecutionContext> getVisitor() {
- JavaVisitor<ExecutionContext> javaVisitor = new AbstractRefasterJavaVisitor() {
+ return new AbstractRefasterJavaVisitor() {
final JavaTemplate before$0 = JavaTemplate
.builder("null == #{object:any([email protected] Object)}")
.build();
@@ -108,13 +108,6 @@
}
};
- return Preconditions.check(
- Preconditions.and(
- new UsesType<>("java.util.Objects", true),
- new UsesMethod<>("java.util.Objects isNull(..)", true)
- ),
- javaVisitor
- );
}
}
@@ -143,7 +136,7 @@
@Override
public TreeVisitor<?, ExecutionContext> getVisitor() {
- JavaVisitor<ExecutionContext> javaVisitor = new AbstractRefasterJavaVisitor() {
+ return new AbstractRefasterJavaVisitor() {
final JavaTemplate before$0 = JavaTemplate
.builder("null != #{object:any([email protected] Object)}")
.build();
@@ -178,13 +171,6 @@
}
};
- return Preconditions.check(
- Preconditions.and(
- new UsesType<>("java.util.Objects", true),
- new UsesMethod<>("java.util.Objects nonNull(..)", true)
- ),
- javaVisitor
- );
}
}
diff -u -r PrimitiveRulesRecipes.java PrimitiveRulesRecipes.java
--- PrimitiveRulesRecipes.java 2024-12-22 11:47:38.194025745 +0100
+++ PrimitiveRulesRecipes.java 2024-12-22 11:47:44.961053365 +0100
@@ -2068,11 +2068,11 @@
};
return Preconditions.check(
Preconditions.or(
+ new UsesMethod<>("java.lang.Integer parseUnsignedInt(..)", true),
Preconditions.and(
- new UsesType<>("com.google.common.primitives.UnsignedInts", true),
- new UsesMethod<>("com.google.common.primitives.UnsignedInts parseUnsignedInt(..)", true)
- ),
- new UsesMethod<>("java.lang.Integer parseUnsignedInt(..)", true)
+ new UsesType<>("com.google.common.primitives.UnsignedInts", true),
+ new UsesMethod<>("com.google.common.primitives.UnsignedInts parseUnsignedInt(..)", true)
+ )
),
javaVisitor
);
@@ -2142,11 +2142,11 @@
};
return Preconditions.check(
Preconditions.or(
+ new UsesMethod<>("java.lang.Long parseUnsignedLong(..)", true),
Preconditions.and(
- new UsesType<>("com.google.common.primitives.UnsignedLongs", true),
- new UsesMethod<>("com.google.common.primitives.UnsignedLongs parseUnsignedLong(..)", true)
- ),
- new UsesMethod<>("java.lang.Long parseUnsignedLong(..)", true)
+ new UsesType<>("com.google.common.primitives.UnsignedLongs", true),
+ new UsesMethod<>("com.google.common.primitives.UnsignedLongs parseUnsignedLong(..)", true)
+ )
),
javaVisitor
);
@@ -2336,11 +2336,11 @@
};
return Preconditions.check(
Preconditions.or(
+ new UsesMethod<>("java.lang.Integer toUnsignedString(..)", true),
Preconditions.and(
- new UsesType<>("com.google.common.primitives.UnsignedInts", true),
- new UsesMethod<>("com.google.common.primitives.UnsignedInts toString(..)", true)
- ),
- new UsesMethod<>("java.lang.Integer toUnsignedString(..)", true)
+ new UsesType<>("com.google.common.primitives.UnsignedInts", true),
+ new UsesMethod<>("com.google.common.primitives.UnsignedInts toString(..)", true)
+ )
),
javaVisitor
);
@@ -2410,11 +2410,11 @@
};
return Preconditions.check(
Preconditions.or(
+ new UsesMethod<>("java.lang.Long toUnsignedString(..)", true),
Preconditions.and(
- new UsesType<>("com.google.common.primitives.UnsignedLongs", true),
- new UsesMethod<>("com.google.common.primitives.UnsignedLongs toString(..)", true)
- ),
- new UsesMethod<>("java.lang.Long toUnsignedString(..)", true)
+ new UsesType<>("com.google.common.primitives.UnsignedLongs", true),
+ new UsesMethod<>("com.google.common.primitives.UnsignedLongs toString(..)", true)
+ )
),
javaVisitor
);
diff -u -r ReactorRulesRecipes.java ReactorRulesRecipes.java
--- ReactorRulesRecipes.java 2024-12-22 11:47:38.206025794 +0100
+++ ReactorRulesRecipes.java 2024-12-22 11:47:44.974053418 +0100
@@ -167,8 +167,8 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("reactor.test.StepVerifier", true),
new UsesType<>("java.time.Duration", true),
+ new UsesType<>("reactor.test.StepVerifier", true),
new UsesMethod<>("reactor.test.StepVerifier verifyThenAssertThat(..)", true)
),
javaVisitor
@@ -425,14 +425,14 @@
new UsesType<>("java.util.function.Predicate", true),
Preconditions.or(
Preconditions.and(
+ new UsesMethod<>("reactor.test.StepVerifier verifyThenAssertThat(..)", true),
+ new UsesMethod<>("reactor.test.StepVerifier.Assertions hasOperatorErrorMatching(..)", true),
+ new UsesMethod<>("reactor.test.StepVerifier.LastStep expectError(..)", true)
+ ),
+ Preconditions.and(
new UsesType<>("java.time.Duration", true),
new UsesMethod<>("reactor.test.StepVerifier verify(..)", true),
new UsesMethod<>("reactor.test.StepVerifier.LastStep expectErrorMatches(..)", true)
- ),
- Preconditions.and(
- new UsesMethod<>("reactor.test.StepVerifier.Assertions hasOperatorErrorMatching(..)", true),
- new UsesMethod<>("reactor.test.StepVerifier verifyThenAssertThat(..)", true),
- new UsesMethod<>("reactor.test.StepVerifier.LastStep expectError(..)", true)
)
)
),
diff -u -r RxJava2AdapterRulesRecipes.java RxJava2AdapterRulesRecipes.java
--- RxJava2AdapterRulesRecipes.java 2024-12-22 11:47:38.208025803 +0100
+++ RxJava2AdapterRulesRecipes.java 2024-12-22 11:47:44.976053426 +0100
@@ -111,12 +111,12 @@
};
return Preconditions.check(
Preconditions.and(
+ new UsesType<>("io.reactivex.Completable", true),
new UsesType<>("reactor.adapter.rxjava.RxJava2Adapter", true),
new UsesType<>("reactor.core.publisher.Mono", true),
- new UsesType<>("io.reactivex.Completable", true),
Preconditions.or(
- new UsesMethod<>("reactor.adapter.rxjava.RxJava2Adapter completableToMono(..)", true),
- new UsesMethod<>("io.reactivex.Completable to(..)", true)
+ new UsesMethod<>("io.reactivex.Completable to(..)", true),
+ new UsesMethod<>("reactor.adapter.rxjava.RxJava2Adapter completableToMono(..)", true)
)
),
javaVisitor
diff -u -r StringRulesRecipes.java StringRulesRecipes.java
--- StringRulesRecipes.java 2024-12-22 11:47:38.220025851 +0100
+++ StringRulesRecipes.java 2024-12-22 11:47:44.989053479 +0100
@@ -440,22 +440,28 @@
return Preconditions.check(
Preconditions.or(
Preconditions.and(
- new UsesType<>("com.google.common.base.Joiner", true),
- new UsesMethod<>("com.google.common.base.Joiner join(..)", true),
- new UsesMethod<>("com.google.common.base.Joiner on(..)", true)
- ),
+ new UsesType<>("com.google.common.base.Joiner", true),
+ new UsesMethod<>("com.google.common.base.Joiner join(..)", true),
+ new UsesMethod<>("com.google.common.base.Joiner on(..)", true)
+ ),
Preconditions.and(
- new UsesType<>("com.google.common.collect.Streams", true),
- new UsesMethod<>("java.util.stream.Stream collect(..)", true),
- new UsesMethod<>("com.google.common.collect.Streams stream(..)", true),
- new UsesMethod<>("java.util.stream.Collectors joining(..)", true)
- ),
+ new UsesType<>("com.google.common.collect.Streams", true),
+ new UsesMethod<>("com.google.common.collect.Streams stream(..)", true),
+ new UsesMethod<>("java.util.stream.Collectors joining(..)", true),
+ new UsesMethod<>("java.util.stream.Stream collect(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("java.util.Arrays", true),
+ new UsesMethod<>("java.util.Arrays stream(..)", true),
+ new UsesMethod<>("java.util.stream.Collectors joining(..)", true),
+ new UsesMethod<>("java.util.stream.Stream collect(..)", true)
+ ),
Preconditions.and(
- new UsesType<>("java.util.Collection", true),
- new UsesMethod<>("java.util.stream.Stream collect(..)", true),
- new UsesMethod<>("java.util.Collection stream(..)", true),
- new UsesMethod<>("java.util.stream.Collectors joining(..)", true)
- )
+ new UsesType<>("java.util.Collection", true),
+ new UsesMethod<>("java.util.Collection stream(..)", true),
+ new UsesMethod<>("java.util.stream.Collectors joining(..)", true),
+ new UsesMethod<>("java.util.stream.Stream collect(..)", true)
+ )
),
javaVisitor
);
@@ -582,8 +588,8 @@
};
return Preconditions.check(
Preconditions.or(
- new UsesMethod<>("java.lang.String valueOf(..)", true),
- new UsesMethod<>("java.lang.String copyValueOf(..)", true)
+ new UsesMethod<>("java.lang.String copyValueOf(..)", true),
+ new UsesMethod<>("java.lang.String valueOf(..)", true)
),
javaVisitor
);
@@ -651,8 +657,8 @@
};
return Preconditions.check(
Preconditions.or(
- new UsesMethod<>("java.lang.String valueOf(..)", true),
- new UsesMethod<>("java.lang.String <constructor>(..)", true)
+ new UsesMethod<>("java.lang.String <constructor>(..)", true),
+ new UsesMethod<>("java.lang.String valueOf(..)", true)
),
javaVisitor
);
@@ -709,8 +715,8 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesMethod<>("java.lang.String substring(..)", true),
- new UsesMethod<>("java.lang.String length(..)", true)
+ new UsesMethod<>("java.lang.String length(..)", true),
+ new UsesMethod<>("java.lang.String substring(..)", true)
),
javaVisitor
);
diff -u -r SuggestedFixRulesRecipes.java SuggestedFixRulesRecipes.java
--- SuggestedFixRulesRecipes.java 2024-12-22 11:47:38.223025864 +0100
+++ SuggestedFixRulesRecipes.java 2024-12-22 11:47:44.992053492 +0100
@@ -107,9 +107,9 @@
Preconditions.and(
new UsesType<>("com.google.errorprone.fixes.SuggestedFix", true),
new UsesType<>("com.sun.source.tree.Tree", true),
+ new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix builder(..)", true),
new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder build(..)", true),
- new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder delete(..)", true),
- new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix builder(..)", true)
+ new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder delete(..)", true)
),
javaVisitor
);
@@ -170,9 +170,9 @@
Preconditions.and(
new UsesType<>("com.google.errorprone.fixes.SuggestedFix", true),
new UsesType<>("com.sun.source.tree.Tree", true),
+ new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix builder(..)", true),
new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder build(..)", true),
- new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder replace(..)", true),
- new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix builder(..)", true)
+ new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder replace(..)", true)
),
javaVisitor
);
@@ -232,9 +232,9 @@
return Preconditions.check(
Preconditions.and(
new UsesType<>("com.google.errorprone.fixes.SuggestedFix", true),
+ new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix builder(..)", true),
new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder build(..)", true),
- new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder replace(..)", true),
- new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix builder(..)", true)
+ new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder replace(..)", true)
),
javaVisitor
);
@@ -295,9 +295,9 @@
Preconditions.and(
new UsesType<>("com.google.errorprone.fixes.SuggestedFix", true),
new UsesType<>("com.sun.source.tree.Tree", true),
+ new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix builder(..)", true),
new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder build(..)", true),
- new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder replace(..)", true),
- new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix builder(..)", true)
+ new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder replace(..)", true)
),
javaVisitor
);
@@ -358,9 +358,9 @@
Preconditions.and(
new UsesType<>("com.google.errorprone.fixes.SuggestedFix", true),
new UsesType<>("com.sun.source.tree.Tree", true),
+ new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix builder(..)", true),
new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder build(..)", true),
- new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder swap(..)", true),
- new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix builder(..)", true)
+ new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder swap(..)", true)
),
javaVisitor
);
@@ -421,9 +421,9 @@
Preconditions.and(
new UsesType<>("com.google.errorprone.fixes.SuggestedFix", true),
new UsesType<>("com.sun.source.tree.Tree", true),
+ new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix builder(..)", true),
new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder build(..)", true),
- new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder prefixWith(..)", true),
- new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix builder(..)", true)
+ new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder prefixWith(..)", true)
),
javaVisitor
);
@@ -484,9 +484,9 @@
Preconditions.and(
new UsesType<>("com.google.errorprone.fixes.SuggestedFix", true),
new UsesType<>("com.sun.source.tree.Tree", true),
+ new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix builder(..)", true),
new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder build(..)", true),
- new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder postfixWith(..)", true),
- new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix builder(..)", true)
+ new UsesMethod<>("com.google.errorprone.fixes.SuggestedFix.Builder postfixWith(..)", true)
),
javaVisitor
);
diff -u -r TestNGToAssertJRulesRecipes.java TestNGToAssertJRulesRecipes.java
--- TestNGToAssertJRulesRecipes.java 2024-12-22 11:47:38.289026133 +0100
+++ TestNGToAssertJRulesRecipes.java 2024-12-22 11:47:45.065053790 +0100
@@ -1140,10 +1140,7 @@
};
return Preconditions.check(
- Preconditions.and(
- new UsesType<>("java.util.Map", true),
- new UsesMethod<>("org.testng.Assert assertEquals(..)", true)
- ),
+ new UsesMethod<>("org.testng.Assert assertEquals(..)", true),
javaVisitor
);
}
@@ -1332,10 +1329,7 @@
};
return Preconditions.check(
- Preconditions.and(
- new UsesType<>("java.util.Map", true),
- new UsesMethod<>("org.testng.Assert assertEquals(..)", true)
- ),
+ new UsesMethod<>("org.testng.Assert assertEquals(..)", true),
javaVisitor
);
}
@@ -2210,10 +2204,7 @@
};
return Preconditions.check(
- Preconditions.and(
- new UsesType<>("java.util.Map", true),
- new UsesMethod<>("org.testng.Assert assertNotEquals(..)", true)
- ),
+ new UsesMethod<>("org.testng.Assert assertNotEquals(..)", true),
javaVisitor
);
}
@@ -2416,10 +2407,7 @@
};
return Preconditions.check(
- Preconditions.and(
- new UsesType<>("java.util.Map", true),
- new UsesMethod<>("org.testng.Assert assertNotEquals(..)", true)
- ),
+ new UsesMethod<>("org.testng.Assert assertNotEquals(..)", true),
javaVisitor
);
}
diff -u -r TimeRulesRecipes.java TimeRulesRecipes.java
--- TimeRulesRecipes.java 2024-12-22 11:47:38.413026639 +0100
+++ TimeRulesRecipes.java 2024-12-22 11:47:45.203054353 +0100
@@ -205,8 +205,8 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.Instant", true),
new UsesType<>("java.time.Clock", true),
+ new UsesType<>("java.time.Instant", true),
new UsesMethod<>("java.time.Instant now(..)", true)
),
javaVisitor
@@ -327,12 +327,9 @@
Preconditions.and(
new UsesType<>("java.time.ZoneId", true),
Preconditions.or(
+ new UsesMethod<>("java.time.ZoneId from(..)", true),
new UsesMethod<>("java.time.ZoneId of(..)", true),
- new UsesMethod<>("java.time.ZoneId of(..)", true),
- new UsesMethod<>("java.time.ZoneId of(..)", true),
- new UsesMethod<>("java.time.ZoneId of(..)", true),
- new UsesMethod<>("java.time.ZoneOffset normalized(..)", true),
- new UsesMethod<>("java.time.ZoneId from(..)", true)
+ new UsesMethod<>("java.time.ZoneOffset normalized(..)", true)
)
),
javaVisitor
@@ -426,30 +423,30 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.LocalDate", true),
new UsesType<>("java.time.Instant", true),
+ new UsesType<>("java.time.LocalDate", true),
Preconditions.or(
Preconditions.and(
+ new UsesType<>("java.time.LocalDateTime", true),
new UsesType<>("java.time.ZoneId", true),
- new UsesMethod<>("java.time.ZonedDateTime toLocalDate(..)", true),
- new UsesMethod<>("java.time.Instant atZone(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime ofInstant(..)", true),
+ new UsesMethod<>("java.time.LocalDateTime toLocalDate(..)", true)
),
Preconditions.and(
- new UsesType<>("java.time.LocalDateTime", true),
+ new UsesType<>("java.time.OffsetDateTime", true),
new UsesType<>("java.time.ZoneId", true),
- new UsesMethod<>("java.time.LocalDateTime toLocalDate(..)", true),
- new UsesMethod<>("java.time.LocalDateTime ofInstant(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime ofInstant(..)", true),
+ new UsesMethod<>("java.time.OffsetDateTime toLocalDate(..)", true)
),
Preconditions.and(
- new UsesType<>("java.time.OffsetDateTime", true),
new UsesType<>("java.time.ZoneId", true),
- new UsesMethod<>("java.time.OffsetDateTime toLocalDate(..)", true),
- new UsesMethod<>("java.time.OffsetDateTime ofInstant(..)", true)
+ new UsesMethod<>("java.time.Instant atZone(..)", true),
+ new UsesMethod<>("java.time.ZonedDateTime toLocalDate(..)", true)
),
Preconditions.and(
new UsesType<>("java.time.ZoneOffset", true),
- new UsesMethod<>("java.time.OffsetDateTime toLocalDate(..)", true),
- new UsesMethod<>("java.time.Instant atOffset(..)", true)
+ new UsesMethod<>("java.time.Instant atOffset(..)", true),
+ new UsesMethod<>("java.time.OffsetDateTime toLocalDate(..)", true)
)
)
),
@@ -532,24 +529,24 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.LocalDateTime", true),
new UsesType<>("java.time.Instant", true),
+ new UsesType<>("java.time.LocalDateTime", true),
Preconditions.or(
Preconditions.and(
+ new UsesType<>("java.time.OffsetDateTime", true),
new UsesType<>("java.time.ZoneId", true),
- new UsesMethod<>("java.time.ZonedDateTime toLocalDateTime(..)", true),
- new UsesMethod<>("java.time.Instant atZone(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime ofInstant(..)", true),
+ new UsesMethod<>("java.time.OffsetDateTime toLocalDateTime(..)", true)
),
Preconditions.and(
- new UsesType<>("java.time.OffsetDateTime", true),
new UsesType<>("java.time.ZoneId", true),
- new UsesMethod<>("java.time.OffsetDateTime toLocalDateTime(..)", true),
- new UsesMethod<>("java.time.OffsetDateTime ofInstant(..)", true)
+ new UsesMethod<>("java.time.Instant atZone(..)", true),
+ new UsesMethod<>("java.time.ZonedDateTime toLocalDateTime(..)", true)
),
Preconditions.and(
new UsesType<>("java.time.ZoneOffset", true),
- new UsesMethod<>("java.time.OffsetDateTime toLocalDateTime(..)", true),
- new UsesMethod<>("java.time.Instant atOffset(..)", true)
+ new UsesMethod<>("java.time.Instant atOffset(..)", true),
+ new UsesMethod<>("java.time.OffsetDateTime toLocalDateTime(..)", true)
)
)
),
@@ -656,36 +653,36 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.LocalTime", true),
new UsesType<>("java.time.Instant", true),
+ new UsesType<>("java.time.LocalTime", true),
Preconditions.or(
Preconditions.and(
- new UsesType<>("java.time.ZoneId", true),
- new UsesMethod<>("java.time.ZonedDateTime toLocalTime(..)", true),
- new UsesMethod<>("java.time.Instant atZone(..)", true)
- ),
- Preconditions.and(
new UsesType<>("java.time.LocalDateTime", true),
new UsesType<>("java.time.ZoneId", true),
- new UsesMethod<>("java.time.LocalDateTime toLocalTime(..)", true),
- new UsesMethod<>("java.time.LocalDateTime ofInstant(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime ofInstant(..)", true),
+ new UsesMethod<>("java.time.LocalDateTime toLocalTime(..)", true)
),
Preconditions.and(
new UsesType<>("java.time.OffsetDateTime", true),
new UsesType<>("java.time.ZoneId", true),
- new UsesMethod<>("java.time.OffsetDateTime toLocalTime(..)", true),
- new UsesMethod<>("java.time.OffsetDateTime ofInstant(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime ofInstant(..)", true),
+ new UsesMethod<>("java.time.OffsetDateTime toLocalTime(..)", true)
),
Preconditions.and(
new UsesType<>("java.time.OffsetTime", true),
new UsesType<>("java.time.ZoneId", true),
- new UsesMethod<>("java.time.OffsetTime toLocalTime(..)", true),
- new UsesMethod<>("java.time.OffsetTime ofInstant(..)", true)
+ new UsesMethod<>("java.time.OffsetTime ofInstant(..)", true),
+ new UsesMethod<>("java.time.OffsetTime toLocalTime(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("java.time.ZoneId", true),
+ new UsesMethod<>("java.time.Instant atZone(..)", true),
+ new UsesMethod<>("java.time.ZonedDateTime toLocalTime(..)", true)
),
Preconditions.and(
new UsesType<>("java.time.ZoneOffset", true),
- new UsesMethod<>("java.time.OffsetDateTime toLocalTime(..)", true),
- new UsesMethod<>("java.time.Instant atOffset(..)", true)
+ new UsesMethod<>("java.time.Instant atOffset(..)", true),
+ new UsesMethod<>("java.time.OffsetDateTime toLocalTime(..)", true)
)
)
),
@@ -744,11 +741,11 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.OffsetDateTime", true),
new UsesType<>("java.time.Instant", true),
+ new UsesType<>("java.time.OffsetDateTime", true),
new UsesType<>("java.time.ZoneId", true),
- new UsesMethod<>("java.time.ZonedDateTime toOffsetDateTime(..)", true),
- new UsesMethod<>("java.time.Instant atZone(..)", true)
+ new UsesMethod<>("java.time.Instant atZone(..)", true),
+ new UsesMethod<>("java.time.ZonedDateTime toOffsetDateTime(..)", true)
),
javaVisitor
);
@@ -956,34 +953,34 @@
new UsesType<>("java.time.Instant", true),
new UsesType<>("java.time.temporal.TemporalUnit", true),
Preconditions.or(
- Preconditions.and(
- new UsesType<>("java.time.Duration", true),
- new UsesMethod<>("java.time.Instant plus(..)", true)
- ),
+ new UsesMethod<>("java.time.Instant minus(..)", true),
+ new UsesMethod<>("java.time.Instant minusMillis(..)", true),
+ new UsesMethod<>("java.time.Instant minusNanos(..)", true),
+ new UsesMethod<>("java.time.Instant minusSeconds(..)", true),
new UsesMethod<>("java.time.Instant plus(..)", true),
- new UsesMethod<>("java.time.Instant plusNanos(..)", true),
new UsesMethod<>("java.time.Instant plusMillis(..)", true),
+ new UsesMethod<>("java.time.Instant plusNanos(..)", true),
new UsesMethod<>("java.time.Instant plusSeconds(..)", true),
Preconditions.and(
- new UsesType<>("java.time.Duration", true),
- new UsesMethod<>("java.time.Instant minus(..)", true)
+ new UsesMethod<>("java.time.Instant getEpochSecond(..)", true),
+ new UsesMethod<>("java.time.Instant getNano(..)", true),
+ new UsesMethod<>("java.time.Instant ofEpochSecond(..)", true)
),
- new UsesMethod<>("java.time.Instant minus(..)", true),
- new UsesMethod<>("java.time.Instant minusNanos(..)", true),
- new UsesMethod<>("java.time.Instant minusMillis(..)", true),
- new UsesMethod<>("java.time.Instant minusSeconds(..)", true),
Preconditions.and(
new UsesMethod<>("java.time.Instant parse(..)", true),
new UsesMethod<>("java.time.Instant toString(..)", true)
),
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
- new UsesMethod<>("java.time.Instant truncatedTo(..)", true)
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Instant minus(..)", true)
),
Preconditions.and(
- new UsesMethod<>("java.time.Instant ofEpochSecond(..)", true),
- new UsesMethod<>("java.time.Instant getEpochSecond(..)", true),
- new UsesMethod<>("java.time.Instant getNano(..)", true)
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Instant plus(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ new UsesMethod<>("java.time.Instant truncatedTo(..)", true)
)
)
),
@@ -1102,8 +1099,8 @@
return Preconditions.check(
Preconditions.and(
new UsesType<>("java.time.Instant", true),
- new UsesMethod<>("java.time.Instant ofEpochSecond(..)", true),
- new UsesMethod<>("java.time.Instant getEpochSecond(..)", true)
+ new UsesMethod<>("java.time.Instant getEpochSecond(..)", true),
+ new UsesMethod<>("java.time.Instant ofEpochSecond(..)", true)
),
javaVisitor
);
@@ -1160,8 +1157,8 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.OffsetDateTime", true),
new UsesType<>("java.time.Instant", true),
+ new UsesType<>("java.time.OffsetDateTime", true),
new UsesType<>("java.time.ZoneOffset", true),
new UsesMethod<>("java.time.OffsetDateTime ofInstant(..)", true)
),
@@ -1233,11 +1230,20 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.OffsetTime", true),
new UsesType<>("java.time.Instant", true),
- new UsesType<>("java.time.ZoneOffset", true),
+ new UsesType<>("java.time.OffsetTime", true),
new UsesMethod<>("java.time.OffsetDateTime toOffsetTime(..)", true),
- new UsesMethod<>("java.time.Instant atOffset(..)", true)
+ Preconditions.or(
+ Preconditions.and(
+ new UsesType<>("java.time.OffsetDateTime", true),
+ new UsesType<>("java.time.ZoneId", true),
+ new UsesMethod<>("java.time.OffsetDateTime ofInstant(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("java.time.ZoneOffset", true),
+ new UsesMethod<>("java.time.Instant atOffset(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -1294,9 +1300,9 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.ZonedDateTime", true),
new UsesType<>("java.time.Instant", true),
new UsesType<>("java.time.ZoneId", true),
+ new UsesType<>("java.time.ZonedDateTime", true),
new UsesMethod<>("java.time.ZonedDateTime ofInstant(..)", true)
),
javaVisitor
@@ -1438,7 +1444,6 @@
new UsesType<>("java.time.Instant", true),
Preconditions.or(
new UsesMethod<>("java.time.Instant ofEpochMilli(..)", true),
- new UsesMethod<>("java.time.Instant ofEpochSecond(..)", true),
new UsesMethod<>("java.time.Instant ofEpochSecond(..)", true)
)
),
@@ -1667,16 +1672,7 @@
};
return Preconditions.check(
- Preconditions.and(
- new UsesType<>("java.time.LocalTime", true),
- Preconditions.or(
- new UsesMethod<>("java.time.LocalTime of(..)", true),
- new UsesMethod<>("java.time.LocalTime of(..)", true),
- new UsesMethod<>("java.time.LocalTime of(..)", true),
- new UsesMethod<>("java.time.LocalTime ofNanoOfDay(..)", true),
- new UsesMethod<>("java.time.LocalTime ofSecondOfDay(..)", true)
- )
- ),
+ new UsesType<>("java.time.LocalTime", true),
javaVisitor
);
}
@@ -1733,9 +1729,9 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.LocalTime", true),
- new UsesType<>("java.time.LocalDateTime", true),
new UsesType<>("java.time.LocalDate", true),
+ new UsesType<>("java.time.LocalDateTime", true),
+ new UsesType<>("java.time.LocalTime", true),
new UsesMethod<>("java.time.LocalDate atTime(..)", true)
),
javaVisitor
@@ -2345,14 +2341,13 @@
new UsesType<>("java.time.Duration", true),
new UsesType<>("java.time.temporal.TemporalUnit", true),
Preconditions.or(
- new UsesMethod<>("java.time.Duration ofNanos(..)", true),
+ new UsesMethod<>("java.time.Duration of(..)", true),
+ new UsesMethod<>("java.time.Duration ofDays(..)", true),
+ new UsesMethod<>("java.time.Duration ofHours(..)", true),
new UsesMethod<>("java.time.Duration ofMillis(..)", true),
- new UsesMethod<>("java.time.Duration ofSeconds(..)", true),
- new UsesMethod<>("java.time.Duration ofSeconds(..)", true),
new UsesMethod<>("java.time.Duration ofMinutes(..)", true),
- new UsesMethod<>("java.time.Duration ofHours(..)", true),
- new UsesMethod<>("java.time.Duration ofDays(..)", true),
- new UsesMethod<>("java.time.Duration of(..)", true)
+ new UsesMethod<>("java.time.Duration ofNanos(..)", true),
+ new UsesMethod<>("java.time.Duration ofSeconds(..)", true)
)
),
javaVisitor
@@ -3024,11 +3019,11 @@
Preconditions.and(
new UsesType<>("java.time.Period", true),
Preconditions.or(
+ new UsesMethod<>("java.time.Period of(..)", true),
new UsesMethod<>("java.time.Period ofDays(..)", true),
- new UsesMethod<>("java.time.Period ofWeeks(..)", true),
new UsesMethod<>("java.time.Period ofMonths(..)", true),
- new UsesMethod<>("java.time.Period ofYears(..)", true),
- new UsesMethod<>("java.time.Period of(..)", true)
+ new UsesMethod<>("java.time.Period ofWeeks(..)", true),
+ new UsesMethod<>("java.time.Period ofYears(..)", true)
)
),
javaVisitor
@@ -3099,9 +3094,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDate", true),
- new UsesMethod<>("java.time.LocalDate plus(..)", true)
+ new UsesMethod<>("java.time.LocalDate plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofDays(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -3171,9 +3172,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDate", true),
- new UsesMethod<>("java.time.LocalDate plus(..)", true)
+ new UsesMethod<>("java.time.LocalDate plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofWeeks(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -3243,9 +3250,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDate", true),
- new UsesMethod<>("java.time.LocalDate plus(..)", true)
+ new UsesMethod<>("java.time.LocalDate plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofMonths(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -3315,9 +3328,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDate", true),
- new UsesMethod<>("java.time.LocalDate plus(..)", true)
+ new UsesMethod<>("java.time.LocalDate plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofYears(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -3387,9 +3406,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDate", true),
- new UsesMethod<>("java.time.LocalDate minus(..)", true)
+ new UsesMethod<>("java.time.LocalDate minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofDays(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -3459,9 +3484,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDate", true),
- new UsesMethod<>("java.time.LocalDate minus(..)", true)
+ new UsesMethod<>("java.time.LocalDate minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofWeeks(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -3531,9 +3562,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDate", true),
- new UsesMethod<>("java.time.LocalDate minus(..)", true)
+ new UsesMethod<>("java.time.LocalDate minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofMonths(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -3603,9 +3640,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDate", true),
- new UsesMethod<>("java.time.LocalDate minus(..)", true)
+ new UsesMethod<>("java.time.LocalDate minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofYears(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -3675,9 +3718,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalTime", true),
- new UsesMethod<>("java.time.LocalTime plus(..)", true)
+ new UsesMethod<>("java.time.LocalTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofNanos(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -3747,9 +3796,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalTime", true),
- new UsesMethod<>("java.time.LocalTime plus(..)", true)
+ new UsesMethod<>("java.time.LocalTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofSeconds(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -3819,9 +3874,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalTime", true),
- new UsesMethod<>("java.time.LocalTime plus(..)", true)
+ new UsesMethod<>("java.time.LocalTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofMinutes(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -3891,9 +3952,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalTime", true),
- new UsesMethod<>("java.time.LocalTime plus(..)", true)
+ new UsesMethod<>("java.time.LocalTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofHours(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -3963,9 +4030,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalTime", true),
- new UsesMethod<>("java.time.LocalTime minus(..)", true)
+ new UsesMethod<>("java.time.LocalTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofNanos(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -4035,9 +4108,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalTime", true),
- new UsesMethod<>("java.time.LocalTime minus(..)", true)
+ new UsesMethod<>("java.time.LocalTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofSeconds(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -4107,9 +4186,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalTime", true),
- new UsesMethod<>("java.time.LocalTime minus(..)", true)
+ new UsesMethod<>("java.time.LocalTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofMinutes(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -4179,9 +4264,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalTime", true),
- new UsesMethod<>("java.time.LocalTime minus(..)", true)
+ new UsesMethod<>("java.time.LocalTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofHours(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -4251,9 +4342,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetTime", true),
- new UsesMethod<>("java.time.OffsetTime plus(..)", true)
+ new UsesMethod<>("java.time.OffsetTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofNanos(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -4323,9 +4420,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetTime", true),
- new UsesMethod<>("java.time.OffsetTime plus(..)", true)
+ new UsesMethod<>("java.time.OffsetTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofSeconds(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -4395,9 +4498,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetTime", true),
- new UsesMethod<>("java.time.OffsetTime plus(..)", true)
+ new UsesMethod<>("java.time.OffsetTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofMinutes(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -4467,9 +4576,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetTime", true),
- new UsesMethod<>("java.time.OffsetTime plus(..)", true)
+ new UsesMethod<>("java.time.OffsetTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofHours(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -4539,9 +4654,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetTime", true),
- new UsesMethod<>("java.time.OffsetTime minus(..)", true)
+ new UsesMethod<>("java.time.OffsetTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofNanos(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -4611,9 +4732,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetTime", true),
- new UsesMethod<>("java.time.OffsetTime minus(..)", true)
+ new UsesMethod<>("java.time.OffsetTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofSeconds(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -4683,9 +4810,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetTime", true),
- new UsesMethod<>("java.time.OffsetTime minus(..)", true)
+ new UsesMethod<>("java.time.OffsetTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofMinutes(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -4755,9 +4888,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetTime", true),
- new UsesMethod<>("java.time.OffsetTime minus(..)", true)
+ new UsesMethod<>("java.time.OffsetTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofHours(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -4827,9 +4966,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDateTime", true),
- new UsesMethod<>("java.time.LocalDateTime plus(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofNanos(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -4899,9 +5044,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDateTime", true),
- new UsesMethod<>("java.time.LocalDateTime plus(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofSeconds(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -4971,9 +5122,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDateTime", true),
- new UsesMethod<>("java.time.LocalDateTime plus(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofMinutes(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -5043,9 +5200,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDateTime", true),
- new UsesMethod<>("java.time.LocalDateTime plus(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofHours(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -5115,9 +5278,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDateTime", true),
- new UsesMethod<>("java.time.LocalDateTime plus(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofDays(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -5187,9 +5356,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDateTime", true),
- new UsesMethod<>("java.time.LocalDateTime plus(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofWeeks(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -5259,9 +5434,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDateTime", true),
- new UsesMethod<>("java.time.LocalDateTime plus(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofMonths(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -5331,9 +5512,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDateTime", true),
- new UsesMethod<>("java.time.LocalDateTime plus(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofYears(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -5403,9 +5590,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDateTime", true),
- new UsesMethod<>("java.time.LocalDateTime minus(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofNanos(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -5475,9 +5668,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDateTime", true),
- new UsesMethod<>("java.time.LocalDateTime minus(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofSeconds(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -5547,9 +5746,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDateTime", true),
- new UsesMethod<>("java.time.LocalDateTime minus(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofMinutes(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -5619,9 +5824,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDateTime", true),
- new UsesMethod<>("java.time.LocalDateTime minus(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofHours(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -5691,9 +5902,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDateTime", true),
- new UsesMethod<>("java.time.LocalDateTime minus(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofDays(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -5763,9 +5980,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDateTime", true),
- new UsesMethod<>("java.time.LocalDateTime minus(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofWeeks(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -5835,9 +6058,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDateTime", true),
- new UsesMethod<>("java.time.LocalDateTime minus(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofMonths(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -5907,9 +6136,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.LocalDateTime", true),
- new UsesMethod<>("java.time.LocalDateTime minus(..)", true)
+ new UsesMethod<>("java.time.LocalDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofYears(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -5979,9 +6214,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetDateTime", true),
- new UsesMethod<>("java.time.OffsetDateTime plus(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofNanos(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -6051,9 +6292,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetDateTime", true),
- new UsesMethod<>("java.time.OffsetDateTime plus(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofSeconds(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -6123,9 +6370,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetDateTime", true),
- new UsesMethod<>("java.time.OffsetDateTime plus(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofMinutes(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -6195,9 +6448,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetDateTime", true),
- new UsesMethod<>("java.time.OffsetDateTime plus(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofHours(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -6267,9 +6526,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetDateTime", true),
- new UsesMethod<>("java.time.OffsetDateTime plus(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofDays(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -6339,9 +6604,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetDateTime", true),
- new UsesMethod<>("java.time.OffsetDateTime plus(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofWeeks(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -6411,9 +6682,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetDateTime", true),
- new UsesMethod<>("java.time.OffsetDateTime plus(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofMonths(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -6483,9 +6760,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetDateTime", true),
- new UsesMethod<>("java.time.OffsetDateTime plus(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofYears(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -6555,9 +6838,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetDateTime", true),
- new UsesMethod<>("java.time.OffsetDateTime minus(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofNanos(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -6627,9 +6916,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetDateTime", true),
- new UsesMethod<>("java.time.OffsetDateTime minus(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofSeconds(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -6699,9 +6994,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetDateTime", true),
- new UsesMethod<>("java.time.OffsetDateTime minus(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofMinutes(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -6771,9 +7072,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetDateTime", true),
- new UsesMethod<>("java.time.OffsetDateTime minus(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofHours(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -6843,9 +7150,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetDateTime", true),
- new UsesMethod<>("java.time.OffsetDateTime minus(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofDays(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -6915,9 +7228,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetDateTime", true),
- new UsesMethod<>("java.time.OffsetDateTime minus(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofWeeks(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -6987,9 +7306,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetDateTime", true),
- new UsesMethod<>("java.time.OffsetDateTime minus(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofMonths(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -7059,9 +7384,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.OffsetDateTime", true),
- new UsesMethod<>("java.time.OffsetDateTime minus(..)", true)
+ new UsesMethod<>("java.time.OffsetDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofYears(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -7131,9 +7462,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.ZonedDateTime", true),
- new UsesMethod<>("java.time.ZonedDateTime plus(..)", true)
+ new UsesMethod<>("java.time.ZonedDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofNanos(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -7203,9 +7540,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.ZonedDateTime", true),
- new UsesMethod<>("java.time.ZonedDateTime plus(..)", true)
+ new UsesMethod<>("java.time.ZonedDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofSeconds(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -7275,9 +7618,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.ZonedDateTime", true),
- new UsesMethod<>("java.time.ZonedDateTime plus(..)", true)
+ new UsesMethod<>("java.time.ZonedDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofMinutes(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -7347,9 +7696,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.ZonedDateTime", true),
- new UsesMethod<>("java.time.ZonedDateTime plus(..)", true)
+ new UsesMethod<>("java.time.ZonedDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofHours(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -7419,9 +7774,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.ZonedDateTime", true),
- new UsesMethod<>("java.time.ZonedDateTime plus(..)", true)
+ new UsesMethod<>("java.time.ZonedDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofDays(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -7491,9 +7852,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.ZonedDateTime", true),
- new UsesMethod<>("java.time.ZonedDateTime plus(..)", true)
+ new UsesMethod<>("java.time.ZonedDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofWeeks(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -7563,9 +7930,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.ZonedDateTime", true),
- new UsesMethod<>("java.time.ZonedDateTime plus(..)", true)
+ new UsesMethod<>("java.time.ZonedDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofMonths(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -7635,9 +8008,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.ZonedDateTime", true),
- new UsesMethod<>("java.time.ZonedDateTime plus(..)", true)
+ new UsesMethod<>("java.time.ZonedDateTime plus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofYears(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -7707,9 +8086,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.ZonedDateTime", true),
- new UsesMethod<>("java.time.ZonedDateTime minus(..)", true)
+ new UsesMethod<>("java.time.ZonedDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofNanos(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -7779,9 +8164,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.ZonedDateTime", true),
- new UsesMethod<>("java.time.ZonedDateTime minus(..)", true)
+ new UsesMethod<>("java.time.ZonedDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofSeconds(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -7851,9 +8242,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.ZonedDateTime", true),
- new UsesMethod<>("java.time.ZonedDateTime minus(..)", true)
+ new UsesMethod<>("java.time.ZonedDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofMinutes(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -7923,9 +8320,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.ZonedDateTime", true),
- new UsesMethod<>("java.time.ZonedDateTime minus(..)", true)
+ new UsesMethod<>("java.time.ZonedDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Duration", true),
+ new UsesMethod<>("java.time.Duration ofHours(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -7995,9 +8398,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.ZonedDateTime", true),
- new UsesMethod<>("java.time.ZonedDateTime minus(..)", true)
+ new UsesMethod<>("java.time.ZonedDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofDays(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -8067,9 +8476,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.ZonedDateTime", true),
- new UsesMethod<>("java.time.ZonedDateTime minus(..)", true)
+ new UsesMethod<>("java.time.ZonedDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofWeeks(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -8139,9 +8554,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.ZonedDateTime", true),
- new UsesMethod<>("java.time.ZonedDateTime minus(..)", true)
+ new UsesMethod<>("java.time.ZonedDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofMonths(..)", true)
+ )
+ )
),
javaVisitor
);
@@ -8211,9 +8632,15 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("java.time.temporal.ChronoUnit", true),
new UsesType<>("java.time.ZonedDateTime", true),
- new UsesMethod<>("java.time.ZonedDateTime minus(..)", true)
+ new UsesMethod<>("java.time.ZonedDateTime minus(..)", true),
+ Preconditions.or(
+ new UsesType<>("java.time.temporal.ChronoUnit", true),
+ Preconditions.and(
+ new UsesType<>("java.time.Period", true),
+ new UsesMethod<>("java.time.Period ofYears(..)", true)
+ )
+ )
),
javaVisitor
);
diff -u -r WebClientRulesRecipes.java WebClientRulesRecipes.java
--- WebClientRulesRecipes.java 2024-12-22 11:47:38.418026660 +0100
+++ WebClientRulesRecipes.java 2024-12-22 11:47:45.209054378 +0100
@@ -118,9 +118,16 @@
};
return Preconditions.check(
- Preconditions.and(
- new UsesType<>("org.springframework.test.web.reactive.server.WebTestClient", true),
- new UsesMethod<>("org.springframework.test.web.reactive.server.WebTestClient method(..)", true)
+ Preconditions.or(
+ Preconditions.and(
+ new UsesType<>("org.springframework.test.web.reactive.server.WebTestClient", true),
+ new UsesMethod<>("org.springframework.test.web.reactive.server.WebTestClient method(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.springframework.web.reactive.function.client.WebClient", true),
+ new UsesType<>("org.springframework.web.reactive.function.client.WebClient.RequestHeadersSpec", true),
+ new UsesMethod<>("org.springframework.web.reactive.function.client.WebClient method(..)", true)
+ )
),
javaVisitor
);
@@ -193,9 +200,16 @@
};
return Preconditions.check(
- Preconditions.and(
- new UsesType<>("org.springframework.test.web.reactive.server.WebTestClient", true),
- new UsesMethod<>("org.springframework.test.web.reactive.server.WebTestClient method(..)", true)
+ Preconditions.or(
+ Preconditions.and(
+ new UsesType<>("org.springframework.test.web.reactive.server.WebTestClient", true),
+ new UsesMethod<>("org.springframework.test.web.reactive.server.WebTestClient method(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.springframework.web.reactive.function.client.WebClient", true),
+ new UsesType<>("org.springframework.web.reactive.function.client.WebClient.RequestHeadersSpec", true),
+ new UsesMethod<>("org.springframework.web.reactive.function.client.WebClient method(..)", true)
+ )
),
javaVisitor
);
@@ -268,9 +282,16 @@
};
return Preconditions.check(
- Preconditions.and(
- new UsesType<>("org.springframework.test.web.reactive.server.WebTestClient", true),
- new UsesMethod<>("org.springframework.test.web.reactive.server.WebTestClient method(..)", true)
+ Preconditions.or(
+ Preconditions.and(
+ new UsesType<>("org.springframework.test.web.reactive.server.WebTestClient", true),
+ new UsesMethod<>("org.springframework.test.web.reactive.server.WebTestClient method(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.springframework.web.reactive.function.client.WebClient", true),
+ new UsesType<>("org.springframework.web.reactive.function.client.WebClient.RequestHeadersSpec", true),
+ new UsesMethod<>("org.springframework.web.reactive.function.client.WebClient method(..)", true)
+ )
),
javaVisitor
);
@@ -343,9 +364,16 @@
};
return Preconditions.check(
- Preconditions.and(
- new UsesType<>("org.springframework.test.web.reactive.server.WebTestClient", true),
- new UsesMethod<>("org.springframework.test.web.reactive.server.WebTestClient method(..)", true)
+ Preconditions.or(
+ Preconditions.and(
+ new UsesType<>("org.springframework.test.web.reactive.server.WebTestClient", true),
+ new UsesMethod<>("org.springframework.test.web.reactive.server.WebTestClient method(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.springframework.web.reactive.function.client.WebClient", true),
+ new UsesType<>("org.springframework.web.reactive.function.client.WebClient.RequestBodyUriSpec", true),
+ new UsesMethod<>("org.springframework.web.reactive.function.client.WebClient method(..)", true)
+ )
),
javaVisitor
);
@@ -418,9 +446,16 @@
};
return Preconditions.check(
- Preconditions.and(
- new UsesType<>("org.springframework.test.web.reactive.server.WebTestClient", true),
- new UsesMethod<>("org.springframework.test.web.reactive.server.WebTestClient method(..)", true)
+ Preconditions.or(
+ Preconditions.and(
+ new UsesType<>("org.springframework.test.web.reactive.server.WebTestClient", true),
+ new UsesMethod<>("org.springframework.test.web.reactive.server.WebTestClient method(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.springframework.web.reactive.function.client.WebClient", true),
+ new UsesType<>("org.springframework.web.reactive.function.client.WebClient.RequestBodyUriSpec", true),
+ new UsesMethod<>("org.springframework.web.reactive.function.client.WebClient method(..)", true)
+ )
),
javaVisitor
);
@@ -493,9 +528,16 @@
};
return Preconditions.check(
- Preconditions.and(
- new UsesType<>("org.springframework.test.web.reactive.server.WebTestClient", true),
- new UsesMethod<>("org.springframework.test.web.reactive.server.WebTestClient method(..)", true)
+ Preconditions.or(
+ Preconditions.and(
+ new UsesType<>("org.springframework.test.web.reactive.server.WebTestClient", true),
+ new UsesMethod<>("org.springframework.test.web.reactive.server.WebTestClient method(..)", true)
+ ),
+ Preconditions.and(
+ new UsesType<>("org.springframework.web.reactive.function.client.WebClient", true),
+ new UsesType<>("org.springframework.web.reactive.function.client.WebClient.RequestBodyUriSpec", true),
+ new UsesMethod<>("org.springframework.web.reactive.function.client.WebClient method(..)", true)
+ )
),
javaVisitor
);
Looks good to me; thanks for the thorough comparison diff above! Here's the type of change we were after: diff -u -r JUnitToAssertJRulesRecipes.java JUnitToAssertJRulesRecipes.java
--- JUnitToAssertJRulesRecipes.java 2024-12-22 11:47:38.165025627 +0100
+++ JUnitToAssertJRulesRecipes.java 2024-12-22 11:47:44.929053235 +0100
@@ -1197,8 +1197,11 @@
};
return Preconditions.check(
Preconditions.and(
- new UsesType<>("org.junit.jupiter.api.function.ThrowingSupplier", true),
- new UsesMethod<>("org.junit.jupiter.api.Assertions assertDoesNotThrow(..)", true)
+ new UsesMethod<>("org.junit.jupiter.api.Assertions assertDoesNotThrow(..)", true),
+ Preconditions.or(
+ new UsesType<>("org.junit.jupiter.api.function.Executable", true),
+ new UsesType<>("org.junit.jupiter.api.function.ThrowingSupplier", true)
+ )
),
javaVisitor
); For this set of templates: Lines 678 to 694 in acb8b65
Previously we would only match one of those templates, or none at all, whereas we can now correctly match both. |
This PR contains the following updates:
1.20.0
->1.20.1
1.20.0
->1.20.1
Release Notes
openrewrite/rewrite-templating (OpenRewrite Templating)
v1.20.1
Compare Source
What's Changed
Full Changelog: openrewrite/rewrite-templating@v1.20.0...v1.20.1