You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by sebb <se...@gmail.com> on 2012/04/25 02:39:00 UTC

r1327298 StringEntity and NStringEntity static method deletions - intentional?

The log for r1327298 says:

URL: http://svn.apache.org/viewvc?rev=1327298&view=rev
Log:
HTTPCORE-297: ContentType to use Charset instead of String to
represent the charset parameter

However, the commit also removed some static methods from StringEntity
[1] and NStringEntity [2] - was that intentional?

[1] http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/entity/StringEntity.java?rev=1327298&r1=1327297&r2=1327298&view=diff


[2] http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/entity/NStringEntity.java?view=diff&r1=1327297&r2=1327298&pathrev=1327298

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: r1327298 StringEntity and NStringEntity static method deletions - intentional?

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2012-04-25 at 09:49 +0100, sebb wrote:
> On 25 April 2012 09:44, Oleg Kalnichevski <ol...@apache.org> wrote:
> > On Wed, 2012-04-25 at 01:39 +0100, sebb wrote:
> >> The log for r1327298 says:
> >>
> >> URL: http://svn.apache.org/viewvc?rev=1327298&view=rev
> >> Log:
> >> HTTPCORE-297: ContentType to use Charset instead of String to
> >> represent the charset parameter
> >>
> >> However, the commit also removed some static methods from StringEntity
> >> [1] and NStringEntity [2] - was that intentional?
> >>
> >
> > Yes, it was intentional. Those static #create method were primarily
> > needed to re-throw checked UnspportedEncodingException as unchecked
> > IllegalArgumentException. Since charset validation moved to the
> > ContentType class there was no longer any good reason for having static
> > #create method in StringEntity and NStringEntity.
> 
> OK, in that case one of the HttpClient test cases needs fixing:
> 
> client.TestBasicResponseHandler.testSuccessfulResponse() calls
> StringEntity.create()
> 
> 

Sure. I'll fix it as soon as HttpCore 4.2 becomes available.

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: r1327298 StringEntity and NStringEntity static method deletions - intentional?

Posted by sebb <se...@gmail.com>.
On 25 April 2012 09:44, Oleg Kalnichevski <ol...@apache.org> wrote:
> On Wed, 2012-04-25 at 01:39 +0100, sebb wrote:
>> The log for r1327298 says:
>>
>> URL: http://svn.apache.org/viewvc?rev=1327298&view=rev
>> Log:
>> HTTPCORE-297: ContentType to use Charset instead of String to
>> represent the charset parameter
>>
>> However, the commit also removed some static methods from StringEntity
>> [1] and NStringEntity [2] - was that intentional?
>>
>
> Yes, it was intentional. Those static #create method were primarily
> needed to re-throw checked UnspportedEncodingException as unchecked
> IllegalArgumentException. Since charset validation moved to the
> ContentType class there was no longer any good reason for having static
> #create method in StringEntity and NStringEntity.

OK, in that case one of the HttpClient test cases needs fixing:

client.TestBasicResponseHandler.testSuccessfulResponse() calls
StringEntity.create()


> Oleg
>
>> [1] http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/entity/StringEntity.java?rev=1327298&r1=1327297&r2=1327298&view=diff
>>
>>
>> [2] http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/entity/NStringEntity.java?view=diff&r1=1327297&r2=1327298&pathrev=1327298
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
>> For additional commands, e-mail: dev-help@hc.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: r1327298 StringEntity and NStringEntity static method deletions - intentional?

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2012-04-25 at 01:39 +0100, sebb wrote:
> The log for r1327298 says:
> 
> URL: http://svn.apache.org/viewvc?rev=1327298&view=rev
> Log:
> HTTPCORE-297: ContentType to use Charset instead of String to
> represent the charset parameter
> 
> However, the commit also removed some static methods from StringEntity
> [1] and NStringEntity [2] - was that intentional?
> 

Yes, it was intentional. Those static #create method were primarily
needed to re-throw checked UnspportedEncodingException as unchecked
IllegalArgumentException. Since charset validation moved to the
ContentType class there was no longer any good reason for having static
#create method in StringEntity and NStringEntity.

Oleg

> [1] http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/entity/StringEntity.java?rev=1327298&r1=1327297&r2=1327298&view=diff
> 
> 
> [2] http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/entity/NStringEntity.java?view=diff&r1=1327297&r2=1327298&pathrev=1327298
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org