Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
Nightly Builds
-
None
-
None
-
Operating System: All
Platform: All
-
11951
Description
bug in org.apache.commons.jxpath.ri.model.dom.DOMNodePointer
The problem is when you try and set the value of a DOM node that has more
than 1 child text node. the clearing of the nodes is ctashing:
line 366:
int count = children.getLength();
for (int i = 0; i < count; i++){
Node child = children.item;
if (child.getNodeType() == Node.TEXT_NODE ||
child.getNodeType() == Node.CDATA_SECTION_NODE)
}
when a node is deleted it is removed from the children list.
fix:
int count = children.getLength();
int nPos=0;
for (int i = 0; i < count; i++){
Node child = children.item(nPos);
if (child.getNodeType() == Node.TEXT_NODE ||
child.getNodeType() == Node.CDATA_SECTION_NODE){ node.removeChild(child); }
else
{ nPos++;//only increment position if we are not deleting it }}
This is in both stable and nightly builds