[ 
https://issues.apache.org/jira/browse/GROOVY-10405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17501004#comment-17501004
 ] 

Scott commented on GROOVY-10405:
--------------------------------

Unfortunately, work arounds aren't an option when this is being done inside a 
third party library.

I also don't see an easy path to upgrading to groovy 4 because of the package 
renaming.  The package renaming from org.codehaus is definitely a blocker from 
using any third party library with groovy 4 that has not been updated to 
support groovy 4.  I would suspect it could take at least a year before all 
third party libraries are updated to groovy 4.

So it would seem critical to getting this working with groovy 3 because there 
is no clear easy transition to groovy 4 and users need a way to run existing 
code on the current JVM which is Java 17. 

Can we expect some sort of support for this in the next Groovy 3.x release or 
has it been determined that Groovy 3.x will not support Java 17?

> @AutoClone breaks in Java17 for File properties
> -----------------------------------------------
>
>                 Key: GROOVY-10405
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10405
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 3.0.9
>         Environment: Java11 vs Java17
> Windows10, Ubuntu
>            Reporter: Aleks Tamarkin
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 4.0.0-rc-1
>
>
> The following code works on Java11 but breaks on Java17
>  
> {code:java}
> import groovy.transform.AutoClone
> @AutoClone
> class Foo {
>     File file
>     String string
> }
> def foo = new Foo(file: new File('bar'), string: 'qux')
> foo.clone()
> {code}
> The error is
> {code:java}
> groovy.lang.MissingMethodException: No signature of method: 
> java.lang.Object.clone() is applicable for argument types: () values: []
> Possible solutions: collect(), collect(groovy.lang.Closure), 
> collect(java.util.Collection, groovy.lang.Closure), find(), any(), 
> use([Ljava.lang.Object;){code}
> This can be reproduced in GroovyConsole



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to