openrewrite / rewrite-gradle-plugin

OpenRewrite's Gradle plugin.
Apache License 2.0
60 stars 37 forks source link

Add test for issue 261 #273

Closed koppor closed 1 month ago

koppor commented 7 months ago

This adds two small test for issue openrewrite/rewrite#4054.

This is just an outline.

It resembles the MWE at https://github.com/koppor/mwe-openrewrite-rewrite-gradle-plugin-issue-261/.

However, here, all .java types can be determined. (Independent of a rewrite.yml is used or not)

The test fail, because type information in build.gradle is missing.

This PR is only made to enable discussions of debuggin the issue.

koppor commented 7 months ago

MWE (still) only with Java 11, because I wanted to keep things going (and not working on backwards compatbility)

When module-info.java is present, types cannot be determined. Shown by the test case.

Example file:

            module demo {
                requires org.slf4j;
            }
koppor commented 7 months ago

I checked the required JDK (https://github.com/openrewrite/rewrite-gradle-plugin/blob/0029c7afd15730c1679e2006784feec118c7e373/plugin/build.gradle.kts#L72). Since the plugin is build with Java 17, the check is IMHO finished. I put this PR as "ready". -- OK, to solve the issue with module-info.java is still open (and much more work), this is far beyond my skills.

koppor commented 6 months ago

Current state: Issue at JavaParser. See https://github.com/openrewrite/rewrite/issues/4054#issuecomment-1966527187.

timtebeek commented 1 month ago

Let's continue to track proper support in

There's also a workaround proposed in