Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2748D1012F for ; Tue, 29 Oct 2013 19:34:54 +0000 (UTC) Received: (qmail 60407 invoked by uid 500); 29 Oct 2013 19:34:54 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 60346 invoked by uid 500); 29 Oct 2013 19:34:54 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 60339 invoked by uid 99); 29 Oct 2013 19:34:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Oct 2013 19:34:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Oct 2013 19:34:51 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C07EB23889B9; Tue, 29 Oct 2013 19:34:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131029193430.C07EB23889B9@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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"); + } } /**