[
https://issues.apache.org/jira/browse/HTTPCORE-101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512822
]
Daniel Müller commented on HTTPCORE-101:
----------------------------------------
The reason for the proposition was that in the code I wrote for httpcompontents
4.0-alpha5, I'm preinstantiate the params in the following way:
Fields:
private final HttpParams httpParams;
...
Constructor() {
...
BasicHttpParams params = new BasicHttpParams(null);
HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
HttpProtocolParams.setContentCharset(params, "UTF-8");
HttpProtocolParams.setUserAgent(params, "Jakarta-HttpComponents/1.1");
HttpProtocolParams.setUseExpectContinue(params, true);
httpParams = params;
...
}
If the interface would not be modifiable, it would clarify that the params are
not really modified by the framework itself. And from this anyone could deduce
that this class can be safely be used by multiple threads from a httpcomponents
perspective. This is a result of a question posted on httpcomponents-dev [1].
[1]
http://www.nabble.com/Threadsafety-of-the-classes-in-core-tf4037548.html#a11470779
> Consider read-only HttpParams
> -----------------------------
>
> Key: HTTPCORE-101
> URL: https://issues.apache.org/jira/browse/HTTPCORE-101
> Project: HttpComponents Core
> Issue Type: Improvement
> Components: HttpCore, HttpCore NIO
> Affects Versions: 4.0-alpha5
> Reporter: Roland Weber
> Assignee: Roland Weber
> Priority: Minor
> Fix For: 4.0-alpha6
>
>
> Consider turning HttpParams into a read-only interface, moving modifiers to
> an extension interface.
> Suggested by Daniel Müller on httpcomponents-dev.
> This will break the following style of updating existing parameters:
> xxx.getParams().setParameter("name", value);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]