Merge pull request #36 from IgnacioDomingo/master

"chore: change e.printStackTrace to logging"

Thanks Ignacio!
This commit is contained in:
David M. Johnson 2015-12-06 15:19:26 -05:00
commit a5f56fe914
8 changed files with 221 additions and 223 deletions

View file

@ -3,38 +3,34 @@
* *
* Created on November 16, 2005, 2:06 PM * Created on November 16, 2005, 2:06 PM
* *
* This library is provided under dual licenses. * This library is provided under dual licenses. You may choose the terms of the Lesser General
* You may choose the terms of the Lesser General Public License or the Apache * Public License or the Apache License at your discretion.
* License at your discretion.
* *
* Copyright (C) 2005 Robert Cooper, Temple of the Screaming Penguin * Copyright (C) 2005 Robert Cooper, Temple of the Screaming Penguin
* *
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or modify it under the terms of the
* modify it under the terms of the GNU Lesser General Public * GNU Lesser General Public License as published by the Free Software Foundation; either version
* License as published by the Free Software Foundation; either * 2.1 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* but WITHOUT ANY WARRANTY; without even the implied warranty of * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public License along with this library;
* License along with this library; if not, write to the Free Software * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 02111-1307 USA
* *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* you may not use this file except in compliance with the License. * in compliance with the License. You may obtain a copy of the License at
* You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software distributed under the License
* distributed under the License is distributed on an "AS IS" BASIS, * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * or implied. * See the License for the specific language governing permissions and limitations
* limitations under the License. * under the License.
*/ */
package com.rometools.modules.base; package com.rometools.modules.base;
@ -42,6 +38,9 @@ import java.lang.reflect.Array;
import java.net.URL; import java.net.URL;
import java.util.Date; 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.CloneableType;
import com.rometools.modules.base.types.CurrencyEnumeration; import com.rometools.modules.base.types.CurrencyEnumeration;
import com.rometools.modules.base.types.DateTimeRange; import com.rometools.modules.base.types.DateTimeRange;
@ -69,6 +68,8 @@ public class GoogleBaseImpl implements GoogleBase {
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final Logger LOG = LoggerFactory.getLogger(GoogleBaseImpl.class);
/** boolean:listing_type */ /** boolean:listing_type */
private Boolean listingType; private Boolean listingType;
@ -1297,7 +1298,7 @@ public class GoogleBaseImpl implements GoogleBase {
return gbi; return gbi;
} catch (final Exception e) { } catch (final Exception e) {
e.printStackTrace(); LOG.error("Error", e);
throw new CloneNotSupportedException(); throw new CloneNotSupportedException();
} }
} }

View file

@ -3,39 +3,34 @@
* *
* Created on November 17, 2005, 2:46 PM * Created on November 17, 2005, 2:46 PM
* *
* This library is provided under dual licenses. * This library is provided under dual licenses. You may choose the terms of the Lesser General
* You may choose the terms of the Lesser General Public License or the Apache * Public License or the Apache License at your discretion.
* License at your discretion.
* *
* Copyright (C) 2005 Robert Cooper, Temple of the Screaming Penguin * Copyright (C) 2005 Robert Cooper, Temple of the Screaming Penguin
* *
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or modify it under the terms of the
* modify it under the terms of the GNU Lesser General Public * GNU Lesser General Public License as published by the Free Software Foundation; either version
* License as published by the Free Software Foundation; either * 2.1 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* but WITHOUT ANY WARRANTY; without even the implied warranty of * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public License along with this library;
* License along with this library; if not, write to the Free Software * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 02111-1307 USA
* *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* you may not use this file except in compliance with the License. * in compliance with the License. You may obtain a copy of the License at
* You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software distributed under the License
* distributed under the License is distributed on an "AS IS" BASIS, * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * or implied. See the License for the specific language governing permissions and limitations under
* See the License for the specific language governing permissions and * the License.
* limitations under the License.
*/ */
package com.rometools.modules.base.io; package com.rometools.modules.base.io;
@ -48,6 +43,8 @@ import java.util.Set;
import org.jdom2.Element; import org.jdom2.Element;
import org.jdom2.Namespace; import org.jdom2.Namespace;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.rometools.modules.base.GoogleBase; import com.rometools.modules.base.GoogleBase;
import com.rometools.modules.base.GoogleBaseImpl; import com.rometools.modules.base.GoogleBaseImpl;
@ -73,6 +70,8 @@ import com.rometools.rome.io.ModuleGenerator;
public class GoogleBaseGenerator implements ModuleGenerator { public class GoogleBaseGenerator implements ModuleGenerator {
private static final Namespace NS = Namespace.getNamespace("g-core", GoogleBase.URI); 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 */ /** Creates a new instance of GoogleBaseGenerator */
public GoogleBaseGenerator() { public GoogleBaseGenerator() {
super(); super();
@ -118,7 +117,7 @@ public class GoogleBaseGenerator implements ModuleGenerator {
} }
} }
} catch (final Exception e) { } catch (final Exception e) {
e.printStackTrace(); LOG.error("Error", e);
} }
} }
} }

