Return-Path: X-Original-To: apmail-chemistry-commits-archive@www.apache.org Delivered-To: apmail-chemistry-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 C306E1768C for ; Tue, 6 Jan 2015 20:16:55 +0000 (UTC) Received: (qmail 13019 invoked by uid 500); 6 Jan 2015 20:16:56 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 12974 invoked by uid 500); 6 Jan 2015 20:16:56 -0000 Mailing-List: contact commits-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list commits@chemistry.apache.org Received: (qmail 12962 invoked by uid 99); 6 Jan 2015 20:16:56 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jan 2015 20:16:56 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 0906DAC0040; Tue, 6 Jan 2015 20:16:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1649928 - /chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java Date: Tue, 06 Jan 2015 20:16:50 -0000 To: commits@chemistry.apache.org From: fmui@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150106201655.0906DAC0040@hades.apache.org> Author: fmui Date: Tue Jan 6 20:16:50 2015 New Revision: 1649928 URL: http://svn.apache.org/r1649928 Log: XMLUtilis improvements Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java?rev=1649928&r1=1649927&r2=1649928&view=diff ============================================================================== --- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java (original) +++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLUtils.java Tue Jan 6 20:16:50 2015 @@ -55,9 +55,11 @@ public final class XMLUtils { try { // Woodstox is the only supported and tested StAX implementation - factory = new WstxInputFactory(); - factory.setProperty(WstxOutputProperties.P_OUTPUT_INVALID_CHAR_HANDLER, - new InvalidCharHandler.ReplacingHandler(' ')); + WstxInputFactory wstxFactory = (WstxInputFactory) ClassLoaderUtil.loadClass( + "com.ctc.wstx.stax.WstxInputFactory").newInstance(); + wstxFactory.configureForSpeed(); + + factory = wstxFactory; } catch (Exception e) { // other StAX implementations may work, too factory = XMLInputFactory.newInstance(); @@ -69,7 +71,8 @@ public final class XMLUtils { // ignore } - LOG.warn("Unsupported StAX parser: " + factory.getClass().getName()); + LOG.warn("Unsupported StAX parser: " + factory.getClass().getName() + " (Exception: " + e.toString() + ")", + e); } factory.setProperty(XMLInputFactory.IS_COALESCING, Boolean.FALSE); @@ -85,7 +88,13 @@ public final class XMLUtils { try { // Woodstox is the only supported and tested StAX implementation - factory = new WstxOutputFactory(); + WstxOutputFactory wstxFactory = (WstxOutputFactory) ClassLoaderUtil.loadClass( + "com.ctc.wstx.stax.WstxOutputFactory").newInstance(); + wstxFactory.configureForSpeed(); + wstxFactory.setProperty(WstxOutputProperties.P_OUTPUT_INVALID_CHAR_HANDLER, + new InvalidCharHandler.ReplacingHandler(' ')); + + factory = wstxFactory; } catch (Exception e) { // other StAX implementations may work, too factory = XMLOutputFactory.newInstance(); @@ -97,7 +106,8 @@ public final class XMLUtils { // ignore } - LOG.warn("Unsupported StAX parser: " + factory.getClass().getName()); + LOG.warn("Unsupported StAX parser: " + factory.getClass().getName() + " (Exception: " + e.toString() + ")", + e); } factory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.FALSE);