Test code
import fj.Show;
import fj.data.Java;
import fj.data.List;
import java.util.EnumSet;
import static fj.Show.listShow;
public class Test {
public static void main(final String[] args) {
final List<Colors> colors = Java.<Colors>EnumSet_List().f(EnumSet.allOf(Colors.class));
listShow(Show.<Colors>anyShow()).print(colors);
}
enum Colors {
red, green, blue
}
}
Output
Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.Enum;
at fj.data.Java$77.f(Java.java:1781)
at fj.data.Java$77.f(Java.java:1778)
at fj.demo.Test.main(Test.java:13)
The problematic part is this: (A[]) new Object[as.size()]
Many more functions in fj.data.Java use this idiom.
Test code
Output
The problematic part is this:
(A[]) new Object[as.size()]Many more functions in fj.data.Java use this idiom.