View file

@ -3,39 +3,34 @@
* *
* Created on November 17, 2005, 11:31 AM * Created on November 17, 2005, 11:31 AM
* *
* This library is provided under dual licenses. * This library is provided under dual licenses. You may choose the terms of the Lesser General
* You may choose the terms of the Lesser General Public License or the Apache * Public License or the Apache License at your discretion.
* License at your discretion.
* *
* Copyright (C) 2005 Robert Cooper, Temple of the Screaming Penguin * Copyright (C) 2005 Robert Cooper, Temple of the Screaming Penguin
* *
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or modify it under the terms of the
* modify it under the terms of the GNU Lesser General Public * GNU Lesser General Public License as published by the Free Software Foundation; either version
* License as published by the Free Software Foundation; either * 2.1 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* but WITHOUT ANY WARRANTY; without even the implied warranty of * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public License along with this library;
* License along with this library; if not, write to the Free Software * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 02111-1307 USA
* *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* you may not use this file except in compliance with the License. * in compliance with the License. You may obtain a copy of the License at
* You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software distributed under the License
* distributed under the License is distributed on an "AS IS" BASIS, * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * or implied. See the License for the specific language governing permissions and limitations under
* See the License for the specific language governing permissions and * the License.
* limitations under the License.
*/ */
package com.rometools.modules.base.io; package com.rometools.modules.base.io;
@ -96,10 +91,8 @@ public class GoogleBaseParser implements ModuleParser {
pds = Introspector.getBeanInfo(GoogleBaseImpl.class).getPropertyDescriptors(); pds = Introspector.getBeanInfo(GoogleBaseImpl.class).getPropertyDescriptors();
PROPS2TAGS.load(GoogleBaseParser.class.getResourceAsStream("/com/rometools/modules/base/io/tags.properties")); PROPS2TAGS.load(GoogleBaseParser.class.getResourceAsStream("/com/rometools/modules/base/io/tags.properties"));
} catch (final IOException e) { } catch (final IOException e) {
e.printStackTrace();
LOG.error("Unable to read properties file for Google Base tags!", e); LOG.error("Unable to read properties file for Google Base tags!", e);
} catch (final IntrospectionException e) { } catch (final IntrospectionException e) {
e.printStackTrace();
LOG.error("Unable to get property descriptors for GoogleBaseImpl!", e); LOG.error("Unable to get property descriptors for GoogleBaseImpl!", e);
} }
} }
@ -144,7 +137,6 @@ public class GoogleBaseParser implements ModuleParser {
handleTag(child, pd, module); handleTag(child, pd, module);
} catch (final Exception e) { } catch (final Exception e) {
LOG.warn("Unable to handle tag: " + child.getName(), e); LOG.warn("Unable to handle tag: " + child.getName(), e);
e.printStackTrace();
} }
} }
} }
@ -198,12 +190,13 @@ public class GoogleBaseParser implements ModuleParser {
} else if (pd.getPropertyType() == FloatUnit.class || pd.getPropertyType().getComponentType() == FloatUnit.class) { } else if (pd.getPropertyType() == FloatUnit.class || pd.getPropertyType().getComponentType() == FloatUnit.class) {
tagValue = new FloatUnit(tag.getText()); tagValue = new FloatUnit(tag.getText());
} else if (pd.getPropertyType() == DateTimeRange.class || pd.getPropertyType().getComponentType() == DateTimeRange.class) { } else if (pd.getPropertyType() == DateTimeRange.class || pd.getPropertyType().getComponentType() == DateTimeRange.class) {
tagValue = new DateTimeRange(LONG_DT_FMT.parse(tag.getChild("start", GoogleBaseParser.NS).getText().trim()), LONG_DT_FMT.parse(tag tagValue =
new DateTimeRange(LONG_DT_FMT.parse(tag.getChild("start", GoogleBaseParser.NS).getText().trim()), LONG_DT_FMT.parse(tag
.getChild("end", GoogleBaseParser.NS).getText().trim())); .getChild("end", GoogleBaseParser.NS).getText().trim()));
} else if (pd.getPropertyType() == ShippingType.class || pd.getPropertyType().getComponentType() == ShippingType.class) { } else if (pd.getPropertyType() == ShippingType.class || pd.getPropertyType().getComponentType() == ShippingType.class) {
final FloatUnit price = new FloatUnit(tag.getChild("price", GoogleBaseParser.NS).getText().trim()); final FloatUnit price = new FloatUnit(tag.getChild("price", GoogleBaseParser.NS).getText().trim());
ShippingType.ServiceEnumeration service = ShippingType.ServiceEnumeration ShippingType.ServiceEnumeration service =
.findByValue(tag.getChild("service", GoogleBaseParser.NS).getText().trim()); ShippingType.ServiceEnumeration.findByValue(tag.getChild("service", GoogleBaseParser.NS).getText().trim());
if (service == null) { if (service == null) {
service = ShippingType.ServiceEnumeration.STANDARD; service = ShippingType.ServiceEnumeration.STANDARD;

View file

@ -3,39 +3,34 @@
* *
* Created on November 20, 2005, 3:20 PM * Created on November 20, 2005, 3:20 PM
* *
* This library is provided under dual licenses. * This library is provided under dual licenses. You may choose the terms of the Lesser General
* You may choose the terms of the Lesser General Public License or the Apache * Public License or the Apache License at your discretion.
* License at your discretion.
* *
* Copyright (C) 2005 Robert Cooper, Temple of the Screaming Penguin * Copyright (C) 2005 Robert Cooper, Temple of the Screaming Penguin
* *
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or modify it under the terms of the
* modify it under the terms of the GNU Lesser General Public * GNU Lesser General Public License as published by the Free Software Foundation; either version
* License as published by the Free Software Foundation; either * 2.1 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* but WITHOUT ANY WARRANTY; without even the implied warranty of * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public License along with this library;
* License along with this library; if not, write to the Free Software * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 02111-1307 USA
* *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* you may not use this file except in compliance with the License. * in compliance with the License. You may obtain a copy of the License at
* You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software distributed under the License
* distributed under the License is distributed on an "AS IS" BASIS, * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * or implied. See the License for the specific language governing permissions and limitations under
* See the License for the specific language governing permissions and * the License.
* limitations under the License.
*/ */
package com.rometools.modules.cc.types; package com.rometools.modules.cc.types;
@ -45,6 +40,9 @@ import java.util.Map;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.rometools.rome.feed.impl.EqualsBean; import com.rometools.rome.feed.impl.EqualsBean;
import com.rometools.rome.feed.impl.ToStringBean; import com.rometools.rome.feed.impl.ToStringBean;
@ -56,14 +54,15 @@ public class License {
private static final String CC_START = "http://creativecommons.org/licenses/"; private static final String CC_START = "http://creativecommons.org/licenses/";
private static final Map<String, License> lookupLicense = new ConcurrentHashMap<String, License>(); 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[] { public static final License NO_DERIVS = new License("http://creativecommons.org/licenses/nd/1.0/", new Behaviour[0], new Behaviour[] {
Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION}); Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION});
public static final License NO_DERIVS_NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nd-nc/1.0/", public static final License NO_DERIVS_NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nd-nc/1.0/",
new Behaviour[] {Behaviour.NONCOMMERCIAL}, new Behaviour[] {Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION}); new Behaviour[] {Behaviour.NONCOMMERCIAL}, new Behaviour[] {Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION});
public static final License NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nc/1.0/", new Behaviour[] {Behaviour.NONCOMMERCIAL}, public static final License NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nc/1.0/", new Behaviour[] {Behaviour.NONCOMMERCIAL},
new Behaviour[] {Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION}); new Behaviour[] {Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION});
public static final License SHARE_ALIKE = new License("http://creativecommons.org/licenses/sa/1.0/", new Behaviour[] { Behaviour.COPYLEFT }, public static final License SHARE_ALIKE = new License("http://creativecommons.org/licenses/sa/1.0/", new Behaviour[] {Behaviour.COPYLEFT}, new Behaviour[] {
new Behaviour[] { Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION }); Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION});
public static final License SHARE_ALIKE_NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nc-sa/1.0/", new Behaviour[] {Behaviour.COPYLEFT, public static final License SHARE_ALIKE_NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nc-sa/1.0/", new Behaviour[] {Behaviour.COPYLEFT,
Behaviour.NONCOMMERCIAL}, new Behaviour[] {Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION}); Behaviour.NONCOMMERCIAL}, new Behaviour[] {Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION});
public static final License SHARE_ALIKE_ATTRIBUTION = new License("http://creativecommons.org/licenses/by-sa/2.5/", new Behaviour[] {Behaviour.COPYLEFT, public static final License SHARE_ALIKE_ATTRIBUTION = new License("http://creativecommons.org/licenses/by-sa/2.5/", new Behaviour[] {Behaviour.COPYLEFT,
@ -75,8 +74,8 @@ public class License {
Behaviour.ATTRIBUTION, Behaviour.NONCOMMERCIAL}, new Behaviour[] {Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION}); Behaviour.ATTRIBUTION, Behaviour.NONCOMMERCIAL}, new Behaviour[] {Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION});
public static final License NONCOMMERCIAL_ATTRIBUTION_NO_DERIVS = new License("http://creativecommons.org/licenses/by-nc-nd/2.5/", new Behaviour[] { public static final License NONCOMMERCIAL_ATTRIBUTION_NO_DERIVS = new License("http://creativecommons.org/licenses/by-nc-nd/2.5/", new Behaviour[] {
Behaviour.ATTRIBUTION, Behaviour.NONCOMMERCIAL}, new Behaviour[] {Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION}); Behaviour.ATTRIBUTION, Behaviour.NONCOMMERCIAL}, new Behaviour[] {Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION});
public static final License ATTRIBUTION_NO_DERIVS = new License("http://creativecommons.org/licenses/by-nd/2.5/", public static final License ATTRIBUTION_NO_DERIVS = new License("http://creativecommons.org/licenses/by-nd/2.5/", new Behaviour[] {Behaviour.ATTRIBUTION},
new Behaviour[] { Behaviour.ATTRIBUTION }, new Behaviour[] { Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION }); new Behaviour[] {Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION});
public static final License ATTRIBUTION = new License("http://creativecommons.org/licenses/by/2.5/", new Behaviour[] {Behaviour.ATTRIBUTION}, public static final License ATTRIBUTION = new License("http://creativecommons.org/licenses/by/2.5/", new Behaviour[] {Behaviour.ATTRIBUTION},
new Behaviour[] {Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION}); new Behaviour[] {Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION});
private final String uri; private final String uri;
@ -120,7 +119,7 @@ public class License {
} }
} }
} catch (final Exception e) { } catch (final Exception e) {
e.printStackTrace(); LOG.error("Error", e);
} }
} }
} }

