I don\'t understand why the following does not work:
public void doSomething(int... args){ List broken = new ArrayList(Arrays
In this case, autoboxing (automatic conversion from int to Integer) doesn't work. You have to add each int manually to the list.
int
Integer
If you need code like that often, consider using commons lang which has org.apache.commons.lang.ArrayUtils.toObject(int[])
org.apache.commons.lang.ArrayUtils.toObject(int[])