ws-muse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eitan Plotnik (JIRA)" <j...@apache.org>
Subject [jira] Created: (MUSE-285) ArrayIndexOutOfBoundsException when SimpleResourceManager.getListeners() performs new LinkedList(_listeners);
Date Sun, 13 Apr 2008 14:49:04 GMT
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: Dan Jemiolo


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


Mime
View raw message