You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2019/07/22 04:22:02 UTC
[jira] [Closed] (GROOVY-9123) "java.nio.file.Path.setText" does not
work with CompileStatic on Groovy 2.5.7
[ https://issues.apache.org/jira/browse/GROOVY-9123?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-9123.
-----------------------------
> "java.nio.file.Path.setText" does not work with CompileStatic on Groovy 2.5.7
> -----------------------------------------------------------------------------
>
> Key: GROOVY-9123
> URL: https://issues.apache.org/jira/browse/GROOVY-9123
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 2.5.7
> Environment: Linux. Java 11.
> Reporter: Jan Hackel
> Assignee: Daniel Sun
> Priority: Major
> Fix For: 2.5.8, 3.0.0-beta-2
>
> Attachments: gradle-nio-path-gettext.zip
>
>
> Code like the following will not work correctly on Groovy 2.5.7 with {{@CompileStatic}} enabled (groovy-nio required):
> {{Files.createTempFile('will not', 'compile').text = 'Some Text'}}
> On Groovy 2.5.7 it compiles as
> {{String var1 = "Some Text";}}
> {{NioGroovyMethods.getText(Files.createTempFile("will not", "compile"));}}
> whereas Groovy 2.5.6 it compiled as
> {{String var1 = "Some Text";}}
> {{ScriptBytecodeAdapter.setProperty(var1, (Class)null, Files.createTempFile("will not", "compile"), (String)"text");}}
> The latter is working, the former is not.
> Calling {{Path.setText}} should call the setter and not the getter for property {{text}} when compiling statically!
> Attached is a sample project demonstrating the issue.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)