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 f008943..9d21bb4 100644 --- a/src/main/java/com/sun/syndication/feed/impl/CloneableBean.java +++ b/src/main/java/com/sun/syndication/feed/impl/CloneableBean.java @@ -23,7 +23,6 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Collection; import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Map; @@ -36,25 +35,37 @@ import org.slf4j.LoggerFactory; /** * Provides deep Bean clonning support. *
- * It works on all read/write properties, recursively. It support all primitive - * types, Strings, Collections, Cloneable objects and multi-dimensional arrays - * of any of them. + * It works on all read/write properties, recursively. It support all primitive types, Strings, Collections, Cloneable objects and multi-dimensional arrays of + * any of them. *
*
* @author Alejandro Abdelnur
*
*/
public class CloneableBean implements Serializable, Cloneable {
-
+
private static final long serialVersionUID = -6520053043831187823L;
private static final Logger LOG = LoggerFactory.getLogger(CloneableBean.class);
-
+
+ private static final Set
@@ -97,13 +108,9 @@ public class CloneableBean implements Serializable, Cloneable {
/**
* Creates a CloneableBean to be used in a delegation pattern.
*
- * The property names in the ignoreProperties Set will not be copied into
- * the cloned instance. This is useful for cases where the Bean has
- * convenience properties (properties that are actually references to other
- * properties or properties of properties). For example SyndFeed and
- * SyndEntry beans have convenience properties, publishedDate, author,
- * copyright and categories all of them mapped to properties in the DC
- * Module.
+ * The property names in the ignoreProperties Set will not be copied into the cloned instance. This is useful for cases where the Bean has convenience
+ * properties (properties that are actually references to other properties or properties of properties). For example SyndFeed and SyndEntry beans have
+ * convenience properties, publishedDate, author, copyright and categories all of them mapped to properties in the DC Module.
*
*
* @param obj object bean to clone.
@@ -122,15 +129,13 @@ public class CloneableBean implements Serializable, Cloneable {
/**
* Makes a deep bean clone of the object.
*
- * To be used by classes extending CloneableBean. Although it works also for
- * classes using CloneableBean in a delegation pattern, for correctness
- * those classes should use the
+ * To be used by classes extending CloneableBean. Although it works also for classes using CloneableBean in a delegation pattern, for correctness those
+ * classes should use the
*
* @see #beanClone() beanClone method.
*
* @return a clone of the object bean.
- * @throws CloneNotSupportedException thrown if the object bean could not be
- * cloned.
+ * @throws CloneNotSupportedException thrown if the object bean could not be cloned.
*
*/
@Override
@@ -146,8 +151,7 @@ public class CloneableBean implements Serializable, Cloneable {
* @see #CloneableBean(Object) constructor.
*
* @return a clone of the object bean.
- * @throws CloneNotSupportedException thrown if the object bean could not be
- * cloned.
+ * @throws CloneNotSupportedException thrown if the object bean could not be cloned.
*
*/
public Object beanClone() throws CloneNotSupportedException {
@@ -193,10 +197,10 @@ public class CloneableBean implements Serializable, Cloneable {
}
}
} catch (final CloneNotSupportedException e) {
- LOG.error("Error while cloning bean", e);
+ LOG.error("Error while cloning bean", e);
throw e;
} catch (final Exception e) {
- LOG.error("Error while cloning bean", e);
+ LOG.error("Error while cloning bean", e);
throw new CloneNotSupportedException("Cannot clone a " + obj.getClass() + " object");
}
return clonedBean;
@@ -207,7 +211,7 @@ public class CloneableBean implements Serializable, Cloneable {
if (value != null) {
final Class> vClass = value.getClass();
if (vClass.isArray()) {
- value = (T) cloneArray((T) value);
+ value = cloneArray(value);
} else if (value instanceof Collection) {
value = (T) cloneCollection((Collection