gnodet-bot commented on code in PR #387:
URL: https://github.com/apache/maven-filtering/pull/387#discussion_r4093652856


##########
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##########
@@ -165,7 +165,7 @@ public static Path resolveFile(final Path baseFile, String 
filename) {
      * PathTool.getRelativeFilePath( "/usr/local/", "/bin" )                   
     = "../../bin"
      * PathTool.getRelativeFilePath( "/bin", "/usr/local/" )                   
     = "../usr/local"

Review Comment:
   ⚠️ **Javadoc contradicts the newly-added test**
   
   The Javadoc documents:
   ```
   getRelativeFilePath( "/bin", "/usr/local/" ) = "../usr/local"
   ```
   (no trailing slash)
   
   But the test added in this PR asserts:
   ```java
   assertEquals("../usr/local/", FilteringUtils.getRelativeFilePath("/bin", 
"/usr/local/"));
   ```
   (trailing slash preserved)
   
   The test is correct — the implementation preserves the trailing slash from 
`newPath` (both in the old code via `File.separator` and in the new code via 
`"/"`).
   
   Update the Javadoc example to match actual behavior:
   
   ```suggestion
        * PathTool.getRelativeFilePath( "/bin", "/usr/local/" )                 
       = "../usr/local/"
   ```



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