[ http://jira.jboss.com/jira/browse/JBJMX-81?page=comments#action_12314547 
]
     
Adrian Brock commented on JBJMX-81:
-----------------------------------

Didn't you already fix this Scott?

> javax.management.monitor.Monitor.getObservedObjects() throws
> ------------------------------------------------------------
>
>          Key: JBJMX-81
>          URL: http://jira.jboss.com/jira/browse/JBJMX-81
>      Project: JBoss JMX
>         Type: Bug
>     Reporter: SourceForge User
>     Assignee: Adrian Brock

>
>
> SourceForge Submitter: ctday .
> When I try to access a StringMonitor MBean through 
> jmx-console, I get a ClassCastException from 
> javax.management.monitor.Monitor.getObservedObjects
> (). The code in the HEAD of CVS reads:
>    public ObjectName[] getObservedObjects()
>    {
>       Set set = new HashSet(observedObjects.keySet());
>       elementCount = set.size();
>       ObjectName[] result = new ObjectName[set.size()];
>       alreadyNotifieds = new int[set.size()];
>       int count = 0;
>       for (Iterator i = set.iterator(); i.hasNext();)
>       {
>          ObservedObject object = (ObservedObject) i.next
> ();
>          result[count] = object.getObjectName();
>          alreadyNotifieds[count++] = 
> object.getAlreadyNotified();
>       }
>       return result;
>    }
> The Exception is raised from the (ObservedObject) 
> i.next, which is an ObjectName, not an ObservedObject.
> The error appears to be in the initialization of set. The 
> keySet of the observedObjects HashMap is being used, 
> which is a set of ObjectNames, rather than the valueSet 
> of observedObjects, which is a set of ObservedObjects.
> The code has been this way since at least 3.2.5.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.jboss.com/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to