[ https://issues.apache.org/jira/browse/GROOVY-7553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14703168#comment-14703168 ]
ASF GitHub Bot commented on GROOVY-7553: ---------------------------------------- GitHub user keeganwitt opened a pull request: https://github.com/apache/incubator-groovy/pull/89 GROOVY-7553: Path.write() appends when encoding parameter present You can merge this pull request into a Git repository by running: $ git pull https://github.com/keeganwitt/incubator-groovy GROOVY-7553 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-groovy/pull/89.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #89 ---- commit 559dc32396b6f2b01b04d0924ca45928ad436309 Author: Keegan Witt <keeganw...@gmail.com> Date: 2015-08-19T15:17:31Z GROOVY-7553: Path.write() appends when encoding parameter present ---- > 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 > > {{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)