Open Jnb1234 opened 9 months ago
Thanks for the clear example @Jnb1234 ! It seems to fail on this particular line https://github.com/openrewrite/rewrite/blob/06a1bc81d0c56a710f52133861b985ca196e1b13/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParserVisitor.java#L232
Is there any reason why the types might be absent in your case above? Are those imports on the classpath?
They are on the classpath. If you comment one of the imports the parsing issue goes away.
Edited... You may be correct about the classpath. Let me try again in the demo project... I changed the import as it was an internal import.... I will update as with a better example. Though I am not sure how it would compile if not on the classpath.
The following compiles with no parsing issues so it is on the classpath I think.
package openrewrite.issues import static org.mockito.Mockito. //import static org.mockito.Mockito. class DuplicateImport {
}
Also note the following works. package openrewrite.issues import static org.mockito.Mockito.any import static org.mockito.Mockito.any class DuplicateImport {
}
What version of OpenRewrite are you using?
I am using
How are you running OpenRewrite?
I am using the Gradle plugin, and my project is a single module project.
What is the smallest, simplest way to reproduce the problem?
What did you expect to see?
No parsing error
What did you see instead?
parsing error
What is the full stack trace of any errors you encountered?
Are you interested in contributing a fix to OpenRewrite?