You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by GitBox <gi...@apache.org> on 2020/04/20 07:45:41 UTC

[GitHub] [httpcomponents-core] netsrotr opened a new pull request #196: HTTPCORE-627: URIBuilder::Adding query parameters result in removing …

netsrotr opened a new pull request #196:
URL: https://github.com/apache/httpcomponents-core/pull/196


   …the scheme specific part of an URI
   
   Changed: URIBuilder to support new getter/setter to allow access to previously existing but private schemeSpecificPart variable. Idea was to open the class for more use cases, like RFC 6068. Issue discussion at [HTTPCORE-627](https://issues.apache.org/jira/browse/HTTPCORE-627)
   


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



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-core] ok2c commented on a change in pull request #196: HTTPCORE-627: URIBuilder::Adding query parameters result in removing …

Posted by GitBox <gi...@apache.org>.
ok2c commented on a change in pull request #196:
URL: https://github.com/apache/httpcomponents-core/pull/196#discussion_r411573287



##########
File path: httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java
##########
@@ -264,13 +264,39 @@ public URIBuilder setScheme(final String scheme) {
     }
 
     /**
-     *Sets the URI scheme specific part.
+     * Sets the URI scheme specific part.
      *
      * @param schemeSpecificPart
-     * @param nvps Optional, can be null. List of query parameters to be reused by the specific scheme
      * @return this.
+     * @since 5.1
      */
