You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2021/09/11 12:37:29 UTC
[httpcomponents-core] branch 5.1.x updated: HTTPCLIENT-2174:
URUBuilder to return a new empty list instead of unmodifiable
Collections#emptyList
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a commit to branch 5.1.x
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git
The following commit(s) were added to refs/heads/5.1.x by this push:
new 8e37c1c HTTPCLIENT-2174: URUBuilder to return a new empty list instead of unmodifiable Collections#emptyList
8e37c1c is described below
commit 8e37c1c2156432029f737c8ec6a50289cb105277
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sat Sep 11 13:52:38 2021 +0200
HTTPCLIENT-2174: URUBuilder to return a new empty list instead of unmodifiable Collections#emptyList
---
httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java b/httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java
index 323d20f..6c4ff48 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java
@@ -811,7 +811,7 @@ public class URIBuilder {
}
public List<String> getPathSegments() {
- return this.pathSegments != null ? new ArrayList<>(this.pathSegments) : Collections.<String>emptyList();
+ return this.pathSegments != null ? new ArrayList<>(this.pathSegments) : new ArrayList<String>();
}
public String getPath() {
@@ -830,7 +830,7 @@ public class URIBuilder {
}
public List<NameValuePair> getQueryParams() {
- return this.queryParams != null ? new ArrayList<>(this.queryParams) : Collections.<NameValuePair>emptyList();
+ return this.queryParams != null ? new ArrayList<>(this.queryParams) : new ArrayList<NameValuePair>();
}
public String getFragment() {