-
Notifications
You must be signed in to change notification settings - Fork 109
Description
Before my issues regarding com.google.common.base.Predicate, the rule seemed fairly consistent: com.google.common.base.Predicate was migrated to java.util.function.Predicate, but many methods using com.google.common.base.Predicate as a parameter were not migrated; which caused numerous compilation errors.
-
With my recent tickets (including my own PRs and those from @timtebeek — PR Fix
NoGuavaSetsNewHashSetto skipIterable-only arguments #882, PR Convert GuavaPredicates.andand.or#885, PR Convert GuavaPredicates.equalToand.not#887, PR Convert GuavaIterables.anyand.filter#896, PR Convert GuavaSets.filter#898 and PR Support varargs for Predicates.and() and Predicates.or() #901), several of these methods have now been migrated. -
However, with PR Only convert Guava Predicate when not used as method argument #902, we’ve partially reverted the migration of
com.google.common.base.Predicate, keeping it only for certain cases. -
As a result, new compilation errors have appeared, and PR Only convert Guava Predicate when not used as method argument #902 now contradicts several of the PRs mentioned above.
So, I’m not sure whether the current state is actually "more stable" or "more consistent". -
In addition, PR Only convert Guava Predicate when not used as method argument #902 only affects the type migration, but the rule for renaming the method
apply → testhas remained unchanged; whereas it should follow the same logic as the type.
This block inno-guava.ymlshould probably be extracted and moved into its own recipe, or inNoGuavaPredicaterecipe:
- org.openrewrite.java.ChangeMethodName:
methodPattern: com.google.common.base.Predicate apply(..)
newMethodName: test
matchOverrides: trueI’ve been on sick leave for a few weeks now, including this week, and I’ve used the time to explore OpenRewrite by testing the NoGuava recipe on the Sirius Desktop codebase.
I’ll try to dig a bit deeper into this over the next few days, but my availability will decrease soon.
I’d like at least to clarify the current status around Predicate, though given its wide variety of use cases, that might be a challenging goal.
I’ll keep listing here the different cases I encounter.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status