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 2021/03/16 06:06:09 UTC

[GitHub] [httpcomponents-client] arturobernalg opened a new pull request #294: Feature/method enum

arturobernalg opened a new pull request #294:
URL: https://github.com/apache/httpcomponents-client/pull/294


   


----------------------------------------------------------------
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-client] arturobernalg commented on a change in pull request #294: feature/method enum

Posted by GitBox <gi...@apache.org>.
arturobernalg commented on a change in pull request #294:
URL: https://github.com/apache/httpcomponents-client/pull/294#discussion_r594970631



##########
File path: httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestAddCookies.java
##########
@@ -78,7 +79,7 @@ public void process(final HttpRequest request, final EntityDetails entity, final
         Args.notNull(context, "HTTP context");
 
         final String method = request.getMethod();
-        if (method.equalsIgnoreCase("CONNECT") || method.equalsIgnoreCase("TRACE")) {
+        if (method.equalsIgnoreCase(Method.CONNECT.name()) || method.equalsIgnoreCase(Method.TRACE.name())) {

Review comment:
       Yep, changed




----------------------------------------------------------------
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-client] arturobernalg commented on pull request #294: feature/method enum

Posted by GitBox <gi...@apache.org>.
arturobernalg commented on pull request #294:
URL: https://github.com/apache/httpcomponents-client/pull/294#issuecomment-800080622


   > As far as I remember, Sun's recommendation was not to rely on `#name()`. Does someone remember that too?
   
   https://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html#name()


----------------------------------------------------------------
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-client] ok2c commented on a change in pull request #294: feature/method enum

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



##########
File path: httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ProxyClient.java
##########
@@ -158,7 +159,8 @@ public Socket tunnel(
         final HttpContext context = new BasicHttpContext();
         ClassicHttpResponse response;
 
-        final ClassicHttpRequest connect = new BasicClassicHttpRequest("CONNECT", host.toHostString());
+        final ClassicHttpRequest connect = new BasicClassicHttpRequest(Method.CONNECT, host.toHostString());
+        new BasicClassicHttpRequest("CONNECT", host.toHostString());

Review comment:
       @arturobernalg This line looks redundant. Is this intentional?




----------------------------------------------------------------
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-client] ok2c commented on a change in pull request #294: feature/method enum

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



##########
File path: httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestAddCookies.java
##########
@@ -78,7 +79,7 @@ public void process(final HttpRequest request, final EntityDetails entity, final
         Args.notNull(context, "HTTP context");
 
         final String method = request.getMethod();
-        if (method.equalsIgnoreCase("CONNECT") || method.equalsIgnoreCase("TRACE")) {
+        if (method.equalsIgnoreCase(Method.CONNECT.name()) || method.equalsIgnoreCase(Method.TRACE.name())) {

Review comment:
       @arturobernalg Could you please use `Method#isSame` instead of `String#equalsIgnoreCase`?




----------------------------------------------------------------
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-client] michael-o commented on pull request #294: feature/method enum

Posted by GitBox <gi...@apache.org>.
michael-o commented on pull request #294:
URL: https://github.com/apache/httpcomponents-client/pull/294#issuecomment-800077685


   As far as I remember, Sun's recommendation was not to rely on `#name()`. Does someone remember that too?


----------------------------------------------------------------
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-client] ok2c commented on pull request #294: feature/method enum

Posted by GitBox <gi...@apache.org>.
ok2c commented on pull request #294:
URL: https://github.com/apache/httpcomponents-client/pull/294#issuecomment-800085878


   > 
   > 
   > As far as I remember, Sun's recommendation was not to rely on `#name()`. Does someone remember that too?
   
   @michael-o We should only be using it inside enum methods, so I do think it is a big offense.


----------------------------------------------------------------
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-client] ok2c merged pull request #294: feature/method enum

Posted by GitBox <gi...@apache.org>.
ok2c merged pull request #294:
URL: https://github.com/apache/httpcomponents-client/pull/294


   


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