[
https://java.net/jira/browse/GLAZEDLISTS-603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=394305#comment-394305 ]
brands commented on GLAZEDLISTS-603:
------------------------------------
The changes in UndoRedoSupport and WeakReferenceMatcherEditor should also be reviewed with respect to this issue.
> 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)