You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2015/06/19 18:59:48 UTC

svn commit: r1686454 - /webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/utils/XMLSecEventAllocator.java

Author: coheigea
Date: Fri Jun 19 16:59:48 2015
New Revision: 1686454

URL: http://svn.apache.org/r1686454
Log:
Introduce direct dependency on woodstox rather than use reflection

Modified:
    webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/utils/XMLSecEventAllocator.java

Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/utils/XMLSecEventAllocator.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/utils/XMLSecEventAllocator.java?rev=1686454&r1=1686453&r2=1686454&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/utils/XMLSecEventAllocator.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/utils/XMLSecEventAllocator.java Fri Jun 19 16:59:48 2015
@@ -22,7 +22,6 @@ import org.apache.xml.security.stax.ext.
 import org.apache.xml.security.stax.ext.stax.XMLSecEventFactory;
 import org.apache.xml.security.stax.ext.stax.XMLSecStartElement;
 
-import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
@@ -40,14 +39,7 @@ public class XMLSecEventAllocator implem
     private XMLSecStartElement parentXmlSecStartElement;
 
     public XMLSecEventAllocator() throws Exception {
-        XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
-        if (xmlInputFactory.getClass().getName().equals("com.sun.xml.internal.stream.XMLInputFactoryImpl")) {
-            xmlEventAllocator = (XMLEventAllocator) Class.forName("com.sun.xml.internal.stream.events.XMLEventAllocatorImpl").newInstance();
-        } else if (xmlInputFactory.getClass().getName().equals("com.ctc.wstx.stax.WstxInputFactory")) {
-            xmlEventAllocator = (XMLEventAllocator) Class.forName("com.ctc.wstx.evt.DefaultEventAllocator").getMethod("getDefaultInstance").invoke(null);
-        } else {
-            throw new Exception("Unknown XMLEventAllocator");
-        }
+        xmlEventAllocator = com.ctc.wstx.evt.DefaultEventAllocator.getDefaultInstance();
     }
 
     @Override