You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2017/12/15 00:05:00 UTC
[jira] [Updated] (HTTPCORE-500)
org.apache.http.client.utils.URLEncodedUtils.parse(URI, Charset) should
return a new ArrayList when there are no query parameters
[ https://issues.apache.org/jira/browse/HTTPCORE-500?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary Gregory updated HTTPCORE-500:
----------------------------------
Description:
{{org.apache.http.client.utils.URLEncodedUtils.parse(URI, Charset)}} should return a new {{ArrayList}} when there are no query parameters.
Currently, {{org.apache.http.client.utils.URLEncodedUtils.parse(URI, Charset)}} returns an immutable list through {{Collections.emptyList()}} if there are no params> But if there are parameters, the method returns a mutable list.
This makes it impossible to write the same code to handle both cases.
This change will cause the method to return a new {{ArrayList}} if there are no parameters.
The methods affected are:
- org.apache.http.client.utils.URLEncodedUtils.parse(URI, Charset)
- org.apache.http.client.utils.URLEncodedUtils.parse(HttpEntity)
- org.apache.http.client.utils.URLEncodedUtils.parse(String, Charset)
- org.apache.http.client.utils.URLEncodedUtils.parse(String, Charset, char...)
was:
{{org.apache.http.client.utils.URLEncodedUtils.parse(URI, Charset)}} should return a new {{ArrayList}} when there are no query parameters.
Currently, {{org.apache.http.client.utils.URLEncodedUtils.parse(URI, Charset)}} returns an immutable list through {{Collections.emptyList()}} if there are no params> But if there are parameters, the method returns a mutable list.
This makes it impossible to write the same code to handle both cases.
This change will cause the method to return a new {{ArrayList}} if there are no parameters.
> org.apache.http.client.utils.URLEncodedUtils.parse(URI, Charset) should return a new ArrayList when there are no query parameters
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: HTTPCORE-500
> URL: https://issues.apache.org/jira/browse/HTTPCORE-500
> Project: HttpComponents HttpCore
> Issue Type: Bug
> Components: HttpCore
> Affects Versions: 4.4.8, 5.0-beta1
> Reporter: Gary Gregory
> Assignee: Gary Gregory
>
> {{org.apache.http.client.utils.URLEncodedUtils.parse(URI, Charset)}} should return a new {{ArrayList}} when there are no query parameters.
> Currently, {{org.apache.http.client.utils.URLEncodedUtils.parse(URI, Charset)}} returns an immutable list through {{Collections.emptyList()}} if there are no params> But if there are parameters, the method returns a mutable list.
> This makes it impossible to write the same code to handle both cases.
> This change will cause the method to return a new {{ArrayList}} if there are no parameters.
> The methods affected are:
> - org.apache.http.client.utils.URLEncodedUtils.parse(URI, Charset)
> - org.apache.http.client.utils.URLEncodedUtils.parse(HttpEntity)
> - org.apache.http.client.utils.URLEncodedUtils.parse(String, Charset)
> - org.apache.http.client.utils.URLEncodedUtils.parse(String, Charset, char...)
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org