You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by mu...@apache.org on 2007/07/18 21:02:50 UTC

svn commit: r557362 - /xml/security/trunk/src/org/apache/xml/security/encryption/XMLCipher.java

Author: mullan
Date: Wed Jul 18 12:02:49 2007
New Revision: 557362

URL: http://svn.apache.org/viewvc?view=rev&rev=557362
Log:
Fixed 42886: Error when removing encrypted content in 1.4.1

Modified:
    xml/security/trunk/src/org/apache/xml/security/encryption/XMLCipher.java

Modified: xml/security/trunk/src/org/apache/xml/security/encryption/XMLCipher.java
URL: http://svn.apache.org/viewvc/xml/security/trunk/src/org/apache/xml/security/encryption/XMLCipher.java?view=diff&rev=557362&r1=557361&r2=557362
==============================================================================
--- xml/security/trunk/src/org/apache/xml/security/encryption/XMLCipher.java (original)
+++ xml/security/trunk/src/org/apache/xml/security/encryption/XMLCipher.java Wed Jul 18 12:02:49 2007
@@ -1360,13 +1360,9 @@
      *
      * @param node the <code>Node</code> to clear.
      */
-    private void removeContent(Node node) {
-        NodeList list = node.getChildNodes();
-        for (int i=0; i<list.getLength(); i++) {
-            Node n = list.item(i);
-            if (n != null) {
-                n.getParentNode().removeChild(n);
-            }
+    private static void removeContent(Node node) {
+       while (node.hasChildNodes()) {
+            node.removeChild(node.getFirstChild());
         }
     }