You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Scott (Jira)" <ji...@apache.org> on 2022/02/15 02:20:00 UTC

[jira] [Commented] (GROOVY-10481) Groovy 3.x - @AutoClone breaks in Java17 for File properties

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

Scott commented on GROOVY-10481:
--------------------------------

Need fix in 3.x

> Groovy 3.x - @AutoClone breaks in Java17 for File properties
> ------------------------------------------------------------
>
>                 Key: GROOVY-10481
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10481
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 3.0.9
>         Environment: Java11 vs Java17
> Windows10, Ubuntu
>            Reporter: Scott
>            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)