[jira] [Commented] (GROOVY-10405) @AutoClone breaks in Java17 for File properties

2022-04-13 Thread Scott (Jira)


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

Scott commented on GROOVY-10405:


[~emilles] approximately when can we expect a 3.0.11 release? 

> @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, 3.0.11
>
>
> 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)


[jira] [Commented] (GROOVY-10405) @AutoClone breaks in Java17 for File properties

2022-03-03 Thread Eric Milles (Jira)


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

Eric Milles commented on GROOVY-10405:
--

https://github.com/apache/groovy/commit/94e06762f889c6f191e29ff228b640c81a571e1b

> @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)


[jira] [Commented] (GROOVY-10405) @AutoClone breaks in Java17 for File properties

2022-03-03 Thread Scott (Jira)


[ 
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)


[jira] [Commented] (GROOVY-10405) @AutoClone breaks in Java17 for File properties

2022-03-03 Thread Eric Milles (Jira)


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

Eric Milles commented on GROOVY-10405:
--

You can recreate outside of {{AutoClone}} like this:
{code:groovy}
class X implements Cloneable {
  @Override clone() {
def obj = super.clone()
obj
  }
}
new X().clone()
{code}

> @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)


[jira] [Commented] (GROOVY-10405) @AutoClone breaks in Java17 for File properties

2022-03-03 Thread Eric Milles (Jira)


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

Eric Milles commented on GROOVY-10405:
--

The issue lies in {{AutoClone}}'s "super.clone()" call to start out the cloning 
process.  Under Java 17, the meta method index does not get {{methodForSuper}} 
populated for clone.  Using {{@CompileStatic}} will create a direct method call 
in the bytecode instead of routing through 
{{ScriptBytecodeAdapter#invokeMethodOnSuper0}}.

> @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
>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)


[jira] [Commented] (GROOVY-10405) @AutoClone breaks in Java17 for File properties

2022-02-09 Thread Scott (Jira)


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

Scott commented on GROOVY-10405:


Is it feasible to get this fix merged into the 3.x branch?

Will Java 17 be supported with Groovy 3.x? Because having to inject a bunch of 
workarounds only to later remove them after migrating to Groovy 4.x doesn't 
seem like a viable solution.

https://github.com/grails/gorm-hibernate5/issues/402

 

 

> @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
>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)


[jira] [Commented] (GROOVY-10405) @AutoClone breaks in Java17 for File properties

2022-02-04 Thread Arthur Sengileyev (Jira)


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

Arthur Sengileyev commented on GROOVY-10405:


It is not a problem to fix this in our own codebase. If we reference the 
library, which used this AST transformation w/o CompileStatic annotation, then 
we are doomed. And as it could manifest in any of the referenced libraries this 
is pretty troublesome if not fixed in language runtime. But I will report 
potential fix to identified problematic dependencies.

Thank you.

> @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
>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)


[jira] [Commented] (GROOVY-10405) @AutoClone breaks in Java17 for File properties

2022-02-04 Thread Paul King (Jira)


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

Paul King commented on GROOVY-10405:


Adding {{@CompileStatic}} is the other workaround for your example - may not 
work in all cases.

> @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
>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)


[jira] [Commented] (GROOVY-10405) @AutoClone breaks in Java17 for File properties

2022-02-04 Thread Arthur Sengileyev (Jira)


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

Arthur Sengileyev commented on GROOVY-10405:


Would be nice to have this backported to 3.0.10 or 3.0.11, because it 
effectively blocks the migration of numerous workloads to JDK17.

> @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
>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)


[jira] [Commented] (GROOVY-10405) @AutoClone breaks in Java17 for File properties

2021-12-07 Thread Paul King (Jira)


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

Paul King commented on GROOVY-10405:


FYI, this is fixed on 4.0.0-rc-1.

> @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
>Priority: Major
>
> 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)