commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "joel truher (JIRA)" <>
Subject [jira] Created: (SCXML-89) Assign.execute() doesn't remove all children of oldNode (includes fix)
Date Fri, 14 Nov 2008 06:22:44 GMT
Assign.execute() doesn't remove all children of oldNode (includes fix)

                 Key: SCXML-89
             Project: Commons SCXML
          Issue Type: Bug
    Affects Versions: 0.8
         Environment: Ubuntu 7.10 (64 bit), JRE ia32-java6-sun-
            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.

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

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

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

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.

View raw message