[prev in list] [next in list] [prev in thread] [next in thread] 

List:       muse-dev
Subject:    [jira] Resolved: (MUSE-265) Serialization of array via
From:       "Chris Twiner (JIRA)" <jira () apache ! org>
Date:       2009-01-03 17:21:44
Message-ID: 1515303112.1231003304331.JavaMail.jira () brutus
[Download RAW message or body]


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

Chris Twiner resolved MUSE-265.
-------------------------------

    Resolution: Fixed

in head

> 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
> Fix For: 2.2.1
> 
> 
> 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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic