Closed k3code06 closed 5 months ago
So this appears like you are trying to mix old and new rewrite
and rewrite-gradle-plugin
. rewrite:8.x
and rewrite-gradle-plugin:6.x
make use of java.util.Stream
for being able to process the data set while your variable declaration is wanting a List
which is only valid for rewrite:7.x
and rewrite-gradle-plugin:5.x
.
I am using the latest version of rewrite
and rewrite-gradle-plugin
. The latest version of rewrite uses Stream
I think you might have misunderstood my statement, so I'll word it a different way.
rewrite | rewrite-gradle-plugin | Implementation |
---|---|---|
7.x | 5.x | java.util.List |
8.x | 6.x | java.util.Stream |
The rewrite-gradle-plugin
repository in it's current state depends upon rewrite
8.x and uses java.util.Stream
throughout the project. More specifically, nowhere in the 6.x releases does the result of jp.parse(..)
be assigned to a java.util.List
. You can see the current implementation here which as well shows the only invocation of jp.parse(..)
within the current DefaultProjectParser
. If you notice, the call is within a flatMap(..)
which furthermore requires the return type to be java.util.Stream
.
https://github.com/openrewrite/rewrite-gradle-plugin/blob/b0cf73432d948d10bfe29007ae613bdb466da622/plugin/src/main/java/org/openrewrite/gradle/isolated/DefaultProjectParser.java#L727
@AnkitaJain06, this appears to be a dependency version bug within your extension and more of a question here in the correct usage of this plugin alongside the rewrite repository. As it seems like I've answered your question now, I'm going to go ahead and close out this ticket now. If there's anything else feel free to open a new issue or reach out in the OpenRewrite Slack workspace questions
channel.
What version of OpenRewrite are you using?
I am using
How are you running OpenRewrite?
I am overriding the RewritePlugin to extend some of its functionality.
What did you see instead?
In DefaultProjectParser.java (org/openrewrite/gradle/isolated/DefaultProjectParser.java)
The implementation of parse function inside the (org/openrewrite/Parser.class)-
What is the full stack trace of any errors you encountered?