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

View: New views
5 Messages — Rating Filter:   Alert me  

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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Serialization of array cia 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: Dan Jemiolo
            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@...
For additional commands, e-mail: muse-dev-help@...


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Bogdan Solomon updated MUSE-265:
--------------------------------

    Summary: Serialization of array via SimpleNotificationProducer sends only the last element in the array  (was: Serialization of array cia SimpleNotificationProducer sends only the last element in the array)

> 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: Dan Jemiolo
>            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@...
For additional commands, e-mail: muse-dev-help@...


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ 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@...
For additional commands, e-mail: muse-dev-help@...


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/MUSE-265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12656617#action_12656617 ]

Chris Twiner commented on MUSE-265:
-----------------------------------

lhm to lhm->list.  If there is no value, add a new arraylist with one element, otherwise add it in.

> 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: Dan Jemiolo
>            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@...
For additional commands, e-mail: muse-dev-help@...


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ 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@...
For additional commands, e-mail: muse-dev-help@...