diff --git a/src/main/java/com/rometools/modules/base/GoogleBaseImpl.java b/src/main/java/com/rometools/modules/base/GoogleBaseImpl.java index 408a630..5c5004f 100644 --- a/src/main/java/com/rometools/modules/base/GoogleBaseImpl.java +++ b/src/main/java/com/rometools/modules/base/GoogleBaseImpl.java @@ -42,6 +42,9 @@ import java.lang.reflect.Array; import java.net.URL; import java.util.Date; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.rometools.modules.base.types.CloneableType; import com.rometools.modules.base.types.CurrencyEnumeration; import com.rometools.modules.base.types.DateTimeRange; @@ -68,6 +71,8 @@ public class GoogleBaseImpl implements GoogleBase { * */ private static final long serialVersionUID = 1L; + + private static final Logger LOG = LoggerFactory.getLogger(GoogleBaseImpl.class); /** boolean:listing_type */ private Boolean listingType; @@ -1297,7 +1302,7 @@ public class GoogleBaseImpl implements GoogleBase { return gbi; } catch (final Exception e) { - e.printStackTrace(); + LOG.error("Error",e); throw new CloneNotSupportedException(); } } diff --git a/src/main/java/com/rometools/modules/base/io/GoogleBaseGenerator.java b/src/main/java/com/rometools/modules/base/io/GoogleBaseGenerator.java index 57618d8..4795295 100644 --- a/src/main/java/com/rometools/modules/base/io/GoogleBaseGenerator.java +++ b/src/main/java/com/rometools/modules/base/io/GoogleBaseGenerator.java @@ -48,6 +48,8 @@ import java.util.Set; import org.jdom2.Element; import org.jdom2.Namespace; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.rometools.modules.base.GoogleBase; import com.rometools.modules.base.GoogleBaseImpl; @@ -72,6 +74,8 @@ import com.rometools.rome.io.ModuleGenerator; */ public class GoogleBaseGenerator implements ModuleGenerator { private static final Namespace NS = Namespace.getNamespace("g-core", GoogleBase.URI); + + private static final Logger LOG = LoggerFactory.getLogger(GoogleBaseGenerator.class); /** Creates a new instance of GoogleBaseGenerator */ public GoogleBaseGenerator() { @@ -118,7 +122,7 @@ public class GoogleBaseGenerator implements ModuleGenerator { } } } catch (final Exception e) { - e.printStackTrace(); + LOG.error("Error",e); } } } diff --git a/src/main/java/com/rometools/modules/base/io/GoogleBaseParser.java b/src/main/java/com/rometools/modules/base/io/GoogleBaseParser.java index 48b30c9..6bffa22 100644 --- a/src/main/java/com/rometools/modules/base/io/GoogleBaseParser.java +++ b/src/main/java/com/rometools/modules/base/io/GoogleBaseParser.java @@ -96,10 +96,8 @@ public class GoogleBaseParser implements ModuleParser { pds = Introspector.getBeanInfo(GoogleBaseImpl.class).getPropertyDescriptors(); PROPS2TAGS.load(GoogleBaseParser.class.getResourceAsStream("/com/rometools/modules/base/io/tags.properties")); } catch (final IOException e) { - e.printStackTrace(); LOG.error("Unable to read properties file for Google Base tags!", e); } catch (final IntrospectionException e) { - e.printStackTrace(); LOG.error("Unable to get property descriptors for GoogleBaseImpl!", e); } } @@ -144,7 +142,6 @@ public class GoogleBaseParser implements ModuleParser { handleTag(child, pd, module); } catch (final Exception e) { LOG.warn("Unable to handle tag: " + child.getName(), e); - e.printStackTrace(); } } } diff --git a/src/main/java/com/rometools/modules/cc/types/License.java b/src/main/java/com/rometools/modules/cc/types/License.java index 29ac313..216a5ce 100644 --- a/src/main/java/com/rometools/modules/cc/types/License.java +++ b/src/main/java/com/rometools/modules/cc/types/License.java @@ -45,6 +45,10 @@ import java.util.Map; import java.util.StringTokenizer; import java.util.concurrent.ConcurrentHashMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.rometools.modules.base.GoogleBaseImpl; import com.rometools.rome.feed.impl.EqualsBean; import com.rometools.rome.feed.impl.ToStringBean; @@ -56,6 +60,7 @@ public class License { private static final String CC_START = "http://creativecommons.org/licenses/"; private static final Map lookupLicense = new ConcurrentHashMap(); + private static final Logger LOG = LoggerFactory.getLogger(License.class); public static final License NO_DERIVS = new License("http://creativecommons.org/licenses/nd/1.0/", new Behaviour[0], new Behaviour[] { Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION }); public static final License NO_DERIVS_NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nd-nc/1.0/", @@ -120,7 +125,7 @@ public class License { } } } catch (final Exception e) { - e.printStackTrace(); + LOG.error("Error",e); } } } diff --git a/src/main/java/com/rometools/modules/georss/GeoRSSModule.java b/src/main/java/com/rometools/modules/georss/GeoRSSModule.java index 0dcb1ae..20a0fbd 100644 --- a/src/main/java/com/rometools/modules/georss/GeoRSSModule.java +++ b/src/main/java/com/rometools/modules/georss/GeoRSSModule.java @@ -17,7 +17,10 @@ package com.rometools.modules.georss; import org.jdom2.Namespace; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.rometools.modules.base.GoogleBaseImpl; import com.rometools.modules.georss.geometries.AbstractGeometry; import com.rometools.modules.georss.geometries.Point; import com.rometools.modules.georss.geometries.Position; @@ -34,6 +37,8 @@ import com.rometools.rome.feed.module.ModuleImpl; public abstract class GeoRSSModule extends ModuleImpl implements Cloneable { private static final long serialVersionUID = 1L; + + private static final Logger LOG = LoggerFactory.getLogger(GeoRSSModule.class); protected AbstractGeometry geometry; @@ -127,7 +132,7 @@ public abstract class GeoRSSModule extends ModuleImpl implements Cloneable { try { geometry = (AbstractGeometry) geometry.clone(); } catch (final CloneNotSupportedException ex) { - ex.printStackTrace(); + LOG.error("Error",ex); } } @@ -140,7 +145,7 @@ public abstract class GeoRSSModule extends ModuleImpl implements Cloneable { } return retval; } catch (final Exception ex) { - ex.printStackTrace(); + LOG.error("Error",ex); } throw new CloneNotSupportedException(); } diff --git a/src/main/java/com/rometools/modules/opensearch/impl/OpenSearchModuleImpl.java b/src/main/java/com/rometools/modules/opensearch/impl/OpenSearchModuleImpl.java index 6a21dc6..bba501c 100644 --- a/src/main/java/com/rometools/modules/opensearch/impl/OpenSearchModuleImpl.java +++ b/src/main/java/com/rometools/modules/opensearch/impl/OpenSearchModuleImpl.java @@ -18,6 +18,10 @@ import java.io.Serializable; import java.util.LinkedList; import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.rometools.modules.base.GoogleBaseImpl; import com.rometools.modules.opensearch.OpenSearchModule; import com.rometools.modules.opensearch.entity.OSQuery; import com.rometools.rome.feed.CopyFrom; @@ -29,6 +33,7 @@ import com.rometools.rome.feed.module.ModuleImpl; */ public class OpenSearchModuleImpl extends ModuleImpl implements OpenSearchModule, Serializable { private static final long serialVersionUID = 1L; + private static final Logger LOG = LoggerFactory.getLogger(OpenSearchModuleImpl.class); private int totalResults = -1; private int startIndex = 1; private int itemsPerPage = -1; @@ -142,7 +147,7 @@ public class OpenSearchModuleImpl extends ModuleImpl implements OpenSearchModule try { getQueries().add((OSQuery) q.clone()); } catch (final CloneNotSupportedException e) { - e.printStackTrace(); + LOG.error("Error",e); } } } diff --git a/src/main/java/com/rometools/modules/sse/modules/Conflict.java b/src/main/java/com/rometools/modules/sse/modules/Conflict.java index 1c7048a..9a2e806 100644 --- a/src/main/java/com/rometools/modules/sse/modules/Conflict.java +++ b/src/main/java/com/rometools/modules/sse/modules/Conflict.java @@ -17,6 +17,10 @@ package com.rometools.modules.sse.modules; import java.util.Date; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.rometools.modules.base.GoogleBaseImpl; import com.rometools.rome.feed.CopyFrom; import com.rometools.rome.feed.rss.Item; @@ -25,6 +29,8 @@ import com.rometools.rome.feed.rss.Item; */ public class Conflict extends SSEModule { private static final long serialVersionUID = 1L; + + private static final Logger LOG = LoggerFactory.getLogger(Conflict.class); public static final String CONFLICTS_NAME = "conflicts"; @@ -69,7 +75,7 @@ public class Conflict extends SSEModule { conflict.conflictItem = (Item) conflictItem.clone(); } catch (final CloneNotSupportedException e) { // should not happen - e.printStackTrace(); + LOG.error("Error",e); } } diff --git a/src/main/java/com/rometools/modules/sse/modules/SSEModule.java b/src/main/java/com/rometools/modules/sse/modules/SSEModule.java index b7e1df4..75de724 100644 --- a/src/main/java/com/rometools/modules/sse/modules/SSEModule.java +++ b/src/main/java/com/rometools/modules/sse/modules/SSEModule.java @@ -19,6 +19,8 @@ import java.util.HashSet; import java.util.Set; import org.jdom2.Namespace; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.rometools.rome.feed.CopyFrom; import com.rometools.rome.feed.module.Module; @@ -29,6 +31,8 @@ import com.rometools.rome.feed.module.Module; */ public abstract class SSEModule implements Module { private static final long serialVersionUID = 1L; + + private static final Logger LOG = LoggerFactory.getLogger(SSEModule.class); public static final String SSE_SCHEMA_URI = "http://www.microsoft.com/schemas/rss/sse"; @@ -61,11 +65,9 @@ public abstract class SSEModule implements Module { clone = this.getClass().newInstance(); clone.copyFrom(this); } catch (final InstantiationException e) { - // TODO: use logging - e.printStackTrace(); + LOG.error("Error",e); } catch (final IllegalAccessException e) { - // TODO: use logging - e.printStackTrace(); + LOG.error("Error",e); } return clone; }