admin@glassfish.java.net

Re: defect in collection handling code

From: Lloyd L Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Tue, 22 Apr 2008 16:25:16 -0700

I've coded AMX to not add duplicates, but it leaves any existing
duplicates alone.

So:

setJVMOptions( getJVMOption() )

will change nothing; if duplicates exist they will remain that way.

On Apr 22, 2008, at 4:21 PM, Jerome Dochez wrote:

> if you re-add the ones which were already there yes that's a
> problem. I think that the admin gui or you need to see what are the
> current options and only apply the diffs and stop reassigning
> everything !
>
> the config-api so far gives you the semantics of a List<String>,
> this is up the the clients of the API to do the right thing. I you
> add 100 times the same string in a plain JDK list, you will get a
> 100 strings in there...
>
> jerome
>
> Lloyd L Chambers wrote:
>> Well, there *is* some minor harm.
>>
>> If the user clicks the "Save" button in the GUI, all the options
>> are going to end up doubled, then doubled again, etc. Quite a mess.
>>
>> Lloyd
>>
>> On Apr 22, 2008, at 3:59 PM, Jerome Dochez wrote:
>>
>>> just don't do anything for such case, there is -at least- no harm
>>> in adding several jvm-options of the same value.
>>>
>>> Lloyd L Chambers wrote:
>>>> Jerome,
>>>>
>>>> Maybe, maybe not.
>>>>
>>>> It's hard for me to keep having to deal with details like this
>>>> (not the only one) while trying to make AMX work for the GUI.
>>>>
>>>> Lloyd
>>>>
>>>> On Apr 22, 2008, at 3:41 PM, Jerome Dochez wrote:
>>>>
>>>>> Lloyd L Chambers wrote:
>>>>>> Jerome,
>>>>>>
>>>>>> The Config code allows the following to occur:
>>>>>>
>>>>>> <jvm-options>-Dfoo=bar</jvm-options>
>>>>>> <jvm-options>-Dfoo=bar</jvm-options>
>>>>>> <jvm-options>-Dfoo=bar</jvm-options>
>>>>>> <jvm-options>-Dfoo=bar</jvm-options>
>>>>>> <jvm-options>-Dfoo=bar</jvm-options>
>>>>>> <jvm-options>-Dfoo=bar</jvm-options>
>>>>>>
>>>>>> I can't see any reason to allow this for <jvm-options>, though
>>>>>> maybe there is a reason for other cases.
>>>>>>
>>>>>> Thoughts? Should support for Set<String> be added to indicate
>>>>>> uniqueness?
>>>>>>
>>>>>> What should AMX do about this?
>>>>> let's revisit this after TP-2, I don't think we need to solve it
>>>>> now.
>>>>>
>>>>> jerome
>>>>>
>>>>>>
>>>>>> Lloyd
>>>>>>
>>>>>> ---
>>>>>> Lloyd L Chambers
>>>>>> lloyd.chambers_at_sun.com
>>>>>> Sun Microsystems, Inc
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>> ---
>>>> Lloyd L Chambers
>>>> lloyd.chambers_at_sun.com
>>>> Sun Microsystems, Inc
>>>>
>>>>
>>>>
>>>
>>
>> ---
>> Lloyd L Chambers
>> lloyd.chambers_at_sun.com
>> Sun Microsystems, Inc
>>
>>
>>
>

---
Lloyd L Chambers
lloyd.chambers_at_sun.com
Sun Microsystems, Inc