You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-dev@ws.apache.org by "Chris Twiner (JIRA)" <ji...@apache.org> on 2009/01/03 17:33:44 UTC

[jira] Resolved: (MUSE-285) ArrayIndexOutOfBoundsException when SimpleResourceManager.getListeners() performs new LinkedList(_listeners);

     [ https://issues.apache.org/jira/browse/MUSE-285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Twiner resolved MUSE-285.
-------------------------------

    Resolution: Fixed

in head

> ArrayIndexOutOfBoundsException when SimpleResourceManager.getListeners() performs new LinkedList(_listeners);
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: MUSE-285
>                 URL: https://issues.apache.org/jira/browse/MUSE-285
>             Project: Muse
>          Issue Type: Bug
>          Components: Core Engine - Resource and Capability APIs
>    Affects Versions: 2.2.0
>         Environment: any
>            Reporter: Eitan Plotnik
>            Assignee: Chris Twiner
>             Fix For: 2.2.1
>
>
> SimpleResourceManager.getListeners() invokes new LinkedList(_listeners) which in turn calls toArray() on the _listners linked list in the argument.
> The toArray() throws ArrayIndexOutOfBoundsException in case objects were added to _listeners while it's in progress.
> addListener() and removeListener() are synchronized methods. I think so should be getListeners().
> I think getListeners() signature should be modified 
> from: protected List getListeners()
> to: protected synchronized List getListeners()
> Stack trace:
>       java.lang.ArrayIndexOutOfBoundsException: 1606
>       	at java.util.LinkedList.toArray(LinkedList.java:694)
>       	at java.util.LinkedList.addAll(LinkedList.java:265)
>       	at java.util.LinkedList.addAll(LinkedList.java:242)
>       	at java.util.LinkedList.<init>(LinkedList.java:98)
>       	at org.apache.muse.core.SimpleResourceManager.getListeners(SimpleResourceManager.java:223)
>       	at org.apache.muse.core.SimpleResourceManager.addResource(SimpleResourceManager.java:107)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org