Skip to content
Permalink
Browse files
Just make the check for woodstox once.
git-svn-id: https://svn.apache.org/repos/asf/cxf/trunk@1536862 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
dkulp committed Oct 29, 2013
1 parent 4ef48b9 commit 42bb91e58e1801fe8bc07d9c303c74233d1c0acb
Showing 1 changed file with 15 additions and 1 deletion.
@@ -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");
}
}

/**

0 comments on commit 42bb91e

Please sign in to comment.