View file

@ -1,22 +1,21 @@
/* /*
* Copyright 2006 Marc Wick, geonames.org * Copyright 2006 Marc Wick, geonames.org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* you may not use this file except in compliance with the License. * in compliance with the License. You may obtain a copy of the License at
* You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software distributed under the License
* distributed under the License is distributed on an "AS IS" BASIS, * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * or implied. See the License for the specific language governing permissions and limitations under
* See the License for the specific language governing permissions and * the License.
* limitations under the License.
*
*/ */
package com.rometools.modules.georss; package com.rometools.modules.georss;
import org.jdom2.Namespace; import org.jdom2.Namespace;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.rometools.modules.georss.geometries.AbstractGeometry; import com.rometools.modules.georss.geometries.AbstractGeometry;
import com.rometools.modules.georss.geometries.Point; import com.rometools.modules.georss.geometries.Point;
@ -35,6 +34,8 @@ public abstract class GeoRSSModule extends ModuleImpl implements Cloneable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final Logger LOG = LoggerFactory.getLogger(GeoRSSModule.class);
protected AbstractGeometry geometry; protected AbstractGeometry geometry;
public static final String version = "0.9.8"; public static final String version = "0.9.8";
@ -118,6 +119,7 @@ public abstract class GeoRSSModule extends ModuleImpl implements Cloneable {
/* /*
* (non-Javadoc) * (non-Javadoc)
*
* @see com.rometools.rome.feed.CopyFrom#copyFrom(java.lang.Object) * @see com.rometools.rome.feed.CopyFrom#copyFrom(java.lang.Object)
*/ */
@Override @Override
@ -127,7 +129,7 @@ public abstract class GeoRSSModule extends ModuleImpl implements Cloneable {
try { try {
geometry = (AbstractGeometry) geometry.clone(); geometry = (AbstractGeometry) geometry.clone();
} catch (final CloneNotSupportedException ex) { } catch (final CloneNotSupportedException ex) {
ex.printStackTrace(); LOG.error("Error", ex);
} }
} }
@ -140,7 +142,7 @@ public abstract class GeoRSSModule extends ModuleImpl implements Cloneable {
} }
return retval; return retval;
} catch (final Exception ex) { } catch (final Exception ex) {
ex.printStackTrace(); LOG.error("Error", ex);
} }
throw new CloneNotSupportedException(); throw new CloneNotSupportedException();
} }

