japplis commented on code in PR #543:
URL: https://github.com/apache/commons-vfs/pull/543#discussion_r1618780983


##########
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/UriParser.java:
##########
@@ -117,7 +118,10 @@ private boolean readSeparator() {
             }
             final String sub = path.substring(cursor, cursor + 3);
             if (sub.equals(URLENCODED_SLASH_LC) || 
sub.equals(URLENCODED_SLASH_UC)) {
-                cursor += 3;
+                path.setCharAt(cursor, SEPARATOR_CHAR);
+                path.delete(cursor + 1, cursor + 3);

Review Comment:
   This pattern of `path.setCharAt` and `path.delete(cursor + 1, cursor + 3);` 
is already used in `canonicalizePath()` and `decode()` methods.
   There is in commons-vfs a checkstyle or pmd rule for magic numbers and it 
starts with number 4 and above.



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