garydgregory commented on a change in pull request #221:
URL: https://github.com/apache/commons-io/pull/221#discussion_r633126756



##########
File path: src/test/java/org/apache/commons/io/IOUtilsTestCase.java
##########
@@ -118,7 +116,7 @@ public void setUp() {
             if (!testFile.getParentFile().exists()) {
                 throw new IOException("Cannot create file " + testFile + " as 
the parent directory does not exist");
             }
-            final BufferedOutputStream output = new BufferedOutputStream(new 
FileOutputStream(testFile));
+            final BufferedOutputStream output = new 
BufferedOutputStream(Files.newOutputStream(testFile.toPath()));

Review comment:
       In these test methods, you keep calling `toPath()` over and over, why 
not just call it once?

##########
File path: src/test/java/org/apache/commons/io/IOUtilsTestCase.java
##########
@@ -118,7 +116,7 @@ public void setUp() {
             if (!testFile.getParentFile().exists()) {
                 throw new IOException("Cannot create file " + testFile + " as 
the parent directory does not exist");
             }
-            final BufferedOutputStream output = new BufferedOutputStream(new 
FileOutputStream(testFile));
+            final BufferedOutputStream output = new 
BufferedOutputStream(Files.newOutputStream(testFile.toPath()));

Review comment:
       In these test methods, you keep calling `toPath()` over and over, why 
not just call it once? IOW should `testFile` be `testPath` or have both?




-- 
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.

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


Reply via email to