Skip to content

PreferJavaUtilFunction should not convert when used specifically as Guava type #436

@timo-abele

Description

@timo-abele

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingguava

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions