From 5c388638dd34050cf13bb62cd9b8551292cc4e79 Mon Sep 17 00:00:00 2001 From: rfeng Date: Tue, 17 Feb 2009 17:48:22 +0000 Subject: Use Logger instead e.printStackTrace git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@745170 13f79535-47bb-0310-9956-ffa450edef68 --- .../DefaultValidatingXMLInputFactory.java | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'branches/sca-java-1.x/modules/contribution') diff --git a/branches/sca-java-1.x/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java b/branches/sca-java-1.x/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java index 7be5566113..31f2d3d4f9 100644 --- a/branches/sca-java-1.x/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java +++ b/branches/sca-java-1.x/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java @@ -28,6 +28,8 @@ import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.xml.XMLConstants; import javax.xml.stream.EventFilter; @@ -58,7 +60,7 @@ import org.xml.sax.SAXParseException; * @version $Rev$ $Date$ */ public class DefaultValidatingXMLInputFactory extends ValidatingXMLInputFactory { - + private static final Logger logger = Logger.getLogger(DefaultValidatingXMLInputFactory.class.getName()); private XMLInputFactory inputFactory; private ValidationSchemaExtensionPoint schemas; private Monitor monitor; @@ -87,9 +89,11 @@ public class DefaultValidatingXMLInputFactory extends ValidatingXMLInputFactory */ private void error(String message, Object model, Exception ex) { if (monitor != null) { - Problem problem = new ProblemImpl(this.getClass().getName(), "contribution-validation-messages", Severity.ERROR, model, message, ex); - monitor.problem(problem); - } + Problem problem = + new ProblemImpl(this.getClass().getName(), "contribution-validation-messages", Severity.ERROR, model, + message, ex); + monitor.problem(problem); + } } /** @@ -126,7 +130,7 @@ public class DefaultValidatingXMLInputFactory extends ValidatingXMLInputFactory } }); } catch (PrivilegedActionException e) { - error("PrivilegedActionException", url, (IOException)e.getException()); + error("PrivilegedActionException", url, (IOException)e.getException()); throw (IOException)e.getException(); } sources[i] = new StreamSource(urlStream, uri); @@ -149,14 +153,14 @@ public class DefaultValidatingXMLInputFactory extends ValidatingXMLInputFactory } catch (Error e) { // FIXME Log this, some old JDKs don't support XMLSchema validation - //e.printStackTrace(); + logger.log(Level.WARNING, "XML Schema validation is not supported: " + e.getMessage()); } catch (SAXParseException e) { - IllegalStateException ie = new IllegalStateException(e); - error("IllegalStateException", schemas, ie); + IllegalStateException ie = new IllegalStateException(e); + error("IllegalStateException", schemas, ie); throw ie; } catch (Exception e) { //FIXME Log this, some old JDKs don't support XMLSchema validation - e.printStackTrace(); + logger.log(Level.WARNING, "XML Schema validation is not supported: " + e.getMessage()); } } -- cgit v1.2.3