View file

@ -1,16 +1,13 @@
/* /*
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* you may not use this file except in compliance with the License. * in compliance with the License. You may obtain a copy of the License at
* You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software distributed under the License
* distributed under the License is distributed on an "AS IS" BASIS, * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * or implied. See the License for the specific language governing permissions and limitations under
* See the License for the specific language governing permissions and * the License.
* limitations under the License.
*
*/ */
package com.rometools.modules.opensearch.impl; package com.rometools.modules.opensearch.impl;
@ -18,6 +15,9 @@ import java.io.Serializable;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.rometools.modules.opensearch.OpenSearchModule; import com.rometools.modules.opensearch.OpenSearchModule;
import com.rometools.modules.opensearch.entity.OSQuery; import com.rometools.modules.opensearch.entity.OSQuery;
import com.rometools.rome.feed.CopyFrom; import com.rometools.rome.feed.CopyFrom;
@ -29,6 +29,7 @@ import com.rometools.rome.feed.module.ModuleImpl;
*/ */
public class OpenSearchModuleImpl extends ModuleImpl implements OpenSearchModule, Serializable { public class OpenSearchModuleImpl extends ModuleImpl implements OpenSearchModule, Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final Logger LOG = LoggerFactory.getLogger(OpenSearchModuleImpl.class);
private int totalResults = -1; private int totalResults = -1;
private int startIndex = 1; private int startIndex = 1;
private int itemsPerPage = -1; private int itemsPerPage = -1;
@ -129,6 +130,7 @@ public class OpenSearchModuleImpl extends ModuleImpl implements OpenSearchModule
/* /*
* (non-Javadoc) * (non-Javadoc)
*
* @see com.rometools.rome.feed.CopyFrom#copyFrom(java.lang.Object) * @see com.rometools.rome.feed.CopyFrom#copyFrom(java.lang.Object)
*/ */
@Override @Override
@ -142,13 +144,14 @@ public class OpenSearchModuleImpl extends ModuleImpl implements OpenSearchModule
try { try {
getQueries().add((OSQuery) q.clone()); getQueries().add((OSQuery) q.clone());
} catch (final CloneNotSupportedException e) { } catch (final CloneNotSupportedException e) {
e.printStackTrace(); LOG.error("Error", e);
} }
} }
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
*
* @see com.rometools.rome.feed.CopyFrom#getInterface() * @see com.rometools.rome.feed.CopyFrom#getInterface()
*/ */
@Override @Override

