Open mccartney opened 1 month ago
I think this one needs to be verified with Gradle natively also before trying to fix the parser. I'd almost expect for Gradle to fail as well which is what I'd want to see verified.
@shanman190 Thanks for looking into this.
I've set up a dedicated Gradle project for reproducing the issue with simple gradlew init
: https://github.com/mccartney/rewrite-repro-4614-gradle/commit/f5b959e3b386b12ce84df29d5a5456ab5ee31b56
The Gradle build passes with and without this commit.
Also - the example has been extracted from real-life Gradle configuration file.
Also checked Groovy program in tio.run:
class Example {
static void main(String[] args) {
println('Hello World',);
}
}
and it worked fine.
@Test
void trailingCommaInMethodCall() {
rewriteRun(
groovy(
"""
System.out.println("Anwil Wloclawek", )
"""
)
);
}
fails in rewrite-groovy
the same way as original report.
What is the smallest, simplest way to reproduce the problem?
What is the full stack trace of any errors you encountered?
Context