You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "joel truher (JIRA)" <ji...@apache.org> on 2008/11/14 07:22:44 UTC

[jira] Created: (SCXML-89) Assign.execute() doesn't remove all children of oldNode (includes fix)

Assign.execute() doesn't remove all children of oldNode (includes fix)
----------------------------------------------------------------------

                 Key: SCXML-89
                 URL: https://issues.apache.org/jira/browse/SCXML-89
             Project: Commons SCXML
          Issue Type: Bug
    Affects Versions: 0.8
         Environment: Ubuntu 7.10 (64 bit), JRE ia32-java6-sun-1.6.0.03
            Reporter: joel truher


This code, from Assign.execute(), seems to remove the oldNode child and *then* ask for its next sibling, which returns null.  The result is to remove the first child, but leave the other children around, so that the result of "Assign" is a concatenation of all-but-one of the old nodes, followed by the new nodes.

{quote}
for (Node child = oldNode.getFirstChild();
   child != null;
   child = child.getNextSibling()) {
   oldNode.removeChild(child);
}
{quote}

This (modified) code finds the next sibling before removal and produces the expected result.

{quote}
for (Node child = oldNode.getFirstChild(); child != null;) {
   Node nextChild = child.getNextSibling();
   oldNode.removeChild(child);
   child = nextChild;
}
{quote}

I can supply a test case if that would be helpful.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SCXML-89) Assign.execute() doesn't remove all children of oldNode (includes fix)

Posted by "joel truher (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SCXML-89?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

joel truher updated SCXML-89:
-----------------------------

    Attachment: jira-89.diff

Here's a patch with the fix and the test case.

> Assign.execute() doesn't remove all children of oldNode (includes fix)
> ----------------------------------------------------------------------
>
>                 Key: SCXML-89
>                 URL: https://issues.apache.org/jira/browse/SCXML-89
>             Project: Commons SCXML
>          Issue Type: Bug
>    Affects Versions: 0.8
>         Environment: Ubuntu 7.10 (64 bit), JRE ia32-java6-sun-1.6.0.03
>            Reporter: joel truher
>             Fix For: 0.9
>
>         Attachments: jira-89.diff
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> This code, from Assign.execute(), seems to remove the oldNode child and *then* ask for its next sibling, which returns null.  The result is to remove the first child, but leave the other children around, so that the result of "Assign" is a concatenation of all-but-one of the old nodes, followed by the new nodes.
> {noformat}
> for (Node child = oldNode.getFirstChild();
>    child != null;
>    child = child.getNextSibling()) {
>    oldNode.removeChild(child);
> }
> {noformat}
> This (modified) code finds the next sibling before removal and produces the expected result.
> {noformat}
> for (Node child = oldNode.getFirstChild(); child != null;) {
>    Node nextChild = child.getNextSibling();
>    oldNode.removeChild(child);
>    child = nextChild;
> }
> {noformat}
> I can supply a test case if that would be helpful.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SCXML-89) Assign.execute() doesn't remove all children of oldNode (includes fix)

Posted by "Rahul Akolkar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SCXML-89?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rahul Akolkar resolved SCXML-89.
--------------------------------

    Resolution: Fixed

A variant of the patch has been applied to trunk and I've added you to the list of contributors in r714191:

  http://svn.apache.org/viewvc?view=rev&revision=714191

If possible, please build the latest trunk and verify the fix.

For patches, please provide the output of 'svn diff' in a working copy of trunk (those are easier to apply). Thanks for this test case and patch.


> Assign.execute() doesn't remove all children of oldNode (includes fix)
> ----------------------------------------------------------------------
>
>                 Key: SCXML-89
>                 URL: https://issues.apache.org/jira/browse/SCXML-89
>             Project: Commons SCXML
>          Issue Type: Bug
>    Affects Versions: 0.8
>         Environment: Ubuntu 7.10 (64 bit), JRE ia32-java6-sun-1.6.0.03
>            Reporter: joel truher
>             Fix For: 0.9
>
>         Attachments: jira-89.diff
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> This code, from Assign.execute(), seems to remove the oldNode child and *then* ask for its next sibling, which returns null.  The result is to remove the first child, but leave the other children around, so that the result of "Assign" is a concatenation of all-but-one of the old nodes, followed by the new nodes.
> {noformat}
> for (Node child = oldNode.getFirstChild();
>    child != null;
>    child = child.getNextSibling()) {
>    oldNode.removeChild(child);
> }
> {noformat}
> This (modified) code finds the next sibling before removal and produces the expected result.
> {noformat}
> for (Node child = oldNode.getFirstChild(); child != null;) {
>    Node nextChild = child.getNextSibling();
>    oldNode.removeChild(child);
>    child = nextChild;
> }
> {noformat}
> I can supply a test case if that would be helpful.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SCXML-89) Assign.execute() doesn't remove all children of oldNode (includes fix)

Posted by "joel truher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SCXML-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647767#action_12647767 ] 

joel truher commented on SCXML-89:
----------------------------------

verified on the trunk (svn 714196, last change 714191 Fri Nov 14 15:43:16 PST).  also ran a somewhat more extensive test within my app which independently verifies.

thanks for the tips on diffs; i wasn't thinking about it.

