Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Duplicate
-
2.5.7
-
Linux, Java 11, Gradle 5.4
Description
The following code, throws FileNotFoundException:
@CompileStatic class Sample { static void main(String[] args) { new File("/tmp/sample.txt").text = "something" } }
The cause is reported to be related to InputStream, however, in this case, it should be OutputStream.
The following throws no error:
new File("/tmp/sample.txt").setText("something")
If I use Groovy 2.5.6 or bellow (or without @CompileStatic), it works as expected.
Attachments
Issue Links
- duplicates
-
GROOVY-9123 "java.nio.file.Path.setText" does not work with CompileStatic on Groovy 2.5.7
- Closed