You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Johan Compagner <jc...@gmail.com> on 2008/09/30 22:27:40 UTC

let ValueMap extend LinkedHashMap instead of HashMap (1.3) or TreeMap (1.4)?

Hi,

i just got a complained that urls can be changed because the parameters in
an url (hybrid or something else bookmarkable)
are in 1.3 just random sorted because it is a HashMap en in 1.4 they are
sorted in natural order because we use a TreeMap
That last thing in 1.4 we do because of unit testing....

Cant we just use the LinkedHashMap? thats a cheaper one that TreeMap and
then the order is not natural but it is stable because
it is the order of insertion.

johan

Re: let ValueMap extend LinkedHashMap instead of HashMap (1.3) or TreeMap (1.4)?

Posted by Johan Compagner <jc...@gmail.com>.
ok i let ValueMap extend the LinkedHashMap and removed that UnitTestSettings
class completely

johan


On Fri, Oct 3, 2008 at 4:49 PM, Nino Saturnino Martinez Vazquez Wael <
nino.martinez@jayway.dk> wrote:

> Now your on it, theres also the mystery setting:
>
> UnitTestSettings.setSortUrlParameters(true);
>
> org.apache.wicket.protocol.http.UnitTestSettings, it actually makes your
> urls stable. But I'd be happy to see the class go away. And it could if it's
> implemented the way you suggest. Currently im using it to get stable urls.
>
> It's both there in 1.3 and 1.4 snapshot. And are used in various places
> around the framework (17 hits, with eclipse search).
>
> so +1 non binding:)
>
>
> Johan Compagner wrote:
>
>> Hi,
>>
>> i just got a complained that urls can be changed because the parameters in
>> an url (hybrid or something else bookmarkable)
>> are in 1.3 just random sorted because it is a HashMap en in 1.4 they are
>> sorted in natural order because we use a TreeMap
>> That last thing in 1.4 we do because of unit testing....
>>
>> Cant we just use the LinkedHashMap? thats a cheaper one that TreeMap and
>> then the order is not natural but it is stable because
>> it is the order of insertion.
>>
>> johan
>>
>>
>>
>
> --
> -Wicket for love
>
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
>
>

Re: let ValueMap extend LinkedHashMap instead of HashMap (1.3) or TreeMap (1.4)?

Posted by Igor Vaynberg <ig...@gmail.com>.
everybody has a say, your opinions help us shape ours

-igor

On Fri, Oct 3, 2008 at 10:37 AM, Jeremy Thomerson
<je...@wickettraining.com> wrote:
> I know I don't really have a say, but I'd be +1.  I have had to get around
> this several times by doing crazy hacks that sort the parameters the same
> way (I didn't know about the UnitTestSettings hack).
>
> I'd add: should page parameters be an interface so that it's more
> customizable for whatever the desired behavior is (sorting, etc....).  Just
> a thought.  I haven't given it enough thought to weight the pros / cons.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Fri, Oct 3, 2008 at 9:49 AM, Nino Saturnino Martinez Vazquez Wael <
> nino.martinez@jayway.dk> wrote:
>
>> Now your on it, theres also the mystery setting:
>>
>> UnitTestSettings.setSortUrlParameters(true);
>>
>> org.apache.wicket.protocol.http.UnitTestSettings, it actually makes your
>> urls stable. But I'd be happy to see the class go away. And it could if it's
>> implemented the way you suggest. Currently im using it to get stable urls.
>>
>> It's both there in 1.3 and 1.4 snapshot. And are used in various places
>> around the framework (17 hits, with eclipse search).
>>
>> so +1 non binding:)
>>
>>
>> Johan Compagner wrote:
>>
>>> Hi,
>>>
>>> i just got a complained that urls can be changed because the parameters in
>>> an url (hybrid or something else bookmarkable)
>>> are in 1.3 just random sorted because it is a HashMap en in 1.4 they are
>>> sorted in natural order because we use a TreeMap
>>> That last thing in 1.4 we do because of unit testing....
>>>
>>> Cant we just use the LinkedHashMap? thats a cheaper one that TreeMap and
>>> then the order is not natural but it is stable because
>>> it is the order of insertion.
>>>
>>> johan
>>>
>>>
>>>
>>
>> --
>> -Wicket for love
>>
>> Nino Martinez Wael
>> Java Specialist @ Jayway DK
>> http://www.jayway.dk
>> +45 2936 7684
>>
>>
>

