[jboss-jira] [JBoss JIRA] (JGRP-1502) NAKACK / NAKACK2: modifying header of copy can still lead to side effects

Bela Ban (JIRA) jira-events at lists.jboss.org
Thu Aug 16 09:52:14 EDT 2012


     [ https://issues.jboss.org/browse/JGRP-1502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bela Ban resolved JGRP-1502.
----------------------------

    Resolution: Done


Copying NakackHeader now and calling Message.putHeader()
                
> NAKACK / NAKACK2: modifying header of copy can still lead to side effects
> -------------------------------------------------------------------------
>
>                 Key: JGRP-1502
>                 URL: https://issues.jboss.org/browse/JGRP-1502
>             Project: JGroups
>          Issue Type: Bug
>            Reporter: Bela Ban
>            Assignee: Bela Ban
>             Fix For: 3.0.12, 3.2
>
>
> NAKACK and NAKACK2 copy a message (e.g. for retransmission) and then modify the NakackHeader of the copy *in place*. However, as Message.copy() does *not* copy the headers themselves, only the array holding the references to the headers, the modification of NakackHeader will also modify the original message !
> SOLUTION:
> Create a new header off of the exitsing header and call Message.putHeader(), overwriting the old header. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list