-    public URIBuilder setSchemeSpecificPart(final String schemeSpecificPart, final List <NameValuePair> nvps) {
+    public URIBuilder setSchemeSpecificPart(final String schemeSpecificPart) {
+        this.encodedSchemeSpecificPart = schemeSpecificPart;
+        return this;
+    }
+
+    /**
+     * Sets the URI scheme specific part and append a list of parameters to this part.
+     *
+     * @param schemeSpecificPart
+     * @param nvps Optional, can be null. List of NameValuePair query parameters to be reused by the specific scheme part
+     * @return this.
+     * @since 5.1
+     */
+    public URIBuilder setSchemeSpecificPartWithParameter(final String schemeSpecificPart, final NameValuePair... nvps) {

Review comment:
       > The overloads taking NameValuePair... and List<NameValuePair> cannot have the same name
   @netsrotr Are you sure? We already have `setPathSegments` overloaded methods.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-core] netsrotr commented on a change in pull request #196: HTTPCORE-627: URIBuilder::Adding query parameters result in removing …

Posted by GitBox <gi...@apache.org>.
netsrotr commented on a change in pull request #196:
URL: https://github.com/apache/httpcomponents-core/pull/196#discussion_r411569975



##########
File path: httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java
##########
@@ -264,13 +264,39 @@ public URIBuilder setScheme(final String scheme) {
     }
 
     /**
-     *Sets the URI scheme specific part.
+     * Sets the URI scheme specific part.
      *
      * @param schemeSpecificPart
-     * @param nvps Optional, can be null. List of query parameters to be reused by the specific scheme
      * @return this.
+     * @since 5.1
      */
-    public URIBuilder setSchemeSpecificPart(final String schemeSpecificPart, final List <NameValuePair> nvps) {
+    public URIBuilder setSchemeSpecificPart(final String schemeSpecificPart) {
+        this.encodedSchemeSpecificPart = schemeSpecificPart;
+        return this;
+    }
+
+    /**
+     * Sets the URI scheme specific part and append a list of parameters to this part.
+     *
+     * @param schemeSpecificPart
+     * @param nvps Optional, can be null. List of NameValuePair query parameters to be reused by the specific scheme part
+     * @return this.
+     * @since 5.1
+     */
+    public URIBuilder setSchemeSpecificPartWithParameter(final String schemeSpecificPart, final NameValuePair... nvps) {

Review comment:
       The overloads taking `NameValuePair...` and `List<NameValuePair>` cannot have the same name.
   So I voted for an explicit setter (that match the getter) and differentiate the other by `...Parameter(...` and `...Parameters(...` 
   But: I can take whatever you prefer... Suggestions?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-core] ok2c commented on a change in pull request #196: HTTPCORE-627: URIBuilder::Adding query parameters result in removing …

Posted by GitBox <gi...@apache.org>.
ok2c commented on a change in pull request #196:
URL: https://github.com/apache/httpcomponents-core/pull/196#discussion_r411533962



##########
File path: httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java
##########
@@ -264,13 +264,39 @@ public URIBuilder setScheme(final String scheme) {
     }
 
     /**
-     *Sets the URI scheme specific part.
+     * Sets the URI scheme specific part.
      *
      * @param schemeSpecificPart
-     * @param nvps Optional, can be null. List of query parameters to be reused by the specific scheme
      * @return this.
+     * @since 5.1
      */
-    public URIBuilder setSchemeSpecificPart(final String schemeSpecificPart, final List <NameValuePair> nvps) {
+    public URIBuilder setSchemeSpecificPart(final String schemeSpecificPart) {
+        this.encodedSchemeSpecificPart = schemeSpecificPart;
+        return this;
+    }
+
+    /**
+     * Sets the URI scheme specific part and append a list of parameters to this part.
+     *
+     * @param schemeSpecificPart
+     * @param nvps Optional, can be null. List of NameValuePair query parameters to be reused by the specific scheme part
+     * @return this.
+     * @since 5.1
+     */
+    public URIBuilder setSchemeSpecificPartWithParameter(final String schemeSpecificPart, final NameValuePair... nvps) {

Review comment:
       @netsrotr `setSchemeSpecificPart` was a better name if you ask me. Why `setSchemeSpecificPartWithParameter`?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-core] ok2c commented on issue #196: HTTPCORE-627: URIBuilder::Adding query parameters result in removing …

Posted by GitBox <gi...@apache.org>.
ok2c commented on issue #196:
URL: https://github.com/apache/httpcomponents-core/pull/196#issuecomment-616434439


   @netsrotr Looks good to me. Could you please add `@since 5.1` tags to the javadocs of the new methods and add `public URIBuilder setSchemeSpecificPart(final String schemeSpecificPart, final NameValuePair... nvps)` method as well?


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



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-core] netsrotr commented on a change in pull request #196: HTTPCORE-627: URIBuilder::Adding query parameters result in removing …

Posted by GitBox <gi...@apache.org>.
netsrotr commented on a change in pull request #196:
URL: https://github.com/apache/httpcomponents-core/pull/196#discussion_r411577130



##########
File path: httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java
##########
@@ -264,13 +264,39 @@ public URIBuilder setScheme(final String scheme) {
     }
 
     /**
-     *Sets the URI scheme specific part.
+     * Sets the URI scheme specific part.
      *
      * @param schemeSpecificPart
-     * @param nvps Optional, can be null. List of query parameters to be reused by the specific scheme
      * @return this.
+     * @since 5.1
      */
-    public URIBuilder setSchemeSpecificPart(final String schemeSpecificPart, final List <NameValuePair> nvps) {
+    public URIBuilder setSchemeSpecificPart(final String schemeSpecificPart) {
+        this.encodedSchemeSpecificPart = schemeSpecificPart;
+        return this;
+    }
+
+    /**
+     * Sets the URI scheme specific part and append a list of parameters to this part.
+     *
+     * @param schemeSpecificPart
+     * @param nvps Optional, can be null. List of NameValuePair query parameters to be reused by the specific scheme part
+     * @return this.
+     * @since 5.1
+     */
+    public URIBuilder setSchemeSpecificPartWithParameter(final String schemeSpecificPart, final NameValuePair... nvps) {

Review comment:
       Oops... ;-) you are right: the unit test points me to the wrong road... Will refine the PR. Sry




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



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org