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 2022/07/01 15:39:38 UTC

[GitHub] [httpcomponents-core] jkmcl opened a new pull request, #355: Code cleanup and optimization

jkmcl opened a new pull request, #355:
URL: https://github.com/apache/httpcomponents-core/pull/355

   - Make 2 public static fields final
   - Remove 1 unused private static final field
   - Replace Stack with LinkedList


-- 
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: dev-unsubscribe@hc.apache.org

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] jkmcl commented on a diff in pull request #355: Code cleanup and optimization

Posted by GitBox <gi...@apache.org>.
jkmcl commented on code in PR #355:
URL: https://github.com/apache/httpcomponents-core/pull/355#discussion_r912075386


##########
httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java:
##########
@@ -1033,22 +1033,22 @@ public URIBuilder normalizeSyntax() {
         if (this.pathSegments != null) {
             final List<String> inputSegments = this.pathSegments;
             if (!inputSegments.isEmpty()) {
-                final Stack<String> outputSegments = new Stack<>();
+                final LinkedList<String> outputSegments = new LinkedList<>();

Review Comment:
   Performance. Stack extends Vector which is synchronized but LinkedList is not synchronized.



-- 
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: dev-unsubscribe@hc.apache.org

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] michael-o commented on a diff in pull request #355: Code cleanup and optimization

Posted by GitBox <gi...@apache.org>.
michael-o commented on code in PR #355:
URL: https://github.com/apache/httpcomponents-core/pull/355#discussion_r912082550


##########
httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java:
##########
@@ -1033,22 +1033,22 @@ public URIBuilder normalizeSyntax() {
         if (this.pathSegments != null) {
             final List<String> inputSegments = this.pathSegments;
             if (!inputSegments.isEmpty()) {
-                final Stack<String> outputSegments = new Stack<>();
+                final LinkedList<String> outputSegments = new LinkedList<>();

Review Comment:
   Right, yes. This makes then sense.



-- 
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: dev-unsubscribe@hc.apache.org

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] michael-o commented on a diff in pull request #355: Code cleanup and optimization

Posted by GitBox <gi...@apache.org>.
michael-o commented on code in PR #355:
URL: https://github.com/apache/httpcomponents-core/pull/355#discussion_r912069464


##########
httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java:
##########
@@ -1033,22 +1033,22 @@ public URIBuilder normalizeSyntax() {
         if (this.pathSegments != null) {
             final List<String> inputSegments = this.pathSegments;
             if (!inputSegments.isEmpty()) {
-                final Stack<String> outputSegments = new Stack<>();
+                final LinkedList<String> outputSegments = new LinkedList<>();

Review Comment:
   What is the benefit of this change?



-- 
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: dev-unsubscribe@hc.apache.org

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 merged pull request #355: Code cleanup and optimization

Posted by GitBox <gi...@apache.org>.
ok2c merged PR #355:
URL: https://github.com/apache/httpcomponents-core/pull/355


-- 
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: dev-unsubscribe@hc.apache.org

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] jkmcl commented on a diff in pull request #355: Code cleanup and optimization

Posted by GitBox <gi...@apache.org>.
jkmcl commented on code in PR #355:
URL: https://github.com/apache/httpcomponents-core/pull/355#discussion_r912135686


##########
httpcore5/src/main/java/org/apache/hc/core5/util/Deadline.java:
##########
@@ -60,12 +60,12 @@ public class Deadline {
     /**
      * The maximum (longest-lived) deadline.
      */
-    public static Deadline MAX_VALUE = new Deadline(INTERNAL_MAX_VALUE);
+    public static final Deadline MAX_VALUE = new Deadline(INTERNAL_MAX_VALUE);
 
     /**
      * The minimum (shortest-lived) deadline.
      */
-    public static Deadline MIN_VALUE = new Deadline(INTERNAL_MIN_VALUE);
+    public static final Deadline MIN_VALUE = new Deadline(INTERNAL_MIN_VALUE);

Review Comment:
   Sure, I've reverted those 2 commits. Please consider making `Deadline.MIN_VALUE` and `Deadline.MAX_VALUE` final in the future when the API is revised. Thanks



-- 
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: dev-unsubscribe@hc.apache.org

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] jkmcl commented on a diff in pull request #355: Code cleanup and optimization

Posted by GitBox <gi...@apache.org>.
jkmcl commented on code in PR #355:
URL: https://github.com/apache/httpcomponents-core/pull/355#discussion_r912135686


##########
httpcore5/src/main/java/org/apache/hc/core5/util/Deadline.java:
##########
@@ -60,12 +60,12 @@ public class Deadline {
     /**
      * The maximum (longest-lived) deadline.
      */
-    public static Deadline MAX_VALUE = new Deadline(INTERNAL_MAX_VALUE);
+    public static final Deadline MAX_VALUE = new Deadline(INTERNAL_MAX_VALUE);
 
     /**
      * The minimum (shortest-lived) deadline.
      */
-    public static Deadline MIN_VALUE = new Deadline(INTERNAL_MIN_VALUE);
+    public static final Deadline MIN_VALUE = new Deadline(INTERNAL_MIN_VALUE);

Review Comment:
   @ok2c Sure, I've reverted those 2 commits. Please consider making `Deadline.MIN_VALUE` and `Deadline.MAX_VALUE` final in the future when the API is revised. Thanks



-- 
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: dev-unsubscribe@hc.apache.org

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 diff in pull request #355: Code cleanup and optimization

Posted by GitBox <gi...@apache.org>.
ok2c commented on code in PR #355:
URL: https://github.com/apache/httpcomponents-core/pull/355#discussion_r912116329


##########
httpcore5/src/main/java/org/apache/hc/core5/util/Deadline.java:
##########
@@ -60,12 +60,12 @@ public class Deadline {
     /**
      * The maximum (longest-lived) deadline.
      */
-    public static Deadline MAX_VALUE = new Deadline(INTERNAL_MAX_VALUE);
+    public static final Deadline MAX_VALUE = new Deadline(INTERNAL_MAX_VALUE);
 
     /**
      * The minimum (shortest-lived) deadline.
      */
-    public static Deadline MIN_VALUE = new Deadline(INTERNAL_MIN_VALUE);
+    public static final Deadline MIN_VALUE = new Deadline(INTERNAL_MIN_VALUE);

Review Comment:
   @jkmcl This breaks binary compatibility. See build failure in Travis C. `URIBuilder` optimization looks good, but two first commits look useless. Please drop them.



-- 
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: dev-unsubscribe@hc.apache.org

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