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

Chris Twiner reassigned MUSE-285:
---------------------------------

    Assignee: Chris Twiner  (was: Dan Jemiolo)

> 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.3.0
>
>
> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to