Keegan Witt created GROOVY-7553: ----------------------------------- Summary: 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)