> Assign.execute() doesn't remove all children of oldNode (includes fix)
> ----------------------------------------------------------------------
>
>                 Key: SCXML-89
>                 URL: https://issues.apache.org/jira/browse/SCXML-89
>             Project: Commons SCXML
>          Issue Type: Bug
>    Affects Versions: 0.8
>         Environment: Ubuntu 7.10 (64 bit), JRE ia32-java6-sun-1.6.0.03
>            Reporter: joel truher
>             Fix For: 0.9
>
>         Attachments: jira-89.diff
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> This code, from Assign.execute(), seems to remove the oldNode child and *then* ask for its next sibling, which returns null.  The result is to remove the first child, but leave the other children around, so that the result of "Assign" is a concatenation of all-but-one of the old nodes, followed by the new nodes.
> {noformat}
> for (Node child = oldNode.getFirstChild();
>    child != null;
>    child = child.getNextSibling()) {
>    oldNode.removeChild(child);
> }
> {noformat}
> This (modified) code finds the next sibling before removal and produces the expected result.
> {noformat}
> for (Node child = oldNode.getFirstChild(); child != null;) {
>    Node nextChild = child.getNextSibling();
>    oldNode.removeChild(child);
>    child = nextChild;
> }
> {noformat}
> I can supply a test case if that would be helpful.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SCXML-89) Assign.execute() doesn't remove all children of oldNode (includes fix)

Posted by "joel truher (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SCXML-89?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

joel truher updated SCXML-89:
-----------------------------

    Description: 
This code, from Assign.execute(), seems to remove the oldNode child and *then* ask for its next sibling, which returns null.  The result is to remove the first child, but leave the other children around, so that the result of "Assign" is a concatenation of all-but-one of the old nodes, followed by the new nodes.

{noformat}
for (Node child = oldNode.getFirstChild();
   child != null;
   child = child.getNextSibling()) {
   oldNode.removeChild(child);
}
{noformat}

This (modified) code finds the next sibling before removal and produces the expected result.

{noformat}
for (Node child = oldNode.getFirstChild(); child != null;) {
   Node nextChild = child.getNextSibling();
   oldNode.removeChild(child);
   child = nextChild;
}
{noformat}

I can supply a test case if that would be helpful.

  was:
This code, from Assign.execute(), seems to remove the oldNode child and *then* ask for its next sibling, which returns null.  The result is to remove the first child, but leave the other children around, so that the result of "Assign" is a concatenation of all-but-one of the old nodes, followed by the new nodes.

{quote}
for (Node child = oldNode.getFirstChild();
   child != null;
   child = child.getNextSibling()) {
   oldNode.removeChild(child);
}
{quote}

This (modified) code finds the next sibling before removal and produces the expected result.

{quote}
for (Node child = oldNode.getFirstChild(); child != null;) {
   Node nextChild = child.getNextSibling();
   oldNode.removeChild(child);
   child = nextChild;
}
{quote}

I can supply a test case if that would be helpful.


> Assign.execute() doesn't remove all children of oldNode (includes fix)
> ----------------------------------------------------------------------
>
>                 Key: SCXML-89
>                 URL: https://issues.apache.org/jira/browse/SCXML-89
>             Project: Commons SCXML
>          Issue Type: Bug
>    Affects Versions: 0.8
>         Environment: Ubuntu 7.10 (64 bit), JRE ia32-java6-sun-1.6.0.03
>            Reporter: joel truher
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> This code, from Assign.execute(), seems to remove the oldNode child and *then* ask for its next sibling, which returns null.  The result is to remove the first child, but leave the other children around, so that the result of "Assign" is a concatenation of all-but-one of the old nodes, followed by the new nodes.
> {noformat}
> for (Node child = oldNode.getFirstChild();
>    child != null;
>    child = child.getNextSibling()) {
>    oldNode.removeChild(child);
> }
> {noformat}
> This (modified) code finds the next sibling before removal and produces the expected result.
> {noformat}
> for (Node child = oldNode.getFirstChild(); child != null;) {
>    Node nextChild = child.getNextSibling();
>    oldNode.removeChild(child);
>    child = nextChild;
> }
> {noformat}
> I can supply a test case if that would be helpful.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SCXML-89) Assign.execute() doesn't remove all children of oldNode (includes fix)

Posted by "Rahul Akolkar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SCXML-89?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rahul Akolkar updated SCXML-89:
-------------------------------

    Fix Version/s: 0.9

Yup, needs fixing, setting fix version to v0.9 (next release). It will indeed be quite helpful if you can attach a patch [1] with an appropriate JUnit test case added to the existing test suite [2]. Thanks.

[1] http://commons.apache.org/patches.html
[2] http://commons.apache.org/scxml/junit-report.html


> Assign.execute() doesn't remove all children of oldNode (includes fix)
> ----------------------------------------------------------------------
>
>                 Key: SCXML-89
>                 URL: https://issues.apache.org/jira/browse/SCXML-89
>             Project: Commons SCXML
>          Issue Type: Bug
>    Affects Versions: 0.8
>         Environment: Ubuntu 7.10 (64 bit), JRE ia32-java6-sun-1.6.0.03
>            Reporter: joel truher
>             Fix For: 0.9
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> This code, from Assign.execute(), seems to remove the oldNode child and *then* ask for its next sibling, which returns null.  The result is to remove the first child, but leave the other children around, so that the result of "Assign" is a concatenation of all-but-one of the old nodes, followed by the new nodes.
> {noformat}
> for (Node child = oldNode.getFirstChild();
>    child != null;
>    child = child.getNextSibling()) {
>    oldNode.removeChild(child);
> }
> {noformat}
> This (modified) code finds the next sibling before removal and produces the expected result.
> {noformat}
> for (Node child = oldNode.getFirstChild(); child != null;) {
>    Node nextChild = child.getNextSibling();
>    oldNode.removeChild(child);
>    child = nextChild;
> }
> {noformat}
> I can supply a test case if that would be helpful.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.