You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2020/03/06 12:33:43 UTC

[cxf] 02/07: cxf-rt-ws-security: use DOMUtils.getDomElement

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.3.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 1b8b988fd9dd57e7fd00cb156c0e390fd5a1e6d8
Author: Alexey Markevich <bu...@gmail.com>
AuthorDate: Wed Feb 5 12:10:47 2020 +0300

    cxf-rt-ws-security: use DOMUtils.getDomElement
    
    (cherry picked from commit 84f9bb74702a07664bcbf4622b29cb4b0911010a)
---
 .../org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java  | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
index 16a993c..11377eb 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
@@ -19,7 +19,6 @@
 package org.apache.cxf.ws.security.wss4j;
 
 import java.io.IOException;
-import java.lang.reflect.Method;
 import java.security.Provider;
 import java.security.cert.Certificate;
 import java.util.ArrayList;
@@ -401,15 +400,7 @@ public class WSS4JInInterceptor extends AbstractWSS4JInterceptor {
             if (document != null && node != null) {
                 Node newNode = null;
                 try {
-                    newNode = document.importNode(node, true);
-                    if (newNode != null) {
-                        try {
-                            Method method = newNode.getClass().getMethod("getDomElement");
-                            newNode = (Element)method.invoke(newNode);
-                        } catch (java.lang.NoSuchMethodException ex) {
-                            // do nothing;
-                        }
-                    }
+                    newNode = DOMUtils.getDomElement(document.importNode(node, true));
                     elem.getOwnerDocument().getDocumentElement().getFirstChild().
                         getNextSibling().replaceChild(newNode, node);
                     List<WSSecurityEngineResult> encryptResults = wsResult.getActionResults().get(WSConstants.ENCR);