diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-02-17 17:48:22 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-02-17 17:48:22 +0000 |
commit | 5c388638dd34050cf13bb62cd9b8551292cc4e79 (patch) | |
tree | 34a396379a861ad4e727f9d906485ea0d2c6de0c /branches/sca-java-1.x/modules/contribution | |
parent | d1996f5c60edfb20b0c00ee5b1ca6478d0a42275 (diff) |
Use Logger instead e.printStackTrace
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@745170 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/contribution')
-rw-r--r-- | branches/sca-java-1.x/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java | 22 |
1 files changed, 13 insertions, 9 deletions
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()); } } |