Quantcast

[JIRA] (GLAZEDLISTS-603) Potential regression because of GLAZEDLISTS-592 in AbstractMatcherEditorListenerSupport

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

[JIRA] (GLAZEDLISTS-603) Potential regression because of GLAZEDLISTS-592 in AbstractMatcherEditorListenerSupport

JIRA jira-no-reply@java.net
brands created GLAZEDLISTS-603:
----------------------------------

             Summary: Potential regression because of GLAZEDLISTS-592 in AbstractMatcherEditorListenerSupport
                 Key: GLAZEDLISTS-603
                 URL: https://java.net/jira/browse/GLAZEDLISTS-603
             Project: glazedlists
          Issue Type: Bug
          Components: core
    Affects Versions: 1.10.0
            Reporter: brands
            Assignee: brands
             Fix For: 1.10.0


In GLAZEDLISTS-592 AbstractMatcherEditorListenerSupport was changed to use a simple ArrayList instead of EventListenerList.

But in the context of ThreadedMatcherEditor, it's a concurrent scenario:

addMatcherEditorListener / removeMatcherEditorListener is called by the thread which creates / disposes the FilterList.
fireChangedMatcher is called by the "MatcherQueueThread" of ThreadedMatcherEditor.

As the current code isn't thread-safe, this can lead to exceptions like:

java.lang.NullPointerException
    at ca.odell.glazedlists.matchers.AbstractMatcherEditorListenerSupport.fireChangedMatcher(AbstractMatcherEditorListenerSupport.java:45)
    at ca.odell.glazedlists.matchers.ThreadedMatcherEditor$DrainMatcherEventQueueRunnable.run(ThreadedMatcherEditor.java:249)
    at java.lang.Thread.run(Unknown Source)

The listener handling code in AbstractMatcherEditorListenerSupport should be made thread-safe, for example by using CopyOnWriteArrayList.




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