diff --git a/src/main/java/com/sun/syndication/feed/CopyFrom.java b/src/main/java/com/sun/syndication/feed/CopyFrom.java index ad303f4..dfd35ea 100644 --- a/src/main/java/com/sun/syndication/feed/CopyFrom.java +++ b/src/main/java/com/sun/syndication/feed/CopyFrom.java @@ -31,7 +31,7 @@ public interface CopyFrom { * * @return the interface the copyFrom works on. */ - public Class> getInterface(); + public Class> getInterface(); /** * Copies all the properties of the given bean into this one. @@ -46,6 +46,6 @@ public interface CopyFrom { * @param obj the instance to copy properties from. * */ - public void copyFrom(CopyFrom obj); + public void copyFrom(CopyFrom obj); } diff --git a/src/main/java/com/sun/syndication/feed/WireFeed.java b/src/main/java/com/sun/syndication/feed/WireFeed.java index 0a050e4..81e4722 100644 --- a/src/main/java/com/sun/syndication/feed/WireFeed.java +++ b/src/main/java/com/sun/syndication/feed/WireFeed.java @@ -43,6 +43,7 @@ import com.sun.syndication.feed.module.impl.ModuleUtils; * */ public abstract class WireFeed implements Cloneable, Serializable, Extendable { + private static final long serialVersionUID = -3608120400805691829L; private final ObjectBean objBean; private String feedType; private String encoding; diff --git a/src/main/java/com/sun/syndication/feed/atom/Category.java b/src/main/java/com/sun/syndication/feed/atom/Category.java index 5cf0e73..1ce3de9 100644 --- a/src/main/java/com/sun/syndication/feed/atom/Category.java +++ b/src/main/java/com/sun/syndication/feed/atom/Category.java @@ -27,6 +27,7 @@ import com.sun.syndication.feed.impl.ObjectBean; * @author Dave Johnson (added for Atom 1.0) */ public class Category implements Cloneable, Serializable { + private static final long serialVersionUID = -2034251366664065410L; private final ObjectBean objBean; diff --git a/src/main/java/com/sun/syndication/feed/atom/Content.java b/src/main/java/com/sun/syndication/feed/atom/Content.java index 88bd8ee..dd549d9 100644 --- a/src/main/java/com/sun/syndication/feed/atom/Content.java +++ b/src/main/java/com/sun/syndication/feed/atom/Content.java @@ -30,6 +30,7 @@ import com.sun.syndication.feed.impl.ObjectBean; * @author Dave Johnson (updated for Atom 1.0) */ public class Content implements Cloneable, Serializable { + private static final long serialVersionUID = 2036205883043031310L; private final ObjectBean objBean; diff --git a/src/main/java/com/sun/syndication/feed/atom/Generator.java b/src/main/java/com/sun/syndication/feed/atom/Generator.java index 09e698c..928709f 100644 --- a/src/main/java/com/sun/syndication/feed/atom/Generator.java +++ b/src/main/java/com/sun/syndication/feed/atom/Generator.java @@ -28,6 +28,7 @@ import com.sun.syndication.feed.impl.ObjectBean; * */ public class Generator implements Cloneable, Serializable { + private static final long serialVersionUID = -1457065669831041059L; private final ObjectBean objBean; private String url; private String version; diff --git a/src/main/java/com/sun/syndication/feed/atom/Link.java b/src/main/java/com/sun/syndication/feed/atom/Link.java index 72fa493..e42c951 100644 --- a/src/main/java/com/sun/syndication/feed/atom/Link.java +++ b/src/main/java/com/sun/syndication/feed/atom/Link.java @@ -28,6 +28,7 @@ import com.sun.syndication.feed.impl.ObjectBean; * @author Dave Johnson (updated for Atom 1.0) */ public class Link implements Cloneable, Serializable { + private static final long serialVersionUID = 670365139518027828L; private final ObjectBean objBean; diff --git a/src/main/java/com/sun/syndication/feed/impl/BeanIntrospector.java b/src/main/java/com/sun/syndication/feed/impl/BeanIntrospector.java index 43c1430..48cc71a 100644 --- a/src/main/java/com/sun/syndication/feed/impl/BeanIntrospector.java +++ b/src/main/java/com/sun/syndication/feed/impl/BeanIntrospector.java @@ -41,10 +41,10 @@ import java.util.Set; */ public class BeanIntrospector { - private static final Map introspected = new HashMap(); + private static final Map, PropertyDescriptor[]> introspected = new HashMap, PropertyDescriptor[]>(); - public static synchronized PropertyDescriptor[] getPropertyDescriptors(final Class klass) throws IntrospectionException { - PropertyDescriptor[] descriptors = (PropertyDescriptor[]) introspected.get(klass); + public static synchronized PropertyDescriptor[] getPropertyDescriptors(final Class klass) throws IntrospectionException { + PropertyDescriptor[] descriptors = introspected.get(klass); if (descriptors == null) { descriptors = getPDs(klass); introspected.put(klass, descriptors); @@ -52,11 +52,11 @@ public class BeanIntrospector { return descriptors; } - private static PropertyDescriptor[] getPDs(final Class klass) throws IntrospectionException { + private static PropertyDescriptor[] getPDs(final Class klass) throws IntrospectionException { final Method[] methods = klass.getMethods(); - final Map getters = getPDs(methods, false); - final Map setters = getPDs(methods, true); - final List pds = merge(getters, setters); + final Map getters = getPDs(methods, false); + final Map setters = getPDs(methods, true); + final List pds = merge(getters, setters); final PropertyDescriptor[] array = new PropertyDescriptor[pds.size()]; pds.toArray(array); return array; @@ -66,8 +66,8 @@ public class BeanIntrospector { private static final String GETTER = "get"; private static final String BOOLEAN_GETTER = "is"; - private static Map getPDs(final Method[] methods, final boolean setters) throws IntrospectionException { - final Map pds = new HashMap(); + private static Map getPDs(final Method[] methods, final boolean setters) throws IntrospectionException { + final Map pds = new HashMap(); for (final Method method : methods) { String pName = null; PropertyDescriptor pDescriptor = null; @@ -94,10 +94,10 @@ public class BeanIntrospector { return pds; } - private static List merge(final Map getters, final Map setters) throws IntrospectionException { - final List props = new ArrayList(); - final Set processedProps = new HashSet(); - final Iterator gs = getters.keySet().iterator(); + private static List merge(final Map getters, final Map setters) throws IntrospectionException { + final List props = new ArrayList(); + final Set processedProps = new HashSet(); + final Iterator gs = getters.keySet().iterator(); while (gs.hasNext()) { final String name = (String) gs.next(); final PropertyDescriptor getter = (PropertyDescriptor) getters.get(name); @@ -110,9 +110,9 @@ public class BeanIntrospector { props.add(getter); } } - final Set writeOnlyProps = new HashSet(setters.keySet()); + final Set writeOnlyProps = new HashSet(setters.keySet()); writeOnlyProps.removeAll(processedProps); - final Iterator ss = writeOnlyProps.iterator(); + final Iterator ss = writeOnlyProps.iterator(); while (ss.hasNext()) { final String name = (String) ss.next(); final PropertyDescriptor setter = (PropertyDescriptor) setters.get(name); diff --git a/src/main/java/com/sun/syndication/feed/impl/CopyFromHelper.java b/src/main/java/com/sun/syndication/feed/impl/CopyFromHelper.java index 2c31080..11607f6 100644 --- a/src/main/java/com/sun/syndication/feed/impl/CopyFromHelper.java +++ b/src/main/java/com/sun/syndication/feed/impl/CopyFromHelper.java @@ -100,27 +100,27 @@ public class CopyFromHelper { } @SuppressWarnings("unchecked") - private Object doCopy(Object value, final Class baseInterface) throws Exception { + private T doCopy(T value, final Class baseInterface) throws Exception { if (value != null) { final Class vClass = value.getClass(); if (vClass.isArray()) { - value = doCopyArray(value, baseInterface); + value = (T) this.doCopyArray((Object[]) value, baseInterface); } else if (value instanceof Collection) { - value = doCopyCollection((Collection) value, baseInterface); + value = (T) this.doCopyCollection((Collection) value, baseInterface); } else if (value instanceof Map) { - value = doCopyMap((Map) value, baseInterface); + value = (T) this.doCopyMap((Map) value, baseInterface); } else if (isBasicType(vClass)) { // value = value; // nothing to do here if (value instanceof Date) { // because Date it is not inmutable - value = ((Date) value).clone(); + value = (T) ((Date) value).clone(); } } else { // it goes CopyFrom if (value instanceof CopyFrom) { - final CopyFrom source = (CopyFrom) value; - CopyFrom target = createInstance(source.getInterface()); - target = target == null ? (CopyFrom) value.getClass().newInstance() : target; + final CopyFrom source = (CopyFrom) value; + CopyFrom target = (CopyFrom) createInstance(source.getInterface()); + target = target == null ? (CopyFrom) value.getClass().newInstance() : target; target.copyFrom(source); - value = target; + value = (T) target; } else { throw new Exception("unsupported class for 'copyFrom' " + value.getClass()); } @@ -129,10 +129,11 @@ public class CopyFromHelper { return value; } - private Object doCopyArray(final Object array, final Class baseInterface) throws Exception { + private T[] doCopyArray(final T[] array, final Class baseInterface) throws Exception { final Class elementClass = array.getClass().getComponentType(); final int length = Array.getLength(array); - final Object newArray = Array.newInstance(elementClass, length); + @SuppressWarnings("unchecked") + final T[] newArray = (T[]) Array.newInstance(elementClass, length); for (int i = 0; i < length; i++) { final Object element = doCopy(Array.get(array, i), baseInterface); Array.set(newArray, i, element); @@ -140,21 +141,21 @@ public class CopyFromHelper { return newArray; } - private Collection doCopyCollection(final Collection collection, final Class baseInterface) throws Exception { + private Collection doCopyCollection(final Collection collection, final Class baseInterface) throws Exception { // expecting SETs or LISTs only, going default implementation of them - final Collection newColl = collection instanceof Set ? new HashSet() : new ArrayList(); - final Iterator i = collection.iterator(); + final Collection newColl = collection instanceof Set ? new HashSet() : new ArrayList(); + final Iterator i = collection.iterator(); while (i.hasNext()) { - newColl.add(doCopy(i.next(), baseInterface)); + newColl.add(this.doCopy(i.next(), baseInterface)); } return newColl; } - private Map doCopyMap(final Map map, final Class baseInterface) throws Exception { - final Map newMap = new HashMap(); - final Iterator> entries = map.entrySet().iterator(); + private Map doCopyMap(final Map map, final Class baseInterface) throws Exception { + final Map newMap = new HashMap(); + final Iterator> entries = map.entrySet().iterator(); while (entries.hasNext()) { - final Map.Entry entry = entries.next(); + final Map.Entry entry = entries.next(); newMap.put(entry.getKey(), doCopy(entry.getValue(), baseInterface)); } return newMap; diff --git a/src/main/java/com/sun/syndication/feed/impl/EqualsBean.java b/src/main/java/com/sun/syndication/feed/impl/EqualsBean.java index cea3f78..237326b 100644 --- a/src/main/java/com/sun/syndication/feed/impl/EqualsBean.java +++ b/src/main/java/com/sun/syndication/feed/impl/EqualsBean.java @@ -37,10 +37,11 @@ import java.lang.reflect.Method; * */ public class EqualsBean implements Serializable { + private static final long serialVersionUID = 9120107899175152601L; private static final Object[] NO_PARAMS = new Object[0]; - private final Class beanClass; + private final Class beanClass; private final Object obj; /** @@ -52,7 +53,7 @@ public class EqualsBean implements Serializable { * @param beanClass the class/interface to be used for property scanning. * */ - protected EqualsBean(final Class beanClass) { + protected EqualsBean(final Class beanClass) { this.beanClass = beanClass; obj = this; } @@ -86,7 +87,7 @@ public class EqualsBean implements Serializable { * @param obj object bean to test equality. * */ - public EqualsBean(final Class beanClass, final Object obj) { + public EqualsBean(final Class beanClass, final Object obj) { if (!beanClass.isInstance(obj)) { throw new IllegalArgumentException(obj.getClass() + " is not instance of " + beanClass); } @@ -214,8 +215,8 @@ public class EqualsBean implements Serializable { private boolean doEquals(final Object obj1, final Object obj2) { boolean eq = obj1 == obj2; if (!eq && obj1 != null && obj2 != null) { - final Class classObj1 = obj1.getClass(); - final Class classObj2 = obj2.getClass(); + final Class classObj1 = obj1.getClass(); + final Class classObj2 = obj2.getClass(); if (classObj1.isArray() && classObj2.isArray()) { eq = equalsArray(obj1, obj2); } else { diff --git a/src/main/java/com/sun/syndication/feed/impl/ToStringBean.java b/src/main/java/com/sun/syndication/feed/impl/ToStringBean.java index 33dd9f0..e5d2ce7 100644 --- a/src/main/java/com/sun/syndication/feed/impl/ToStringBean.java +++ b/src/main/java/com/sun/syndication/feed/impl/ToStringBean.java @@ -23,6 +23,7 @@ import java.lang.reflect.Method; import java.util.Collection; import java.util.Iterator; import java.util.Map; +import java.util.Map.Entry; import java.util.Stack; /** @@ -37,12 +38,14 @@ import java.util.Stack; * */ public class ToStringBean implements Serializable { - private static final ThreadLocal PREFIX_TL = new ThreadLocal() { + private static final long serialVersionUID = -5850496718959612854L; + + private static final ThreadLocal> PREFIX_TL = new ThreadLocal>() { @Override - public Object get() { - Object o = super.get(); + public Stack get() { + Stack o = super.get(); if (o == null) { - o = new Stack(); + o = new Stack(); set(o); } return o; @@ -51,7 +54,7 @@ public class ToStringBean implements Serializable { private static final Object[] NO_PARAMS = new Object[0]; - private final Class beanClass; + private final Class beanClass; private final Object obj; /** @@ -64,7 +67,7 @@ public class ToStringBean implements Serializable { * interface class. * */ - protected ToStringBean(final Class beanClass) { + protected ToStringBean(final Class beanClass) { this.beanClass = beanClass; obj = this; } @@ -95,7 +98,7 @@ public class ToStringBean implements Serializable { * @param obj object bean to create String representation. * */ - public ToStringBean(final Class beanClass, final Object obj) { + public ToStringBean(final Class beanClass, final Object obj) { this.beanClass = beanClass; this.obj = obj; } @@ -111,8 +114,8 @@ public class ToStringBean implements Serializable { */ @Override public String toString() { - final Stack stack = (Stack) PREFIX_TL.get(); - final String[] tsInfo = (String[]) (stack.isEmpty() ? null : stack.peek()); + final Stack stack = PREFIX_TL.get(); + final String[] tsInfo = (stack.isEmpty() ? null : stack.peek()); String prefix; if (tsInfo == null) { final String className = obj.getClass().getName(); @@ -168,18 +171,19 @@ public class ToStringBean implements Serializable { } else if (value.getClass().isArray()) { printArrayProperty(sb, prefix, value); } else if (value instanceof Map) { - final Map map = (Map) value; - final Iterator i = map.entrySet().iterator(); + @SuppressWarnings("unchecked") + final Map map = (Map) value; + final Iterator> i = map.entrySet().iterator(); if (i.hasNext()) { while (i.hasNext()) { - final Map.Entry me = (Map.Entry) i.next(); + final Map.Entry me = i.next(); final String ePrefix = prefix + "[" + me.getKey() + "]"; final Object eValue = me.getValue(); // NEW final String[] tsInfo = new String[2]; tsInfo[0] = ePrefix; - final Stack stack = (Stack) PREFIX_TL.get(); + final Stack stack = PREFIX_TL.get(); stack.push(tsInfo); final String s = eValue != null ? eValue.toString() : "null"; stack.pop(); @@ -193,8 +197,9 @@ public class ToStringBean implements Serializable { sb.append(prefix).append("=[]\n"); } } else if (value instanceof Collection) { - final Collection collection = (Collection) value; - final Iterator i = collection.iterator(); + @SuppressWarnings("unchecked") + final Collection collection = (Collection) value; + final Iterator i = collection.iterator(); if (i.hasNext()) { int c = 0; while (i.hasNext()) { @@ -204,7 +209,7 @@ public class ToStringBean implements Serializable { // NEW final String[] tsInfo = new String[2]; tsInfo[0] = cPrefix; - final Stack stack = (Stack) PREFIX_TL.get(); + final Stack stack = PREFIX_TL.get(); stack.push(tsInfo); final String s = cValue != null ? cValue.toString() : "null"; stack.pop(); @@ -220,7 +225,7 @@ public class ToStringBean implements Serializable { } else { final String[] tsInfo = new String[2]; tsInfo[0] = prefix; - final Stack stack = (Stack) PREFIX_TL.get(); + final Stack stack = PREFIX_TL.get(); stack.push(tsInfo); final String s = value.toString(); stack.pop(); diff --git a/src/main/java/com/sun/syndication/feed/module/DCModuleImpl.java b/src/main/java/com/sun/syndication/feed/module/DCModuleImpl.java index 5e472e1..5b7017a 100644 --- a/src/main/java/com/sun/syndication/feed/module/DCModuleImpl.java +++ b/src/main/java/com/sun/syndication/feed/module/DCModuleImpl.java @@ -946,7 +946,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { } @Override - public final void copyFrom(final CopyFrom obj) { + public final void copyFrom(final CopyFrom obj) { COPY_FROM_HELPER.copy(this, obj); } diff --git a/src/main/java/com/sun/syndication/feed/module/DCSubjectImpl.java b/src/main/java/com/sun/syndication/feed/module/DCSubjectImpl.java index b8bb5d6..240be0b 100644 --- a/src/main/java/com/sun/syndication/feed/module/DCSubjectImpl.java +++ b/src/main/java/com/sun/syndication/feed/module/DCSubjectImpl.java @@ -161,7 +161,7 @@ public class DCSubjectImpl implements Cloneable, Serializable, DCSubject { } @Override - public void copyFrom(final CopyFrom obj) { + public void copyFrom(final CopyFrom obj) { COPY_FROM_HELPER.copy(this, obj); } diff --git a/src/main/java/com/sun/syndication/feed/module/ModuleImpl.java b/src/main/java/com/sun/syndication/feed/module/ModuleImpl.java index 5e97b80..5749f9e 100644 --- a/src/main/java/com/sun/syndication/feed/module/ModuleImpl.java +++ b/src/main/java/com/sun/syndication/feed/module/ModuleImpl.java @@ -29,6 +29,7 @@ import com.sun.syndication.feed.impl.ObjectBean; * */ public abstract class ModuleImpl implements Cloneable, Serializable, Module { + private static final long serialVersionUID = 3621352305155841238L; private final ObjectBean objBean; private final String uri; @@ -39,7 +40,7 @@ public abstract class ModuleImpl implements Cloneable, Serializable, Module { * @param uri URI of the module. * */ - protected ModuleImpl(final Class beanClass, final String uri) { + protected ModuleImpl(final Class beanClass, final String uri) { objBean = new ObjectBean(beanClass, this); this.uri = uri; } diff --git a/src/main/java/com/sun/syndication/feed/module/SyModuleImpl.java b/src/main/java/com/sun/syndication/feed/module/SyModuleImpl.java index 95910dc..3ba798b 100644 --- a/src/main/java/com/sun/syndication/feed/module/SyModuleImpl.java +++ b/src/main/java/com/sun/syndication/feed/module/SyModuleImpl.java @@ -37,6 +37,7 @@ import com.sun.syndication.feed.impl.CopyFromHelper; * */ public class SyModuleImpl extends ModuleImpl implements SyModule { + private static final long serialVersionUID = -8345879299577437933L; private static final Set PERIODS = new HashSet(); static { @@ -144,19 +145,19 @@ public class SyModuleImpl extends ModuleImpl implements SyModule { } @Override - public void copyFrom(final CopyFrom obj) { + public void copyFrom(final CopyFrom obj) { COPY_FROM_HELPER.copy(this, obj); } private static final CopyFromHelper COPY_FROM_HELPER; static { - final Map basePropInterfaceMap = new HashMap(); + final Map> basePropInterfaceMap = new HashMap>(); basePropInterfaceMap.put("updatePeriod", String.class); basePropInterfaceMap.put("updateFrequency", Integer.TYPE); basePropInterfaceMap.put("updateBase", Date.class); - final Map basePropClassImplMap = Collections.EMPTY_MAP; + final Map>, Class> basePropClassImplMap = Collections.>, Class>emptyMap(); COPY_FROM_HELPER = new CopyFromHelper(SyModule.class, basePropInterfaceMap, basePropClassImplMap); } diff --git a/src/main/java/com/sun/syndication/feed/rss/Category.java b/src/main/java/com/sun/syndication/feed/rss/Category.java index 3234567..c4001c0 100644 --- a/src/main/java/com/sun/syndication/feed/rss/Category.java +++ b/src/main/java/com/sun/syndication/feed/rss/Category.java @@ -29,6 +29,7 @@ import com.sun.syndication.feed.impl.ObjectBean; * */ public class Category implements Cloneable, Serializable { + private static final long serialVersionUID = -5474322292323751503L; private final ObjectBean objBean; private String domain; private String value; diff --git a/src/main/java/com/sun/syndication/feed/rss/Channel.java b/src/main/java/com/sun/syndication/feed/rss/Channel.java index 08b96ac..3583ee5 100644 --- a/src/main/java/com/sun/syndication/feed/rss/Channel.java +++ b/src/main/java/com/sun/syndication/feed/rss/Channel.java @@ -39,6 +39,7 @@ import com.sun.syndication.feed.module.impl.ModuleUtils; * */ public class Channel extends WireFeed { + private static final long serialVersionUID = 745207486449728472L; public static final String SUNDAY = "sunday"; public static final String MONDAY = "monday"; public static final String TUESDAY = "tuesday"; diff --git a/src/main/java/com/sun/syndication/feed/rss/Cloud.java b/src/main/java/com/sun/syndication/feed/rss/Cloud.java index 7d68334..ebaa52e 100644 --- a/src/main/java/com/sun/syndication/feed/rss/Cloud.java +++ b/src/main/java/com/sun/syndication/feed/rss/Cloud.java @@ -29,6 +29,7 @@ import com.sun.syndication.feed.impl.ObjectBean; * */ public class Cloud implements Cloneable, Serializable { + private static final long serialVersionUID = 7380217488816772041L; private final ObjectBean objBean; private String domain; private int port; diff --git a/src/main/java/com/sun/syndication/feed/rss/Content.java b/src/main/java/com/sun/syndication/feed/rss/Content.java index 2b6e6cb..db40376 100644 --- a/src/main/java/com/sun/syndication/feed/rss/Content.java +++ b/src/main/java/com/sun/syndication/feed/rss/Content.java @@ -29,6 +29,7 @@ import com.sun.syndication.feed.impl.ObjectBean; * */ public class Content implements Cloneable, Serializable { + private static final long serialVersionUID = -9157875649722243971L; public static final String HTML = "html"; public static final String TEXT = "text"; private final ObjectBean objBean; diff --git a/src/main/java/com/sun/syndication/feed/rss/Description.java b/src/main/java/com/sun/syndication/feed/rss/Description.java index 53faec3..ffc3f73 100644 --- a/src/main/java/com/sun/syndication/feed/rss/Description.java +++ b/src/main/java/com/sun/syndication/feed/rss/Description.java @@ -29,6 +29,7 @@ import com.sun.syndication.feed.impl.ObjectBean; * */ public class Description implements Cloneable, Serializable { + private static final long serialVersionUID = 2110945913225451453L; private final ObjectBean objBean; private String type; private String value; diff --git a/src/main/java/com/sun/syndication/feed/rss/Enclosure.java b/src/main/java/com/sun/syndication/feed/rss/Enclosure.java index e4a5442..4b9d7d3 100644 --- a/src/main/java/com/sun/syndication/feed/rss/Enclosure.java +++ b/src/main/java/com/sun/syndication/feed/rss/Enclosure.java @@ -29,6 +29,7 @@ import com.sun.syndication.feed.impl.ObjectBean; * */ public class Enclosure implements Cloneable, Serializable { + private static final long serialVersionUID = -2191354241339637856L; private final ObjectBean objBean; private String url; private long length; diff --git a/src/main/java/com/sun/syndication/feed/rss/Guid.java b/src/main/java/com/sun/syndication/feed/rss/Guid.java index 1eb2c35..8190279 100644 --- a/src/main/java/com/sun/syndication/feed/rss/Guid.java +++ b/src/main/java/com/sun/syndication/feed/rss/Guid.java @@ -29,6 +29,7 @@ import com.sun.syndication.feed.impl.ObjectBean; * */ public class Guid implements Cloneable, Serializable { + private static final long serialVersionUID = -3915169615222624604L; private final ObjectBean objBean; private boolean permaLink; private String value; diff --git a/src/main/java/com/sun/syndication/feed/rss/Image.java b/src/main/java/com/sun/syndication/feed/rss/Image.java index 78830fc..db9333c 100644 --- a/src/main/java/com/sun/syndication/feed/rss/Image.java +++ b/src/main/java/com/sun/syndication/feed/rss/Image.java @@ -28,6 +28,7 @@ import com.sun.syndication.feed.impl.ObjectBean; * */ public class Image implements Cloneable, Serializable { + private static final long serialVersionUID = 1051390283106745465L; private final ObjectBean objBean; private String title; private String url; diff --git a/src/main/java/com/sun/syndication/feed/rss/Item.java b/src/main/java/com/sun/syndication/feed/rss/Item.java index c878441..c872342 100644 --- a/src/main/java/com/sun/syndication/feed/rss/Item.java +++ b/src/main/java/com/sun/syndication/feed/rss/Item.java @@ -42,6 +42,7 @@ import com.sun.syndication.feed.module.impl.ModuleUtils; * */ public class Item implements Cloneable, Serializable, Extendable { + private static final long serialVersionUID = 3741763947754555947L; private final ObjectBean objBean; private String title; private String link; diff --git a/src/main/java/com/sun/syndication/feed/rss/Source.java b/src/main/java/com/sun/syndication/feed/rss/Source.java index 38a31f2..8eccf02 100644 --- a/src/main/java/com/sun/syndication/feed/rss/Source.java +++ b/src/main/java/com/sun/syndication/feed/rss/Source.java @@ -29,6 +29,7 @@ import com.sun.syndication.feed.impl.ObjectBean; * */ public class Source implements Cloneable, Serializable { + private static final long serialVersionUID = 7117390459877365931L; private final ObjectBean objBean; private String url; private String value; diff --git a/src/main/java/com/sun/syndication/feed/rss/TextInput.java b/src/main/java/com/sun/syndication/feed/rss/TextInput.java index 606dc94..29882a0 100644 --- a/src/main/java/com/sun/syndication/feed/rss/TextInput.java +++ b/src/main/java/com/sun/syndication/feed/rss/TextInput.java @@ -29,6 +29,7 @@ import com.sun.syndication.feed.impl.ObjectBean; * */ public class TextInput implements Cloneable, Serializable { + private static final long serialVersionUID = -3262516270222989190L; private final ObjectBean objBean; private String title; private String description; diff --git a/src/main/java/com/sun/syndication/feed/synd/SyndCategoryImpl.java b/src/main/java/com/sun/syndication/feed/synd/SyndCategoryImpl.java index 0bb5192..eca8da1 100644 --- a/src/main/java/com/sun/syndication/feed/synd/SyndCategoryImpl.java +++ b/src/main/java/com/sun/syndication/feed/synd/SyndCategoryImpl.java @@ -34,6 +34,7 @@ import com.sun.syndication.feed.module.DCSubjectImpl; * */ public class SyndCategoryImpl implements Serializable, SyndCategory { + private static final long serialVersionUID = -2151815243404151131L; private final ObjectBean objBean; private final DCSubject subject; diff --git a/src/main/java/com/sun/syndication/feed/synd/SyndContentImpl.java b/src/main/java/com/sun/syndication/feed/synd/SyndContentImpl.java index 6f0c7df..ce0f074 100644 --- a/src/main/java/com/sun/syndication/feed/synd/SyndContentImpl.java +++ b/src/main/java/com/sun/syndication/feed/synd/SyndContentImpl.java @@ -33,6 +33,7 @@ import com.sun.syndication.feed.impl.ObjectBean; * */ public class SyndContentImpl implements Serializable, SyndContent { + private static final long serialVersionUID = -8831050456661121113L; private final ObjectBean objBean; private String type; private String value; @@ -178,23 +179,23 @@ public class SyndContentImpl implements Serializable, SyndContent { } @Override - public Class getInterface() { + public Class getInterface() { return SyndContent.class; } @Override - public void copyFrom(final CopyFrom obj) { + public void copyFrom(final CopyFrom obj) { COPY_FROM_HELPER.copy(this, obj); } private static final CopyFromHelper COPY_FROM_HELPER; static { - final Map basePropInterfaceMap = new HashMap(); + final Map> basePropInterfaceMap = new HashMap>(); basePropInterfaceMap.put("type", String.class); basePropInterfaceMap.put("value", String.class); - final Map basePropClassImplMap = Collections.EMPTY_MAP; + final Map>, Class> basePropClassImplMap = Collections.>, Class>emptyMap(); COPY_FROM_HELPER = new CopyFromHelper(SyndContent.class, basePropInterfaceMap, basePropClassImplMap); } diff --git a/src/main/java/com/sun/syndication/feed/synd/SyndEnclosureImpl.java b/src/main/java/com/sun/syndication/feed/synd/SyndEnclosureImpl.java index 3d986b3..0e66cc1 100644 --- a/src/main/java/com/sun/syndication/feed/synd/SyndEnclosureImpl.java +++ b/src/main/java/com/sun/syndication/feed/synd/SyndEnclosureImpl.java @@ -154,7 +154,7 @@ public class SyndEnclosureImpl implements Serializable, SyndEnclosure { } @Override - public void copyFrom(final CopyFrom obj) { + public void copyFrom(final CopyFrom obj) { COPY_FROM_HELPER.copy(this, obj); } diff --git a/src/main/java/com/sun/syndication/feed/synd/SyndEntryImpl.java b/src/main/java/com/sun/syndication/feed/synd/SyndEntryImpl.java index 20bb33f..b5d02f2 100644 --- a/src/main/java/com/sun/syndication/feed/synd/SyndEntryImpl.java +++ b/src/main/java/com/sun/syndication/feed/synd/SyndEntryImpl.java @@ -489,7 +489,7 @@ public class SyndEntryImpl implements Serializable, SyndEntry { } @Override - public void copyFrom(final CopyFrom obj) { + public void copyFrom(final CopyFrom obj) { COPY_FROM_HELPER.copy(this, obj); } diff --git a/src/main/java/com/sun/syndication/feed/synd/SyndFeedImpl.java b/src/main/java/com/sun/syndication/feed/synd/SyndFeedImpl.java index 335f86e..4881d4b 100644 --- a/src/main/java/com/sun/syndication/feed/synd/SyndFeedImpl.java +++ b/src/main/java/com/sun/syndication/feed/synd/SyndFeedImpl.java @@ -52,6 +52,7 @@ import com.sun.syndication.feed.synd.impl.URINormalizer; * */ public class SyndFeedImpl implements Serializable, SyndFeed { + private static final long serialVersionUID = -2529165503200548045L; private final ObjectBean objBean; @@ -102,7 +103,7 @@ public class SyndFeedImpl implements Serializable, SyndFeed { * @return the real feed type supported. */ @Override - public List getSupportedFeedTypes() { + public List getSupportedFeedTypes() { return CONVERTERS.getSupportedFeedTypes(); } @@ -117,7 +118,7 @@ public class SyndFeedImpl implements Serializable, SyndFeed { * CloneableBean for details). * */ - protected SyndFeedImpl(final Class beanClass, final Set convenienceProperties) { + protected SyndFeedImpl(final Class beanClass, final Set convenienceProperties) { objBean = new ObjectBean(beanClass, this, convenienceProperties); } @@ -779,12 +780,12 @@ public class SyndFeedImpl implements Serializable, SyndFeed { } @Override - public Class getInterface() { + public Class getInterface() { return SyndFeed.class; } @Override - public void copyFrom(final CopyFrom obj) { + public void copyFrom(final CopyFrom obj) { COPY_FROM_HELPER.copy(this, obj); } @@ -793,7 +794,7 @@ public class SyndFeedImpl implements Serializable, SyndFeed { private static final CopyFromHelper COPY_FROM_HELPER; static { - final Map basePropInterfaceMap = new HashMap(); + final Map> basePropInterfaceMap = new HashMap>(); basePropInterfaceMap.put("feedType", String.class); basePropInterfaceMap.put("encoding", String.class); basePropInterfaceMap.put("uri", String.class); @@ -804,7 +805,7 @@ public class SyndFeedImpl implements Serializable, SyndFeed { basePropInterfaceMap.put("entries", SyndEntry.class); basePropInterfaceMap.put("modules", Module.class); - final Map basePropClassImplMap = new HashMap(); + final Map>, Class> basePropClassImplMap = new HashMap>, Class>(); basePropClassImplMap.put(SyndEntry.class, SyndEntryImpl.class); basePropClassImplMap.put(SyndImage.class, SyndImageImpl.class); basePropClassImplMap.put(DCModule.class, DCModuleImpl.class); diff --git a/src/main/java/com/sun/syndication/feed/synd/SyndImageImpl.java b/src/main/java/com/sun/syndication/feed/synd/SyndImageImpl.java index 416e1d2..84059ce 100644 --- a/src/main/java/com/sun/syndication/feed/synd/SyndImageImpl.java +++ b/src/main/java/com/sun/syndication/feed/synd/SyndImageImpl.java @@ -205,7 +205,7 @@ public class SyndImageImpl implements Serializable, SyndImage { } @Override - public void copyFrom(final CopyFrom syndImage) { + public void copyFrom(final CopyFrom syndImage) { COPY_FROM_HELPER.copy(this, syndImage); } diff --git a/src/main/java/com/sun/syndication/feed/synd/impl/Converters.java b/src/main/java/com/sun/syndication/feed/synd/impl/Converters.java index 1b0a7f4..ec84f05 100644 --- a/src/main/java/com/sun/syndication/feed/synd/impl/Converters.java +++ b/src/main/java/com/sun/syndication/feed/synd/impl/Converters.java @@ -25,7 +25,7 @@ import com.sun.syndication.io.impl.PluginManager; * Created by IntelliJ IDEA. User: tucu Date: May 21, 2004 Time: 5:26:04 PM To * change this template use Options | File Templates. */ -public class Converters extends PluginManager { +public class Converters extends PluginManager { /** * Converter.classes= [className] ... @@ -38,15 +38,15 @@ public class Converters extends PluginManager { } public Converter getConverter(final String feedType) { - return (Converter) getPlugin(feedType); + return getPlugin(feedType); } @Override - protected String getKey(final Object obj) { - return ((Converter) obj).getType(); + protected String getKey(final Converter obj) { + return obj.getType(); } - public List getSupportedFeedTypes() { + public List getSupportedFeedTypes() { return getKeys(); } diff --git a/src/main/java/com/sun/syndication/io/impl/FeedGenerators.java b/src/main/java/com/sun/syndication/io/impl/FeedGenerators.java index 2dc8364..09cb59f 100644 --- a/src/main/java/com/sun/syndication/io/impl/FeedGenerators.java +++ b/src/main/java/com/sun/syndication/io/impl/FeedGenerators.java @@ -53,8 +53,8 @@ public class FeedGenerators extends PluginManager { } @Override - protected String getKey(final Object obj) { - return ((WireFeedGenerator) obj).getType(); + protected String getKey(final WireFeedGenerator obj) { + return obj.getType(); } public List getSupportedFeedTypes() { diff --git a/src/main/java/com/sun/syndication/io/impl/FeedParsers.java b/src/main/java/com/sun/syndication/io/impl/FeedParsers.java index 868e7b5..b345071 100644 --- a/src/main/java/com/sun/syndication/io/impl/FeedParsers.java +++ b/src/main/java/com/sun/syndication/io/impl/FeedParsers.java @@ -83,8 +83,8 @@ public class FeedParsers extends PluginManager { } @Override - protected String getKey(final Object obj) { - return ((WireFeedParser) obj).getType(); + protected String getKey(final WireFeedParser obj) { + return obj.getType(); } } diff --git a/src/main/java/com/sun/syndication/io/impl/ModuleGenerators.java b/src/main/java/com/sun/syndication/io/impl/ModuleGenerators.java index f1732f7..0ff3fcb 100644 --- a/src/main/java/com/sun/syndication/io/impl/ModuleGenerators.java +++ b/src/main/java/com/sun/syndication/io/impl/ModuleGenerators.java @@ -41,8 +41,8 @@ public class ModuleGenerators extends PluginManager { } @Override - protected String getKey(final Object obj) { - return ((ModuleGenerator) obj).getNamespaceUri(); + protected String getKey(final ModuleGenerator obj) { + return obj.getNamespaceUri(); } public List getModuleNamespaces() { diff --git a/src/main/java/com/sun/syndication/io/impl/ModuleParsers.java b/src/main/java/com/sun/syndication/io/impl/ModuleParsers.java index 032a43b..6a1cbfd 100644 --- a/src/main/java/com/sun/syndication/io/impl/ModuleParsers.java +++ b/src/main/java/com/sun/syndication/io/impl/ModuleParsers.java @@ -34,8 +34,8 @@ public class ModuleParsers extends PluginManager { } @Override - public String getKey(final Object obj) { - return ((ModuleParser) obj).getNamespaceUri(); + public String getKey(final ModuleParser obj) { + return obj.getNamespaceUri(); } public List getModuleNamespaces() { diff --git a/src/main/java/com/sun/syndication/io/impl/PluginManager.java b/src/main/java/com/sun/syndication/io/impl/PluginManager.java index fd448ee..8082ce5 100644 --- a/src/main/java/com/sun/syndication/io/impl/PluginManager.java +++ b/src/main/java/com/sun/syndication/io/impl/PluginManager.java @@ -63,7 +63,7 @@ public abstract class PluginManager { keys = Collections.unmodifiableList(new ArrayList(pluginsMap.keySet())); } - protected abstract String getKey(Object obj); + protected abstract String getKey(T obj); protected List getKeys() { return keys;