View file

@ -1,22 +1,22 @@
/* /*
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* you may not use this file except in compliance with the License. * in compliance with the License. You may obtain a copy of the License at
* You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software distributed under the License
* distributed under the License is distributed on an "AS IS" BASIS, * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * or implied. See the License for the specific language governing permissions and limitations under
* See the License for the specific language governing permissions and * the License.
* limitations under the License.
*
*/ */
package com.rometools.modules.sse.modules; package com.rometools.modules.sse.modules;
import java.util.Date; import java.util.Date;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.rometools.rome.feed.CopyFrom; import com.rometools.rome.feed.CopyFrom;
import com.rometools.rome.feed.rss.Item; import com.rometools.rome.feed.rss.Item;
@ -26,6 +26,8 @@ import com.rometools.rome.feed.rss.Item;
public class Conflict extends SSEModule { public class Conflict extends SSEModule {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final Logger LOG = LoggerFactory.getLogger(Conflict.class);
public static final String CONFLICTS_NAME = "conflicts"; public static final String CONFLICTS_NAME = "conflicts";
public static final String NAME = "conflict"; public static final String NAME = "conflict";
@ -69,7 +71,7 @@ public class Conflict extends SSEModule {
conflict.conflictItem = (Item) conflictItem.clone(); conflict.conflictItem = (Item) conflictItem.clone();
} catch (final CloneNotSupportedException e) { } catch (final CloneNotSupportedException e) {
// should not happen // should not happen
e.printStackTrace(); LOG.error("Error", e);
} }
} }

