diff options
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/com/jogamp/common/util/ArrayHashSet.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/java/com/jogamp/common/util/ArrayHashSet.java b/src/java/com/jogamp/common/util/ArrayHashSet.java index 0f5f65b..630e2af 100644 --- a/src/java/com/jogamp/common/util/ArrayHashSet.java +++ b/src/java/com/jogamp/common/util/ArrayHashSet.java @@ -94,8 +94,7 @@ public class ArrayHashSet<E> * @return a shallow copy of this ArrayHashSet, elements are not copied. */ public final Object clone() { - @SuppressWarnings("unchecked") - ArrayList<E> clonedList = (ArrayList<E>)data.clone(); + ArrayList<E> clonedList = new ArrayList<E>(data); ArrayHashSet<E> newObj = new ArrayHashSet<E>(); newObj.addAll(clonedList); @@ -375,9 +374,8 @@ public class ArrayHashSet<E> /** * @return a shallow copy of this ArrayHashSet's ArrayList, elements are not copied. */ - @SuppressWarnings("unchecked") public final ArrayList<E> toArrayList() { - return (ArrayList<E>) data.clone(); + return new ArrayList<E>(data); } /** |