No built-in int[] to List

The following creates a List<int[]> as if int[] were int[][]
Arrays.asList(int[])

Must:

int[] ints = new int[] {1,2,3};
final ArrayList<Integer> list =
new ArrayList<Integer>(ints.length);
for (final int i : ints) {
list.add(ints[i]); //autoboxing
}
return Collections.unmodifiableList(list);

Comments

Popular posts from this blog

Sites, Newsletters, and Blogs

Oracle JDBC ReadTimeout QueryTimeout

Locks held on Oracle for hours after sessions abnormally terminated by node failure