View file

@ -1,16 +1,13 @@
/* /*
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* you may not use this file except in compliance with the License. * in compliance with the License. You may obtain a copy of the License at
* You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software distributed under the License
* distributed under the License is distributed on an "AS IS" BASIS, * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * or implied. See the License for the specific language governing permissions and limitations under
* See the License for the specific language governing permissions and * the License.
* limitations under the License.
*
*/ */
package com.rometools.modules.sse.modules; package com.rometools.modules.sse.modules;
@ -19,6 +16,8 @@ import java.util.HashSet;
import java.util.Set; import java.util.Set;
import org.jdom2.Namespace; import org.jdom2.Namespace;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.rometools.rome.feed.CopyFrom; import com.rometools.rome.feed.CopyFrom;
import com.rometools.rome.feed.module.Module; import com.rometools.rome.feed.module.Module;
@ -30,6 +29,8 @@ import com.rometools.rome.feed.module.Module;
public abstract class SSEModule implements Module { public abstract class SSEModule implements Module {
private static final long serialVersionUID = 1L; 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"; public static final String SSE_SCHEMA_URI = "http://www.microsoft.com/schemas/rss/sse";
// a default prefix to use for sse tags // a default prefix to use for sse tags
@ -61,11 +62,9 @@ public abstract class SSEModule implements Module {
clone = this.getClass().newInstance(); clone = this.getClass().newInstance();
clone.copyFrom(this); clone.copyFrom(this);
} catch (final InstantiationException e) { } catch (final InstantiationException e) {
// TODO: use logging LOG.error("Error", e);
e.printStackTrace();
} catch (final IllegalAccessException e) { } catch (final IllegalAccessException e) {
// TODO: use logging LOG.error("Error", e);
e.printStackTrace();
} }
return clone; return clone;
} }