Author: coheigea
Date: Fri Jun 19 17:00:09 2015
New Revision: 1686455

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

Modified:
    
webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/utils/XMLSecEventAllocator.java

Modified: 
webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/utils/XMLSecEventAllocator.java
URL: 
http://svn.apache.org/viewvc/webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/utils/XMLSecEventAllocator.java?rev=1686455&r1=1686454&r2=1686455&view=diff
==============================================================================
--- 
webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/utils/XMLSecEventAllocator.java
 (original)
+++ 
webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/utils/XMLSecEventAllocator.java
 Fri Jun 19 17:00:09 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


Reply via email to