Re: let ValueMap extend LinkedHashMap instead of HashMap (1.3) or TreeMap (1.4)?

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.

Jeremy Thomerson wrote:
> I know I don't really have a say, but I'd be +1.  I have had to get around
> this several times by doing crazy hacks that sort the parameters the same
> way (I didn't know about the UnitTestSettings hack).
>
>   
:) open source is nice, you can read the source:)
> I'd add: should page parameters be an interface so that it's more
> customizable for whatever the desired behavior is (sorting, etc....).  Just
> a thought.  I haven't given it enough thought to weight the pros / cons.
>
>   

-- 
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


Re: let ValueMap extend LinkedHashMap instead of HashMap (1.3) or TreeMap (1.4)?

Posted by Jeremy Thomerson <je...@wickettraining.com>.
I know I don't really have a say, but I'd be +1.  I have had to get around
this several times by doing crazy hacks that sort the parameters the same
way (I didn't know about the UnitTestSettings hack).

I'd add: should page parameters be an interface so that it's more
customizable for whatever the desired behavior is (sorting, etc....).  Just
a thought.  I haven't given it enough thought to weight the pros / cons.

-- 
Jeremy Thomerson
http://www.wickettraining.com



On Fri, Oct 3, 2008 at 9:49 AM, Nino Saturnino Martinez Vazquez Wael <
nino.martinez@jayway.dk> wrote:

> Now your on it, theres also the mystery setting:
>
> UnitTestSettings.setSortUrlParameters(true);
>
> org.apache.wicket.protocol.http.UnitTestSettings, it actually makes your
> urls stable. But I'd be happy to see the class go away. And it could if it's
> implemented the way you suggest. Currently im using it to get stable urls.
>
> It's both there in 1.3 and 1.4 snapshot. And are used in various places
> around the framework (17 hits, with eclipse search).
>
> so +1 non binding:)
>
>
> Johan Compagner wrote:
>
>> Hi,
>>
>> i just got a complained that urls can be changed because the parameters in
>> an url (hybrid or something else bookmarkable)
>> are in 1.3 just random sorted because it is a HashMap en in 1.4 they are
>> sorted in natural order because we use a TreeMap
>> That last thing in 1.4 we do because of unit testing....
>>
>> Cant we just use the LinkedHashMap? thats a cheaper one that TreeMap and
>> then the order is not natural but it is stable because
>> it is the order of insertion.
>>
>> johan
>>
>>
>>
>
> --
> -Wicket for love
>
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
>
>

Re: let ValueMap extend LinkedHashMap instead of HashMap (1.3) or TreeMap (1.4)?

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
Now your on it, theres also the mystery setting:

UnitTestSettings.setSortUrlParameters(true);

org.apache.wicket.protocol.http.UnitTestSettings, it actually makes your 
urls stable. But I'd be happy to see the class go away. And it could if 
it's implemented the way you suggest. Currently im using it to get 
stable urls.

It's both there in 1.3 and 1.4 snapshot. And are used in various places 
around the framework (17 hits, with eclipse search).

so +1 non binding:)

Johan Compagner wrote:
> Hi,
>
> i just got a complained that urls can be changed because the parameters in
> an url (hybrid or something else bookmarkable)
> are in 1.3 just random sorted because it is a HashMap en in 1.4 they are
> sorted in natural order because we use a TreeMap
> That last thing in 1.4 we do because of unit testing....
>
> Cant we just use the LinkedHashMap? thats a cheaper one that TreeMap and
> then the order is not natural but it is stable because
> it is the order of insertion.
>
> johan
>
>   

-- 
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


Re: let ValueMap extend LinkedHashMap instead of HashMap (1.3) or TreeMap (1.4)?

Posted by Igor Vaynberg <ig...@gmail.com>.
works for me

-igor

On Tue, Sep 30, 2008 at 1:27 PM, Johan Compagner <jc...@gmail.com> wrote:
> Hi,
>
> i just got a complained that urls can be changed because the parameters in
> an url (hybrid or something else bookmarkable)
> are in 1.3 just random sorted because it is a HashMap en in 1.4 they are
> sorted in natural order because we use a TreeMap
> That last thing in 1.4 we do because of unit testing....
>
> Cant we just use the LinkedHashMap? thats a cheaper one that TreeMap and
> then the order is not natural but it is stable because
> it is the order of insertion.
>
> johan
>