Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Groovy 3.0.x #121

Open
bjornvester opened this issue Feb 18, 2020 · 2 comments
Open

Support Groovy 3.0.x #121

bjornvester opened this issue Feb 18, 2020 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@bjornvester
Copy link

Add support for instrumenting Groovy 3.0.x code.

This could potentially be split into two issues:

  • Support "old" Groovy 2.5 source code but compiled with Groovy 3.0.
  • Support the new language features of Groovy 3.0.

As an example of the first part, OpenClover fails on my Groovy 2.5 source code under Groovy 3.0 with:

[...]
11:24:01  Caused by: java.lang.UnsupportedOperationException: EmptyExpression.INSTANCE is immutable
11:24:01  	at com.atlassian.clover.instr.groovy.InstrumentingCodeVisitor.transform(InstrumentingCodeVisitor.java:358)
11:24:01  	at com.atlassian.clover.instr.groovy.InstrumentingCodeVisitor.transform(InstrumentingCodeVisitor.java:309)
11:24:01  	at com.atlassian.clover.instr.groovy.InstrumentingCodeVisitor.visitExpressionStatement(InstrumentingCodeVisitor.java:633)
11:24:01  	at com.atlassian.clover.instr.groovy.InstrumentingCodeVisitor.visitBlockStatement(InstrumentingCodeVisitor.java:675)
11:24:01  	at com.atlassian.clover.instr.groovy.InstrumentingCodeVisitor.visitConstructorOrMethod(InstrumentingCodeVisitor.java:250)
11:24:01  	at com.atlassian.clover.instr.groovy.InstrumentingCodeVisitor.visitClass(InstrumentingCodeVisitor.java:210)
11:24:01  	at com.atlassian.clover.instr.groovy.InstrumentingCodeVisitor.instrument(InstrumentingCodeVisitor.java:194)
11:24:01  	at com.atlassian.clover.instr.groovy.Grover.addRecorderIncCalls(Grover.java:365)
11:24:01  	at com.atlassian.clover.instr.groovy.Grover.visit(Grover.java:320)
11:24:01  	... 24 more
@andersaaberg
Copy link

The lack of Groovy 3 support is getting a real pain for the Groovy community as Groovy 3 is supported in Micronaut 2 and will also be supported in the upcoming Grails 5 release. If financial support is needed in order to fix this issue, then I suggest to apply here: https://opencollective.com/friends-of-groovy

@hydra
Copy link

hydra commented Mar 28, 2024

Today I finally found the code causing the 'EmptyExpression.INSTANCE is immutable' issue that we have been experiencing. I made a PR to my own repo, documented my findings and add with several commits which show the changes I had to make.

See here:

hydra/pnpconvert#19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants