From 5b62039b1767cf7ee761633c0894f022171d64ea Mon Sep 17 00:00:00 2001 From: Martin Kurz Date: Wed, 9 Oct 2013 18:14:53 +0200 Subject: [PATCH] error on generics changes fixed (arrays were cast as arrays of arrays) --- .../java/com/sun/syndication/feed/impl/CloneableBean.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 b777c06..b2e7474 100644 --- a/src/main/java/com/sun/syndication/feed/impl/CloneableBean.java +++ b/src/main/java/com/sun/syndication/feed/impl/CloneableBean.java @@ -201,7 +201,7 @@ public class CloneableBean implements Serializable, Cloneable { if (value != null) { final Class vClass = value.getClass(); if (vClass.isArray()) { - value = (T) cloneArray((T[]) value); + value = (T) cloneArray((T) value); } else if (value instanceof Collection) { value = (T) cloneCollection((Collection) value); } else if (value instanceof Map) { @@ -222,11 +222,11 @@ public class CloneableBean implements Serializable, Cloneable { return value; } - private T[] cloneArray(final T[] array) throws Exception { + private T cloneArray(final T array) throws Exception { final Class elementClass = array.getClass().getComponentType(); final int length = Array.getLength(array); @SuppressWarnings("unchecked") - final T[] newArray = (T[]) Array.newInstance(elementClass, length); + final T newArray = (T) Array.newInstance(elementClass, length); for (int i = 0; i < length; i++) { Array.set(newArray, i, doClone(Array.get(array, i))); }