diff --git a/classlib/src/main/java/org/teavm/classlib/java/util/TSpliterators.java b/classlib/src/main/java/org/teavm/classlib/java/util/TSpliterators.java index 7fc2a4b84..28accc844 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/util/TSpliterators.java +++ b/classlib/src/main/java/org/teavm/classlib/java/util/TSpliterators.java @@ -57,10 +57,9 @@ public class TSpliterators { } }; } - - @SuppressWarnings("unchecked") + public static TSpliterator spliterator(Collection c, int characteristics) { - return ((TCollection) c).spliterator(); + return spliterator(c.iterator(), c.size(), characteristics); } public static TSpliterator.OfInt spliterator(int[] array, int additionalCharacteristics) {