You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2019/10/28 09:16:17 UTC

[GitHub] [maven-wagon] ok2c commented on a change in pull request #58: [WAGON-569] Inconsistent encoding behavior for repository URLs with s…

ok2c commented on a change in pull request #58: [WAGON-569] Inconsistent encoding behavior for repository URLs with s…
URL: https://github.com/apache/maven-wagon/pull/58#discussion_r339460251
 
 

 ##########
 File path: wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/EncodingUtil.java
 ##########
 @@ -77,29 +83,28 @@ public static String encodeURLToString( String url )
     /**
      * Parses and returns an encoded version of the given URL string alongside the given paths.
      *
-     * @param baseUrl Base URL to use when constructing the final URL, ie: scheme://authority/initial.path.
-     * @param paths   Additional path(s) to append at the end of the base path.
+     * @param baseUrl Base URL to use when constructing the final URL. This has to be a valid URL already.
+     * @param paths   Additional unencoded path(s) to append at the end of the base path.
      * @return Composed URL (base + paths) already encoded, separating the individual path components by "/".
      * @since TODO
      */
     public static String encodeURLToString( String baseUrl, String... paths )
     {
         StringBuilder url = new StringBuilder( baseUrl );
 
-        String[] parts = paths == null ? //
+        String[] segments = paths == null ? //
             new String[0] : //
             paths.length == 1 ? paths[0].split( "/" ) : paths;
 
 Review comment:
   @michael-o This part looks a bit dodgy to me. I would rather use two distinct methods here `encodeURLToString( String baseUrl, String... pathSegments )` and `encodeURLToString( String baseUrl, String path )` with the latter splitting the path into segments and then calling the former. Otherwise looks OK to me.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services