From 02bc40d398bfeb676e7410847e606ae7743b8873 Mon Sep 17 00:00:00 2001 From: Patrick Gotthard Date: Fri, 15 Nov 2013 18:48:01 +0100 Subject: [PATCH] Added SLF4J to ROME --- pom.xml | 5 +++++ .../sun/syndication/feed/impl/CloneableBean.java | 16 +++++++++++----- .../sun/syndication/io/impl/RSS092Parser.java | 6 +++++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index ac1c6ed..b75f02b 100644 --- a/pom.xml +++ b/pom.xml @@ -198,6 +198,11 @@ jdom 2.0.2 + + org.slf4j + slf4j-api + 1.7.5 + junit junit diff --git a/src/main/java/com/sun/syndication/feed/impl/CloneableBean.java b/src/main/java/com/sun/syndication/feed/impl/CloneableBean.java index b2e7474..f008943 100644 --- a/src/main/java/com/sun/syndication/feed/impl/CloneableBean.java +++ b/src/main/java/com/sun/syndication/feed/impl/CloneableBean.java @@ -30,6 +30,9 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** * Provides deep Bean clonning support. *

@@ -42,7 +45,10 @@ import java.util.Set; * */ public class CloneableBean implements Serializable, Cloneable { + private static final long serialVersionUID = -6520053043831187823L; + private static final Logger LOG = LoggerFactory.getLogger(CloneableBean.class); + private static final Class[] NO_PARAMS_DEF = new Class[0]; private static final Object[] NO_PARAMS = new Object[0]; @@ -186,11 +192,11 @@ public class CloneableBean implements Serializable, Cloneable { } } } - } catch (final CloneNotSupportedException cnsEx) { - throw cnsEx; - } catch (final Exception ex) { - System.out.println(ex); - ex.printStackTrace(System.out); + } catch (final CloneNotSupportedException e) { + LOG.error("Error while cloning bean", e); + throw e; + } catch (final Exception e) { + LOG.error("Error while cloning bean", e); throw new CloneNotSupportedException("Cannot clone a " + obj.getClass() + " object"); } return clonedBean; diff --git a/src/main/java/com/sun/syndication/io/impl/RSS092Parser.java b/src/main/java/com/sun/syndication/io/impl/RSS092Parser.java index ec5aa29..2b78e5e 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS092Parser.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS092Parser.java @@ -23,6 +23,8 @@ import java.util.Locale; import org.jdom2.Content; import org.jdom2.Element; import org.jdom2.output.XMLOutputter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.sun.syndication.feed.WireFeed; import com.sun.syndication.feed.rss.Category; @@ -36,6 +38,8 @@ import com.sun.syndication.feed.rss.Source; /** */ public class RSS092Parser extends RSS091UserlandParser { + + private static final Logger LOG = LoggerFactory.getLogger(RSS092Parser.class); public RSS092Parser() { this("rss_0.92"); @@ -179,7 +183,7 @@ public class RSS092Parser extends RSS091UserlandParser { sb.append(c.getValue()); break; case EntityRef: - System.out.println("entity: " + c.getValue()); + LOG.debug("Entity: {}", c.getValue()); sb.append(c.getValue()); break; case Element: