[JIRA] (GLAZEDLISTS-576) ListEvent blocks mostly useless due to get*Value() methods

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[JIRA] (GLAZEDLISTS-576) ListEvent blocks mostly useless due to get*Value() methods

JIRA jira-no-reply@java.net
reden created GLAZEDLISTS-576:
---------------------------------

             Summary: ListEvent blocks mostly useless due to get*Value() methods
                 Key: GLAZEDLISTS-576
                 URL: https://java.net/jira/browse/GLAZEDLISTS-576
             Project: glazedlists
          Issue Type: Bug
          Components: core
    Affects Versions: 1.9.1
            Reporter: reden
            Assignee: jessewilson
            Priority: Critical


ListEvent blocks are no longer useful unless a list contains contiguous duplicate values. This is due to logic in BlockSequence.addChange(int,int,int,E,E):
{code:java}
        // concatenate this change on to the previous one
        } else if(lastChangedIndex == startIndex && lastType == type && oldValue == lastOldValue && newValue == lastNewValue) {
{code}
Now the values must match in addition to the index (i.e., contiguous change) in order for an event to be concatenated.

The result of the this that...:
{code:java}
EventList<Integer> list = new BasicEventList();
for( int i = 0; i < 10000; i++ ) {
    list.add( Integer.valueOf( i ) );
}
list.clear();
{code}
... the clear() will cause 10,000 events to be fired, which is obviously a huge performance hit in places where event handling is expensive.



--
This message was sent by Atlassian JIRA
(v6.2.3#6260)