`PreferJavaUtilFunction` should not convert when used specifically as Guava type
Opened this issue · 1 comments
timo-abele commented
How are you running OpenRewrite?
I am using the Maven plugin, and my project is a single module project.
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>5.23.1</version>
<configuration>
<activeRecipes>
<recipe>org.openrewrite.java.migrate.guava.NoGuavaJava11</recipe>
</activeRecipes>
<failOnDryRunResults>true</failOnDryRunResults>
</configuration>
<dependencies>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-migrate-java</artifactId>
<version>2.10.0</version>
</dependency>
</dependencies>
</plugin>
What is the Problem?
Example: in Collections2.transform(someList, com.google.common.base.Function)
only the function is converted to a jdk equivalent. This breaks the build because transform
only accepts a guava Function
.
Are you interested in contributing a fix to OpenRewrite?
No, sorry
timtebeek commented
Thanks for calling that out! We could indeed look to see if there's any surrounding method invocation that requires a Guava type, or even look how the type is used through https://github.com/openrewrite/rewrite-analysis/ to limit when we make changes.