You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Keegan Witt (JIRA)" <ji...@apache.org> on 2015/08/20 03:24:47 UTC
[jira] [Resolved] (GROOVY-7553) Path.write() appends when encoding
parameter present
[ https://issues.apache.org/jira/browse/GROOVY-7553?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Keegan Witt resolved GROOVY-7553.
---------------------------------
Resolution: Fixed
> Path.write() appends when encoding parameter present
> ----------------------------------------------------
>
> Key: GROOVY-7553
> URL: https://issues.apache.org/jira/browse/GROOVY-7553
> Project: Groovy
> Issue Type: Bug
> Reporter: Keegan Witt
> Assignee: Keegan Witt
> Fix For: 2.4.5
>
>
> {{Path.write()}} is expected to overwrite and not append, which it does, except in when the encoding parameter is passed, as demonstrated here
> {code:java}
> def p = java.nio.file.Paths.get("foo.txt")
> p.write("1")
> p.write("2")
> assert p.text == "2" // passes
> java.nio.file.Files.delete(p)
> p.write("1", "UTF-8")
> p.write("2", "UTF-8")
> assert p.text == "2" // fails, is '12'
> java.nio.file.Files.delete(p)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)