From ac1984c9adfcacc4ba6617f253c2108533cea3b3 Mon Sep 17 00:00:00 2001 From: moparisthebest Date: Wed, 1 Mar 2017 01:07:10 -0500 Subject: [PATCH] Print nothing --- .../java/com/moparisthebest/sxf4j/ClassXmlElement.java | 4 ++-- .../com/moparisthebest/sxf4j/impl/AbstractXmlElement.java | 7 +++---- .../java/com/moparisthebest/sxf4j/impl/W3CXmlElement.java | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/moparisthebest/sxf4j/ClassXmlElement.java b/src/main/java/com/moparisthebest/sxf4j/ClassXmlElement.java index d447aeb..611ee68 100755 --- a/src/main/java/com/moparisthebest/sxf4j/ClassXmlElement.java +++ b/src/main/java/com/moparisthebest/sxf4j/ClassXmlElement.java @@ -18,7 +18,7 @@ public class ClassXmlElement { , "WARNING: INFINITE RECURSION DETECTED" }; - public static boolean debug = false; + public static final boolean debug = false; private final String uuid; @@ -293,7 +293,7 @@ public class ClassXmlElement { else ret = m.invoke(container); } catch (Exception e) { - e.printStackTrace(); + throw new RuntimeException(e); } return ret; } diff --git a/src/main/java/com/moparisthebest/sxf4j/impl/AbstractXmlElement.java b/src/main/java/com/moparisthebest/sxf4j/impl/AbstractXmlElement.java index be646de..bd471eb 100755 --- a/src/main/java/com/moparisthebest/sxf4j/impl/AbstractXmlElement.java +++ b/src/main/java/com/moparisthebest/sxf4j/impl/AbstractXmlElement.java @@ -64,9 +64,9 @@ public abstract class AbstractXmlElement implements XmlElement, XmlElementFactor constructor.setAccessible(true); return (E) constructor.newInstance(); } catch (Exception e) { - e.printStackTrace(); + // ignore } catch (Error e) { - e.printStackTrace(); + // ignore } return null; } @@ -107,9 +107,8 @@ public abstract class AbstractXmlElement implements XmlElement, XmlElementFactor writeToStream(bos); return new String(bos.toByteArray(), "UTF-8"); } catch (Exception e) { - e.printStackTrace(); + throw new RuntimeException(e); } - return new String(bos.toByteArray()); } @Override diff --git a/src/main/java/com/moparisthebest/sxf4j/impl/W3CXmlElement.java b/src/main/java/com/moparisthebest/sxf4j/impl/W3CXmlElement.java index bf2bf57..5d1f1cf 100755 --- a/src/main/java/com/moparisthebest/sxf4j/impl/W3CXmlElement.java +++ b/src/main/java/com/moparisthebest/sxf4j/impl/W3CXmlElement.java @@ -27,7 +27,7 @@ public class W3CXmlElement extends AbstractXmlElement { try{ db = DocumentBuilderFactory.newInstance().newDocumentBuilder(); }catch(Exception e){ - e.printStackTrace(); + throw new RuntimeException(e); } if(db == null){ internal = null;