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-9147) Using 'File.text = ' cause FileNotFoundException in Groovy 2.5.7 with @CompileStatic

     [ https://issues.apache.org/jira/browse/GROOVY-9147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King closed GROOVY-9147.
-----------------------------

> Using 'File.text = ' cause FileNotFoundException in Groovy 2.5.7 with @CompileStatic
> ------------------------------------------------------------------------------------
>
>                 Key: GROOVY-9147
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9147
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-jdk, Static compilation
>    Affects Versions: 2.5.7
>         Environment: Linux, Java 11, Gradle 5.4
>            Reporter: A. Lepe
>            Assignee: Daniel Sun
>            Priority: Minor
>              Labels: easyfix
>             Fix For: 2.5.8, 3.0.0-beta-2
>
>
> The following code, throws FileNotFoundException:
> {code:java}
> @CompileStatic
> class Sample {
>     static void main(String[] args) {
>         new File("/tmp/sample.txt").text = "something"
>     }
> }
> {code}
> The cause is reported to be related to InputStream, however, in this case, it should be OutputStream. 
> The following throws no error:
> {code:java}
> new File("/tmp/sample.txt").setText("something"){code}
> If I use Groovy 2.5.6 or bellow (or without @CompileStatic), it works as expected. 
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)