garydgregory commented on code in PR #825:
URL: https://github.com/apache/commons-io/pull/825#discussion_r2727453606


##########
src/test/java/org/apache/commons/io/FilenameUtilsTest.java:
##########
@@ -70,31 +70,31 @@ public void setUp() throws Exception {
                     + " as the parent directory does not exist");
         }
         try (BufferedOutputStream output3 =
-                new BufferedOutputStream(Files.newOutputStream(testFile1))) {
+                     new 
BufferedOutputStream(Files.newOutputStream(testFile1))) {

Review Comment:
   Don't make spurious edits, it makes the PR larger and takes longer to review.
   



##########
src/main/java/org/apache/commons/io/FilenameUtils.java:
##########
@@ -16,6 +16,7 @@
  */
 package org.apache.commons.io;
 
+import java.io.Console;

Review Comment:
   Remove this import.



##########
src/test/java/org/apache/commons/io/FilenameUtilsTest.java:
##########
@@ -408,12 +407,12 @@ void testGetPath() {
         assertNull(FilenameUtils.getPath("1:"));
         assertNull(FilenameUtils.getPath("1:a"));
         assertNull(FilenameUtils.getPath("///a/b/c.txt"));
-        assertNull(FilenameUtils.getPath("//a"));

Review Comment:
   See above comment.



##########
src/test/java/org/apache/commons/io/FilenameUtilsTest.java:
##########
@@ -915,13 +916,14 @@ void testNormalize() {
         assertNull(FilenameUtils.normalize("//server/../a"));
         assertNull(FilenameUtils.normalize("//server/.."));
         assertEquals(SEP + SEP + "server" + SEP + "", 
FilenameUtils.normalize("//server/"));
+        assertEquals( SEP +  SEP + "server", 
FilenameUtils.normalize("//server"));
 
         assertEquals(SEP + SEP + "127.0.0.1" + SEP + "a" + SEP + "b" + SEP + 
"c.txt", FilenameUtils.normalize("\\\\127.0.0.1\\a\\b\\c.txt"));
         assertEquals(SEP + SEP + "::1" + SEP + "a" + SEP + "b" + SEP + 
"c.txt", FilenameUtils.normalize("\\\\::1\\a\\b\\c.txt"));
         assertEquals(SEP + SEP + "1::" + SEP + "a" + SEP + "b" + SEP + 
"c.txt", FilenameUtils.normalize("\\\\1::\\a\\b\\c.txt"));
         assertEquals(SEP + SEP + "server.example.org" + SEP + "a" + SEP + "b" 
+ SEP + "c.txt", 
FilenameUtils.normalize("\\\\server.example.org\\a\\b\\c.txt"));
         assertEquals(SEP + SEP + "server.sub.example.org" + SEP + "a" + SEP + 
"b" + SEP + "c.txt",
-            
FilenameUtils.normalize("\\\\server.sub.example.org\\a\\b\\c.txt"));
+                
FilenameUtils.normalize("\\\\server.sub.example.org\\a\\b\\c.txt"));

Review Comment:
   Don't make spurious edits, it makes the PR larger and takes longer to review.



##########
src/test/java/org/apache/commons/io/FilenameUtilsTest.java:
##########
@@ -1208,4 +1211,4 @@ void testSeparatorsToWindows() {
         assertEquals("\\a\\b\\c", FilenameUtils.separatorsToWindows("/a/b/c"));
         assertEquals("D:\\a\\b\\c", 
FilenameUtils.separatorsToWindows("D:/a/b/c"));
     }
-}
+}

Review Comment:
   Files end in an empty line.



##########
src/test/java/org/apache/commons/io/FilenameUtilsTest.java:
##########
@@ -275,7 +274,6 @@ void testGetFullPath() {
         assertNull(FilenameUtils.getFullPath("1:"));
         assertNull(FilenameUtils.getFullPath("1:a"));
         assertNull(FilenameUtils.getFullPath("///a/b/c.txt"));
-        assertNull(FilenameUtils.getFullPath("//a"));

Review Comment:
   Don't delete assertions, instead change it to show the new behavior here.



##########
src/main/java/org/apache/commons/io/FilenameUtils.java:
##########
@@ -930,15 +931,27 @@ public static int getPrefixLength(final String fileName) {
         if (!isSeparator(ch0) || !isSeparator(ch1)) {
             return isSeparator(ch0) ? 1 : 0;
         }
+

Review Comment:
   Remove extra blank line.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to