Hi Tristan,
that is due to the way that Java handles variadic functions. For the compiler the two following methods have the same signature:
void lala(int... values)
void lala(int[] values)
So Java thinks that
Dimension.create("bar", foo);
is equivalent to (and vice versa)
Dimension.create("bar", 1, 2, 3, 4);
You'd have to do something like this:
Dimension.create("bar", new Integer[][] { foo } );
The problem does only occur if you call "create" with one value parameter. This would also work:
Integer[] foo = new Integer[] {1, 2, 3, 4};
Integer[] bar = new Integer[] {4, 3, 2, 1};
Dimension<Integer[]> foobar = Dimension.create("foobar", foo, bar);
Cheers,
-- Richard