Fix unchecked warnings in clone()

This commit is contained in:
Sam Harwell 2012-02-23 14:03:58 -06:00
parent e400f5b1a1
commit 1e3e092326
1 changed files with 2 additions and 1 deletions

View File

@ -114,8 +114,9 @@ public class OrderedHashSet<T> extends LinkedHashSet<T> {
@Override
public Object clone() {
@SuppressWarnings("unchecked")
OrderedHashSet<T> dup = (OrderedHashSet<T>)super.clone();
dup.elements = (ArrayList<T>)this.elements.clone();
dup.elements = new ArrayList<T>(this.elements);
return dup;
}