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 2008/12/15 14:03:44 UTC

[jira] Assigned: (MUSE-265) Serialization of array via SimpleNotificationProducer sends only the last element in the array

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

Chris Twiner reassigned MUSE-265:
---------------------------------

    Assignee: Chris Twiner  (was: Dan Jemiolo)

> Serialization of array via SimpleNotificationProducer sends only the last element in the array
> ----------------------------------------------------------------------------------------------
>
>                 Key: MUSE-265
>                 URL: https://issues.apache.org/jira/browse/MUSE-265
>             Project: Muse
>          Issue Type: Bug
>          Components: WSN NotificationProducer
>    Affects Versions: 2.2.0
>            Reporter: Bogdan Solomon
>            Assignee: Chris Twiner
>            Priority: Minor
>
> The problem is the way the NotificationMessage stores the elements.
> The SimpleNotificationProducer publish array method does the following for arrays, where content is the array (of either XmlSerializable or Elements):
> NotificationMessage message = createNotificationMessage();
>        
> for (int n = 0; n < content.length; ++n)
>      message.addMessageContent(content[n]);
> and in SimpleNotificationMessage
> the addMessageContent does the following:
> if (content == null)
>      throw new NullPointerException(_MESSAGES.get("NullMessageContent"));
> QName name = XmlUtils.getElementQName(content);
> _messageContent.put(name, content);
> but _messageContent is a LinkedHashMap, and from what the Java specification says adding multiple instances with the same key overwrites the values. So only the last one will be preserved. If all the Array elements have the same QName (which they should as they pass through the same serializer) then only the last is stored.
> I have solved the issue for the moment by wrapping the Elements that represent the array in another top level element that gets published. 

-- 
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