chore: change e.printStackTrace to logging
Change several classes to remove calls to printStackTrace of exceptions and use instead of logging from SFL4J which is already used in the project Ammendment of previous commit so the format and whitespacing is the same
This commit is contained in:
parent
bb49c32dab
commit
c1628e398d
8 changed files with 43 additions and 14 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<String, License> lookupLicense = new ConcurrentHashMap<String, License>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue