You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Oleg Kalnichevski <ol...@apache.org> on 2013/01/25 15:51:15 UTC
Re: svn commit: r1438494
On Fri, 2013-01-25 at 14:12 +0000, sebb wrote:
...
> > - String tokenstr = new String(base64codec.encode(token));
> > + String tokenstr = new String(Base64.encodeBase64(token, false));
>
> This change means that the Base64 class will be recreated for each
> call (it is created internally)
>
> Would it not be better to change the final instance variable instead?
>
I did not realize that static method created a new instance of the class
internally. This is certainly not optimal. Good catch! Thank you! I'll
get it fixed.
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
Re: svn commit: r1438494
Posted by sebb <se...@gmail.com>.
On 25 January 2013 14:51, Oleg Kalnichevski <ol...@apache.org> wrote:
> On Fri, 2013-01-25 at 14:12 +0000, sebb wrote:
>
> ...
>
>> > - String tokenstr = new String(base64codec.encode(token));
>> > + String tokenstr = new String(Base64.encodeBase64(token, false));
>>
>> This change means that the Base64 class will be recreated for each
>> call (it is created internally)
>>
>> Would it not be better to change the final instance variable instead?
>>
>
> I did not realize that static method created a new instance of the class
> internally. This is certainly not optimal. Good catch! Thank you! I'll
> get it fixed.
OK, no problem.
I guess we ought to document that behaviour in Codec; I'll raise a JIRA
> Oleg
>
>
>
> ---------------------------------------------------------------------
> 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