larshelge commented on a change in pull request #234: URL: https://github.com/apache/httpcomponents-core/pull/234#discussion_r536784990
########## File path: httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java ########## @@ -541,6 +560,18 @@ public URIBuilder setPathSegments(final List<String> pathSegments) { return this; } + /** + * Appends segments to URI path. The value is expected to be unescaped and may contain non ASCII characters. + * + * @return this. + */ + public URIBuilder appendPathSegments(final List<String> pathSegments) { + final List<String> segments = new ArrayList<>(getPathSegments()); Review comment: Agreed @ok2c. I wanted to avoid if-statements but we can favor less heap usage here. Note that the `new ArrayList<>(getPathSegments())` wrapper list is necessary as `getPathSegments` might return an immutable list which cannot be added to later. I have made the updates now. ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org