You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Gareth Smith <ga...@gmail.com> on 2015/05/10 12:29:51 UTC
Why are there two ArrayList classes?
Hi,
I am putting together a patch for ArrayList to support square-bracket
indexing and for-each loops, see:
https://issues.apache.org/jira/browse/FLEX-15159
I am confused by the existence of not one, but two ArrayList classes:
the "original" one at mx.collections.ArrayList and another one at
org.apache.flex.collections.ArrayList.
Why are there two classes? Looking at their diff, I would guess that
mx.collections.ArrayList is newer: it has some additional optimisations,
and an additional toJSON() method.
I could patch both classes, but I would rather not introduce more
duplication that might become a maintenance burden along the line.
Thanks
Gareth
Re: Why are there two ArrayList classes? [PING Justin Mclean)
Posted by Mihai Chira <mi...@gmail.com>.
> (Carol Frampton committed it against an Adobe ticket SDK-30008)
this is in our FLEX-27127[1] ticket
[1] https://issues.apache.org/jira/browse/FLEX-27127
Re: Why are there two ArrayList classes? [PING Justin Mclean)
Posted by Mihai Chira <mi...@gmail.com>.
> I just looked quickly at the differences. It appears that the second
> ArrayList has different update event logic so it may be that it was safer
> to create a different ArrayList so we wouldn’t have to worry about
> backward compatibility issues.
If we're talking about the same classes (mx/collections/ArrayList.as
and org/apache/flex/collections/ArrayList.as), there is no actual
difference in how UPDATE events are handled (only different function
calls, but they do exactly the same thing). The only differences seem
to be:
1) the mx version has a "toJSON()" function
2) addAllAt is quite different, with the mx version being more recent
(Carol Frampton committed it against an Adobe ticket SDK-30008)
3) my recent fix for FLEX-34885[1], which I only applied on the mx
side for now, till I get my head round this duplication.
So to reiterate Gareth's question: do we know why we have the
flex/collections version of the ArrayList class (given that Mike said
he doesn't know either, and pointed to a commit by Carol Frampton)? I
just did a search for "flex.collections.ArrayList" and there are no
results, implying that this version is never used. Can we delete it?
It looks like we wouldn't miss anything useful.
[1] https://issues.apache.org/jira/browse/FLEX-34885
Re: Why are there two ArrayList classes? [PING Justin Mclean)
Posted by Mihai Chira <mi...@gmail.com>.
> http://apache-flex-development.2333347.n4.nabble.com/ArrayList-itemUpdateHandler-Change-td7774.html
Mike, you mention here "If you look at the unit tests I wrote for
ArrayList" - do you mean the Mustella tests, or are there unit tests
too?
RE: Why are there two ArrayList classes? [PING Justin Mclean)
Posted by "Michael A. Labriola" <la...@digitalprimates.net>.
>It looks to me like the intention of the person who originally created the new ArrayList (Michael A. Labriola) was for it to be tested with the rest of the framework and then to replace the original ArrayList:
Nope, I don't think that was me. I was just changing the itemUpdateHandler. I still have the local copy. Found this though:
https://apache.googlesource.com/flex-sdk/+/f3234bff7671a118bed31182c7bb4032e0fc5284
Mike
Re: Why are there two ArrayList classes? [PING Justin Mclean)
Posted by Gareth Smith <ga...@gmail.com>.
Justin,
I did it in a debug player - oops. I have just redone the tests in a
release player, and with objects in addition to integers. I am using
flashplayer 11 on Linux because that is the latest version available.
Timings for incrementing each integer in a million item array:
Array: 0.1 sec
old ArrayList (get/set Item): 0.4 sec
new ArrayList (get/set Item): 0.4 sec
new ArrayList ([]): 3.7 sec
Timings for initialising an array with either setItemAt({x: 0}, i) or
array[i] = {x: 0} and then getting each item and incrementing x:
Array: 0.5 sec
old ArrayList (get/set Item): 0.9 sec
new ArrayList (get/set Item): 1.0 sec
new ArrayList ([]): 12.7 sec
So the results are similar to before: actually using the sugar is much
slower than not doing so, but just extending Proxy makes little difference.
Gareth
On 26/05/15 05:47, Justin Mclean wrote:
> Hi,
>
>> I have done some very unscientific tests: for each kind of list (Array, old ArrayList, new ArrayList, new ArrayList - using sugar) the test code creates a million-item array and then increments each value that it contains.
> Was this done in a release player? And did you try testing it on array of objects rather than integers?
>
> Thanks,
> Justin
Re: Why are there two ArrayList classes? [PING Justin Mclean)
Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,
> I have done some very unscientific tests: for each kind of list (Array, old ArrayList, new ArrayList, new ArrayList - using sugar) the test code creates a million-item array and then increments each value that it contains.
Was this done in a release player? And did you try testing it on array of objects rather than integers?
Thanks,
Justin
Re: Why are there two ArrayList classes? [PING Justin Mclean)
Posted by Gareth Smith <ga...@gmail.com>.
Perhaps. The same warning should apply to ListCollectionView.
Gareth
On 26/05/15 05:29, Alex Harui wrote:
> OK, good enough for me, although I don’t like enticing people to use APIs
> that are slow when there’s a way that is 5 times faster. Maybe we should
> warn folks about this in the asdoc?
>
> -Alex
>
> On 5/19/15, 2:25 PM, "Gareth Smith" <ga...@gmail.com> wrote:
>
>> I have done some very unscientific tests: for each kind of list (Array,
>> old ArrayList, new ArrayList, new ArrayList - using sugar) the test code
>> creates a million-item array and then increments each value that it
>> contains.
>>
>> This is how long each test takes:
>>
>> Array: 0.1 sec
>> old ArrayList (get/set Item): 0.8 sec
>> new ArrayList (get/set Item): 0.9 sec
>> new ArrayList ([]): 5.6 sec
>>
>> In summary, indexing sugar is really slow, but get/set item don't seem
>> to get much slower just by implementing Proxy.
>>
>> Gareth
>>
>> On 18/05/15 06:56, Alex Harui wrote:
>>> On 5/17/15, 9:22 AM, "Gareth Smith" <ga...@gmail.com> wrote:
>>>
>>>> I don't know about any performance impact.
>>> Can you run a some of quick tests? Iterating on 1000 items via for-each
>>> on an Array, via a loop on ArrayList.getItemAt() before your Proxy
>>> change
>>> and using [] and for-each on ArrayList after your new Proxy change?
>>>
>>> And maybe also try 5000 and 10000 items if you have time.
>>>
>>> Thanks,
>>> -Alex
>>>
Re: Why are there two ArrayList classes? [PING Justin Mclean)
Posted by Alex Harui <ah...@adobe.com>.
OK, good enough for me, although I don’t like enticing people to use APIs
that are slow when there’s a way that is 5 times faster. Maybe we should
warn folks about this in the asdoc?
-Alex
On 5/19/15, 2:25 PM, "Gareth Smith" <ga...@gmail.com> wrote:
>I have done some very unscientific tests: for each kind of list (Array,
>old ArrayList, new ArrayList, new ArrayList - using sugar) the test code
>creates a million-item array and then increments each value that it
>contains.
>
>This is how long each test takes:
>
>Array: 0.1 sec
>old ArrayList (get/set Item): 0.8 sec
>new ArrayList (get/set Item): 0.9 sec
>new ArrayList ([]): 5.6 sec
>
>In summary, indexing sugar is really slow, but get/set item don't seem
>to get much slower just by implementing Proxy.
>
>Gareth
>
>On 18/05/15 06:56, Alex Harui wrote:
>>
>> On 5/17/15, 9:22 AM, "Gareth Smith" <ga...@gmail.com> wrote:
>>
>>> I don't know about any performance impact.
>> Can you run a some of quick tests? Iterating on 1000 items via for-each
>> on an Array, via a loop on ArrayList.getItemAt() before your Proxy
>>change
>> and using [] and for-each on ArrayList after your new Proxy change?
>>
>> And maybe also try 5000 and 10000 items if you have time.
>>
>> Thanks,
>> -Alex
>>
>
Re: Why are there two ArrayList classes? [PING Justin Mclean)
Posted by Gareth Smith <ga...@gmail.com>.
I have done some very unscientific tests: for each kind of list (Array,
old ArrayList, new ArrayList, new ArrayList - using sugar) the test code
creates a million-item array and then increments each value that it
contains.
This is how long each test takes:
Array: 0.1 sec
old ArrayList (get/set Item): 0.8 sec
new ArrayList (get/set Item): 0.9 sec
new ArrayList ([]): 5.6 sec
In summary, indexing sugar is really slow, but get/set item don't seem
to get much slower just by implementing Proxy.
Gareth
On 18/05/15 06:56, Alex Harui wrote:
>
> On 5/17/15, 9:22 AM, "Gareth Smith" <ga...@gmail.com> wrote:
>
>> I don't know about any performance impact.
> Can you run a some of quick tests? Iterating on 1000 items via for-each
> on an Array, via a loop on ArrayList.getItemAt() before your Proxy change
> and using [] and for-each on ArrayList after your new Proxy change?
>
> And maybe also try 5000 and 10000 items if you have time.
>
> Thanks,
> -Alex
>
Re: Why are there two ArrayList classes? [PING Justin Mclean)
Posted by Alex Harui <ah...@adobe.com>.
On 5/17/15, 9:22 AM, "Gareth Smith" <ga...@gmail.com> wrote:
>
>I don't know about any performance impact.
Can you run a some of quick tests? Iterating on 1000 items via for-each
on an Array, via a loop on ArrayList.getItemAt() before your Proxy change
and using [] and for-each on ArrayList after your new Proxy change?
And maybe also try 5000 and 10000 items if you have time.
Thanks,
-Alex
Re: Why are there two ArrayList classes? [PING Justin Mclean)
Posted by Gareth Smith <ga...@gmail.com>.
On 17/05/15 15:29, Alex Harui wrote:
> I’m wondering why it isn’t sufficient for folks to iterate on
ArrayList.source?
It is sufficient, but not ideal.
The syntactic sugar that ArrayCollection gives you makes it more
pleasant to use, which (in my experience) means that people use
ArrayCollection where logically ArrayList makes sense - i.e. where
filters and sorts are not needed. In my experience this has lead to
confusion (and that has lead to bugs) due to uncertainty about whether
ArrayCollection is being used because that particular list might at some
point have filtering or sorting, or simply due to the nicer API.
I don't know about any performance impact.
Gareth
> BTW, thanks for working on this issue. I’m sorry I didn’t see this
> earlier, but having ArrayList now extend Proxy might result in performance
> degradation. Proxy has been very slow in my experience.
>
> I’m wondering why it isn’t sufficient for folks to iterate on
> ArrayList.source?
>
> -Alex
>
> On 5/16/15, 12:53 PM, "Harbs" <ha...@gmail.com> wrote:
>
>> This is the discussion that I was referring to:
>> http://apache-flex-development.2333347.n4.nabble.com/Re-1-4-git-commit-add
>> -removeItem-to-IList-and-ListCollectionView-tp23272.html
>>
>> On May 15, 2015, at 7:40 PM, Gareth Smith <ga...@gmail.com>
>> wrote:
>>
>>>> The discussion on this was in March 2013.
>>> This is it, I think:
>>>
>>>
>>> http://apache-flex-development.2333347.n4.nabble.com/ArrayList-itemUpdate
>>> Handler-Change-td7774.html
>>>
>>> It looks to me like the intention of the person who originally created
>>> the
>>> new ArrayList (Michael A. Labriola) was for it to be tested with the
>>> rest
>>> of the framework and then to replace the original ArrayList:
>>>
>>> "Well, first thing I think is that we make sure everything still
>>> internally
>>> works in the framework. At some point though we will likely need to
>>> document this and bit the bullet.
>>>
>>> As someone who has been intimate with the framework for years I can
>>> guarantee you that the order of events in something like combobox has
>>> basically changed every other versions since flex 2, so we have
>>> precedent
>>> :) "
>>>
>>> However, I think the simplest thing for me to do would be to patch both
>>> classes with the Proxy stuff. At least that way I will not be making the
>>> framework *more* confusing.
>>>
>>> Gareth
>>>
>>>
>>> On 14 May 2015 at 22:30, Harbs <ha...@gmail.com> wrote:
>>>
>>>> The discussion on this was in March 2013.
>>>>
>>>> On May 14, 2015, at 11:03 PM, Alex Harui <ah...@adobe.com> wrote:
>>>>
>>>>> I just looked quickly at the differences. It appears that the second
>>>>> ArrayList has different update event logic so it may be that it was
>>>>> safer
>>>>> to create a different ArrayList so we wouldn’t have to worry about
>>>>> backward compatibility issues.
>>>>>
>>>>> -Alex
>>>>>
>>>>> On 5/13/15, 2:31 PM, "Gareth Smith" <ga...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> It looks like the second ArrayList was introduced by Justin Mclean in
>>>>>> this commit:
>>>>>>
>>>>>>
>>>> https://github.com/apache/flex-sdk/commit/621e4debe8cd46e9ec5a197256dc2b
>>>> 6e
>>>>>> 32fc47c3
>>>>>>
>>>>>> I can't figure out why it was included though. Justin?
>>>>>>
>>>>>> Thanks
>>>>>> Gareth
>>>>>>
>>>>>> On 10/05/15 11:29, Gareth Smith wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I am putting together a patch for ArrayList to support
>>>>>>> square-bracket
>>>>>>> indexing and for-each loops, see:
>>>>>>> https://issues.apache.org/jira/browse/FLEX-15159
>>>>>>>
>>>>>>> I am confused by the existence of not one, but two ArrayList
>>>>>>> classes:
>>>>>>> the "original" one at mx.collections.ArrayList and another one at
>>>>>>> org.apache.flex.collections.ArrayList.
>>>>>>>
>>>>>>> Why are there two classes? Looking at their diff, I would guess that
>>>>>>> mx.collections.ArrayList is newer: it has some additional
>>>>>>> optimisations, and an additional toJSON() method.
>>>>>>>
>>>>>>> I could patch both classes, but I would rather not introduce more
>>>>>>> duplication that might become a maintenance burden along the line.
>>>>>>>
>>>>>>> Thanks
>>>>>>> Gareth
>>>>
Re: Why are there two ArrayList classes? [PING Justin Mclean)
Posted by Alex Harui <ah...@adobe.com>.
BTW, thanks for working on this issue. I’m sorry I didn’t see this
earlier, but having ArrayList now extend Proxy might result in performance
degradation. Proxy has been very slow in my experience.
I’m wondering why it isn’t sufficient for folks to iterate on
ArrayList.source?
-Alex
On 5/16/15, 12:53 PM, "Harbs" <ha...@gmail.com> wrote:
>This is the discussion that I was referring to:
>http://apache-flex-development.2333347.n4.nabble.com/Re-1-4-git-commit-add
>-removeItem-to-IList-and-ListCollectionView-tp23272.html
>
>On May 15, 2015, at 7:40 PM, Gareth Smith <ga...@gmail.com>
>wrote:
>
>>> The discussion on this was in March 2013.
>>
>> This is it, I think:
>>
>>
>>http://apache-flex-development.2333347.n4.nabble.com/ArrayList-itemUpdate
>>Handler-Change-td7774.html
>>
>> It looks to me like the intention of the person who originally created
>>the
>> new ArrayList (Michael A. Labriola) was for it to be tested with the
>>rest
>> of the framework and then to replace the original ArrayList:
>>
>> "Well, first thing I think is that we make sure everything still
>>internally
>> works in the framework. At some point though we will likely need to
>> document this and bit the bullet.
>>
>> As someone who has been intimate with the framework for years I can
>> guarantee you that the order of events in something like combobox has
>> basically changed every other versions since flex 2, so we have
>>precedent
>> :) "
>>
>> However, I think the simplest thing for me to do would be to patch both
>> classes with the Proxy stuff. At least that way I will not be making the
>> framework *more* confusing.
>>
>> Gareth
>>
>>
>> On 14 May 2015 at 22:30, Harbs <ha...@gmail.com> wrote:
>>
>>> The discussion on this was in March 2013.
>>>
>>> On May 14, 2015, at 11:03 PM, Alex Harui <ah...@adobe.com> wrote:
>>>
>>>> I just looked quickly at the differences. It appears that the second
>>>> ArrayList has different update event logic so it may be that it was
>>>>safer
>>>> to create a different ArrayList so we wouldn’t have to worry about
>>>> backward compatibility issues.
>>>>
>>>> -Alex
>>>>
>>>> On 5/13/15, 2:31 PM, "Gareth Smith" <ga...@gmail.com>
>>>>wrote:
>>>>
>>>>> It looks like the second ArrayList was introduced by Justin Mclean in
>>>>> this commit:
>>>>>
>>>>>
>>>
>>>https://github.com/apache/flex-sdk/commit/621e4debe8cd46e9ec5a197256dc2b
>>>6e
>>>>> 32fc47c3
>>>>>
>>>>> I can't figure out why it was included though. Justin?
>>>>>
>>>>> Thanks
>>>>> Gareth
>>>>>
>>>>> On 10/05/15 11:29, Gareth Smith wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I am putting together a patch for ArrayList to support
>>>>>>square-bracket
>>>>>> indexing and for-each loops, see:
>>>>>> https://issues.apache.org/jira/browse/FLEX-15159
>>>>>>
>>>>>> I am confused by the existence of not one, but two ArrayList
>>>>>>classes:
>>>>>> the "original" one at mx.collections.ArrayList and another one at
>>>>>> org.apache.flex.collections.ArrayList.
>>>>>>
>>>>>> Why are there two classes? Looking at their diff, I would guess that
>>>>>> mx.collections.ArrayList is newer: it has some additional
>>>>>> optimisations, and an additional toJSON() method.
>>>>>>
>>>>>> I could patch both classes, but I would rather not introduce more
>>>>>> duplication that might become a maintenance burden along the line.
>>>>>>
>>>>>> Thanks
>>>>>> Gareth
>>>>>
>>>>
>>>
>>>
>
Re: Why are there two ArrayList classes? [PING Justin Mclean)
Posted by Harbs <ha...@gmail.com>.
This is the discussion that I was referring to:
http://apache-flex-development.2333347.n4.nabble.com/Re-1-4-git-commit-add-removeItem-to-IList-and-ListCollectionView-tp23272.html
On May 15, 2015, at 7:40 PM, Gareth Smith <ga...@gmail.com> wrote:
>> The discussion on this was in March 2013.
>
> This is it, I think:
>
> http://apache-flex-development.2333347.n4.nabble.com/ArrayList-itemUpdateHandler-Change-td7774.html
>
> It looks to me like the intention of the person who originally created the
> new ArrayList (Michael A. Labriola) was for it to be tested with the rest
> of the framework and then to replace the original ArrayList:
>
> "Well, first thing I think is that we make sure everything still internally
> works in the framework. At some point though we will likely need to
> document this and bit the bullet.
>
> As someone who has been intimate with the framework for years I can
> guarantee you that the order of events in something like combobox has
> basically changed every other versions since flex 2, so we have precedent
> :) "
>
> However, I think the simplest thing for me to do would be to patch both
> classes with the Proxy stuff. At least that way I will not be making the
> framework *more* confusing.
>
> Gareth
>
>
> On 14 May 2015 at 22:30, Harbs <ha...@gmail.com> wrote:
>
>> The discussion on this was in March 2013.
>>
>> On May 14, 2015, at 11:03 PM, Alex Harui <ah...@adobe.com> wrote:
>>
>>> I just looked quickly at the differences. It appears that the second
>>> ArrayList has different update event logic so it may be that it was safer
>>> to create a different ArrayList so we wouldn’t have to worry about
>>> backward compatibility issues.
>>>
>>> -Alex
>>>
>>> On 5/13/15, 2:31 PM, "Gareth Smith" <ga...@gmail.com> wrote:
>>>
>>>> It looks like the second ArrayList was introduced by Justin Mclean in
>>>> this commit:
>>>>
>>>>
>> https://github.com/apache/flex-sdk/commit/621e4debe8cd46e9ec5a197256dc2b6e
>>>> 32fc47c3
>>>>
>>>> I can't figure out why it was included though. Justin?
>>>>
>>>> Thanks
>>>> Gareth
>>>>
>>>> On 10/05/15 11:29, Gareth Smith wrote:
>>>>> Hi,
>>>>>
>>>>> I am putting together a patch for ArrayList to support square-bracket
>>>>> indexing and for-each loops, see:
>>>>> https://issues.apache.org/jira/browse/FLEX-15159
>>>>>
>>>>> I am confused by the existence of not one, but two ArrayList classes:
>>>>> the "original" one at mx.collections.ArrayList and another one at
>>>>> org.apache.flex.collections.ArrayList.
>>>>>
>>>>> Why are there two classes? Looking at their diff, I would guess that
>>>>> mx.collections.ArrayList is newer: it has some additional
>>>>> optimisations, and an additional toJSON() method.
>>>>>
>>>>> I could patch both classes, but I would rather not introduce more
>>>>> duplication that might become a maintenance burden along the line.
>>>>>
>>>>> Thanks
>>>>> Gareth
>>>>
>>>
>>
>>
Re: Why are there two ArrayList classes? [PING Justin Mclean)
Posted by Gareth Smith <ga...@gmail.com>.
> The discussion on this was in March 2013.
This is it, I think:
http://apache-flex-development.2333347.n4.nabble.com/ArrayList-itemUpdateHandler-Change-td7774.html
It looks to me like the intention of the person who originally created the
new ArrayList (Michael A. Labriola) was for it to be tested with the rest
of the framework and then to replace the original ArrayList:
"Well, first thing I think is that we make sure everything still internally
works in the framework. At some point though we will likely need to
document this and bit the bullet.
As someone who has been intimate with the framework for years I can
guarantee you that the order of events in something like combobox has
basically changed every other versions since flex 2, so we have precedent
:) "
However, I think the simplest thing for me to do would be to patch both
classes with the Proxy stuff. At least that way I will not be making the
framework *more* confusing.
Gareth
On 14 May 2015 at 22:30, Harbs <ha...@gmail.com> wrote:
> The discussion on this was in March 2013.
>
> On May 14, 2015, at 11:03 PM, Alex Harui <ah...@adobe.com> wrote:
>
> > I just looked quickly at the differences. It appears that the second
> > ArrayList has different update event logic so it may be that it was safer
> > to create a different ArrayList so we wouldn’t have to worry about
> > backward compatibility issues.
> >
> > -Alex
> >
> > On 5/13/15, 2:31 PM, "Gareth Smith" <ga...@gmail.com> wrote:
> >
> >> It looks like the second ArrayList was introduced by Justin Mclean in
> >> this commit:
> >>
> >>
> https://github.com/apache/flex-sdk/commit/621e4debe8cd46e9ec5a197256dc2b6e
> >> 32fc47c3
> >>
> >> I can't figure out why it was included though. Justin?
> >>
> >> Thanks
> >> Gareth
> >>
> >> On 10/05/15 11:29, Gareth Smith wrote:
> >>> Hi,
> >>>
> >>> I am putting together a patch for ArrayList to support square-bracket
> >>> indexing and for-each loops, see:
> >>> https://issues.apache.org/jira/browse/FLEX-15159
> >>>
> >>> I am confused by the existence of not one, but two ArrayList classes:
> >>> the "original" one at mx.collections.ArrayList and another one at
> >>> org.apache.flex.collections.ArrayList.
> >>>
> >>> Why are there two classes? Looking at their diff, I would guess that
> >>> mx.collections.ArrayList is newer: it has some additional
> >>> optimisations, and an additional toJSON() method.
> >>>
> >>> I could patch both classes, but I would rather not introduce more
> >>> duplication that might become a maintenance burden along the line.
> >>>
> >>> Thanks
> >>> Gareth
> >>
> >
>
>
Re: Why are there two ArrayList classes? [PING Justin Mclean)
Posted by Harbs <ha...@gmail.com>.
The discussion on this was in March 2013.
On May 14, 2015, at 11:03 PM, Alex Harui <ah...@adobe.com> wrote:
> I just looked quickly at the differences. It appears that the second
> ArrayList has different update event logic so it may be that it was safer
> to create a different ArrayList so we wouldn’t have to worry about
> backward compatibility issues.
>
> -Alex
>
> On 5/13/15, 2:31 PM, "Gareth Smith" <ga...@gmail.com> wrote:
>
>> It looks like the second ArrayList was introduced by Justin Mclean in
>> this commit:
>>
>> https://github.com/apache/flex-sdk/commit/621e4debe8cd46e9ec5a197256dc2b6e
>> 32fc47c3
>>
>> I can't figure out why it was included though. Justin?
>>
>> Thanks
>> Gareth
>>
>> On 10/05/15 11:29, Gareth Smith wrote:
>>> Hi,
>>>
>>> I am putting together a patch for ArrayList to support square-bracket
>>> indexing and for-each loops, see:
>>> https://issues.apache.org/jira/browse/FLEX-15159
>>>
>>> I am confused by the existence of not one, but two ArrayList classes:
>>> the "original" one at mx.collections.ArrayList and another one at
>>> org.apache.flex.collections.ArrayList.
>>>
>>> Why are there two classes? Looking at their diff, I would guess that
>>> mx.collections.ArrayList is newer: it has some additional
>>> optimisations, and an additional toJSON() method.
>>>
>>> I could patch both classes, but I would rather not introduce more
>>> duplication that might become a maintenance burden along the line.
>>>
>>> Thanks
>>> Gareth
>>
>
Re: Why are there two ArrayList classes? [PING Justin Mclean)
Posted by Alex Harui <ah...@adobe.com>.
I just looked quickly at the differences. It appears that the second
ArrayList has different update event logic so it may be that it was safer
to create a different ArrayList so we wouldn’t have to worry about
backward compatibility issues.
-Alex
On 5/13/15, 2:31 PM, "Gareth Smith" <ga...@gmail.com> wrote:
>It looks like the second ArrayList was introduced by Justin Mclean in
>this commit:
>
>https://github.com/apache/flex-sdk/commit/621e4debe8cd46e9ec5a197256dc2b6e
>32fc47c3
>
>I can't figure out why it was included though. Justin?
>
>Thanks
>Gareth
>
>On 10/05/15 11:29, Gareth Smith wrote:
>> Hi,
>>
>> I am putting together a patch for ArrayList to support square-bracket
>> indexing and for-each loops, see:
>> https://issues.apache.org/jira/browse/FLEX-15159
>>
>> I am confused by the existence of not one, but two ArrayList classes:
>> the "original" one at mx.collections.ArrayList and another one at
>> org.apache.flex.collections.ArrayList.
>>
>> Why are there two classes? Looking at their diff, I would guess that
>> mx.collections.ArrayList is newer: it has some additional
>> optimisations, and an additional toJSON() method.
>>
>> I could patch both classes, but I would rather not introduce more
>> duplication that might become a maintenance burden along the line.
>>
>> Thanks
>> Gareth
>
Re: Why are there two ArrayList classes? [PING Justin Mclean)
Posted by Gareth Smith <ga...@gmail.com>.
It looks like the second ArrayList was introduced by Justin Mclean in
this commit:
https://github.com/apache/flex-sdk/commit/621e4debe8cd46e9ec5a197256dc2b6e32fc47c3
I can't figure out why it was included though. Justin?
Thanks
Gareth
On 10/05/15 11:29, Gareth Smith wrote:
> Hi,
>
> I am putting together a patch for ArrayList to support square-bracket
> indexing and for-each loops, see:
> https://issues.apache.org/jira/browse/FLEX-15159
>
> I am confused by the existence of not one, but two ArrayList classes:
> the "original" one at mx.collections.ArrayList and another one at
> org.apache.flex.collections.ArrayList.
>
> Why are there two classes? Looking at their diff, I would guess that
> mx.collections.ArrayList is newer: it has some additional
> optimisations, and an additional toJSON() method.
>
> I could patch both classes, but I would rather not introduce more
> duplication that might become a maintenance burden along the line.
>
> Thanks
> Gareth