cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1536862 - /cxf/trunk/core/src/main/java/org/apache/cxf/staxutils/validation/Stax2ValidationUtils.java
Date Tue, 29 Oct 2013 19:34:30 GMT
Author: dkulp
Date: Tue Oct 29 19:34:30 2013
New Revision: 1536862

URL: http://svn.apache.org/r1536862
Log:
Just make the check for woodstox once.

Modified:
    cxf/trunk/core/src/main/java/org/apache/cxf/staxutils/validation/Stax2ValidationUtils.java

Modified: cxf/trunk/core/src/main/java/org/apache/cxf/staxutils/validation/Stax2ValidationUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/core/src/main/java/org/apache/cxf/staxutils/validation/Stax2ValidationUtils.java?rev=1536862&r1=1536861&r2=1536862&view=diff
==============================================================================
--- cxf/trunk/core/src/main/java/org/apache/cxf/staxutils/validation/Stax2ValidationUtils.java
(original)
+++ cxf/trunk/core/src/main/java/org/apache/cxf/staxutils/validation/Stax2ValidationUtils.java
Tue Oct 29 19:34:30 2013
@@ -53,8 +53,22 @@ class Stax2ValidationUtils {
     private static final Logger LOG = LogUtils.getL7dLogger(Stax2ValidationUtils.class);
     private static final String KEY = XMLValidationSchema.class.getName();
 
+    private static final boolean HAS_WOODSTOX;
+    static {
+        boolean hasw = false;
+        try {
+            new W3CMultiSchemaFactory(); // will throw if wrong woodstox.
+            hasw = true;
+        } catch (Throwable t) {
+            //ignore
+        }
+        HAS_WOODSTOX = hasw;
+    }
+    
     public Stax2ValidationUtils() {
-        new W3CMultiSchemaFactory(); // will throw if wrong woodstox.
+        if (!HAS_WOODSTOX) {
+            throw new RuntimeException("Could not load woodstox");
+        }
     }
 
     /**



Mime
View raw message