diff --git a/runtime/Java/src/org/antlr/v4/runtime/misc/OrderedHashSet.java b/runtime/Java/src/org/antlr/v4/runtime/misc/OrderedHashSet.java index 9eddf5f79..8b88529e2 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/misc/OrderedHashSet.java +++ b/runtime/Java/src/org/antlr/v4/runtime/misc/OrderedHashSet.java @@ -114,8 +114,9 @@ public class OrderedHashSet extends LinkedHashSet { @Override public Object clone() { + @SuppressWarnings("unchecked") OrderedHashSet dup = (OrderedHashSet)super.clone(); - dup.elements = (ArrayList)this.elements.clone(); + dup.elements = new ArrayList(this.elements); return dup; }