You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/07/25 15:49:30 UTC

[GitHub] [commons-io] rbri opened a new pull request #251: [IO-744] testcase and possible fix for https://issues.apache.org/jira/browse/IO-744

rbri opened a new pull request #251:
URL: https://github.com/apache/commons-io/pull/251


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-io] rbri commented on a change in pull request #251: [IO-744] FileWriterWithEncoding for an existing file no longer truncates the file.

Posted by GitBox <gi...@apache.org>.
rbri commented on a change in pull request #251:
URL: https://github.com/apache/commons-io/pull/251#discussion_r676328916



##########
File path: src/main/java/org/apache/commons/io/output/FileWriterWithEncoding.java
##########
@@ -227,7 +227,12 @@ private static Writer initWriter(final File file, final Object encoding, final b
         OutputStream stream = null;
         final boolean fileExistedAlready = file.exists();
         try {
-            stream = Files.newOutputStream(file.toPath(),  append ? StandardOpenOption.APPEND : StandardOpenOption.CREATE);
+            if (append) {

Review comment:
       @garydgregory Thanks for the warm welcome as someone trying to help.
   Have done another PR that shows, that your optimized version of the fix now breaks the ctor with the append option set to true.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-io] garydgregory commented on pull request #251: [IO-744] FileWriterWithEncoding for an existing file no longer truncates the file.

Posted by GitBox <gi...@apache.org>.
garydgregory commented on pull request #251:
URL: https://github.com/apache/commons-io/pull/251#issuecomment-886241849


   @rbri 
   Thank you for your PR. See comments.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-io] garydgregory commented on a change in pull request #251: [IO-744] FileWriterWithEncoding for an existing file no longer truncates the file.

Posted by GitBox <gi...@apache.org>.
garydgregory commented on a change in pull request #251:
URL: https://github.com/apache/commons-io/pull/251#discussion_r676186513



##########
File path: src/main/java/org/apache/commons/io/output/FileWriterWithEncoding.java
##########
@@ -227,7 +227,12 @@ private static Writer initWriter(final File file, final Object encoding, final b
         OutputStream stream = null;
         final boolean fileExistedAlready = file.exists();
         try {
-            stream = Files.newOutputStream(file.toPath(),  append ? StandardOpenOption.APPEND : StandardOpenOption.CREATE);
+            if (append) {

Review comment:
       Not sure why the fix has to be exploded into so much code when all you need is an additional argument to the JRE API. Please see git master for a much simpler fix.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-io] garydgregory closed pull request #251: [IO-744] FileWriterWithEncoding for an existing file no longer truncates the file.

Posted by GitBox <gi...@apache.org>.
garydgregory closed pull request #251:
URL: https://github.com/apache/commons-io/pull/251


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-io] garydgregory commented on a change in pull request #251: [IO-744] FileWriterWithEncoding for an existing file no longer truncates the file.

Posted by GitBox <gi...@apache.org>.
garydgregory commented on a change in pull request #251:
URL: https://github.com/apache/commons-io/pull/251#discussion_r676186568



##########
File path: src/test/java/org/apache/commons/io/output/FileWriterWithEncodingTest.java
##########
@@ -197,6 +198,25 @@ public void constructor_File_nullFile() {
         assertFalse(file1.exists());
     }
 
+    @Test

Review comment:
       This test is now in git master, TY. You are credited in `changes.xml`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-io] coveralls commented on pull request #251: [IO-744] testcase and possible fix for https://issues.apache.org/jira/browse/IO-744

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #251:
URL: https://github.com/apache/commons-io/pull/251#issuecomment-886223344


   
   [![Coverage Status](https://coveralls.io/builds/41628568/badge)](https://coveralls.io/builds/41628568)
   
   Coverage decreased (-0.01%) to 89.097% when pulling **c41c4b6c6798dbaf778b943d8cee9afd8a928409 on rbri:issue_IO-744** into **96e3df8a44d2c6baa0de90560cfef5aafba6b176 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org