6 Answers
6

This is the way to go... But you still lose type-safety by doing this... I think it would be more appropriate to use new Map[list.size()], this way any Map added to the list will go just fine.
–
Alex CalugarescuJun 7 '12 at 5:16

In a nutshell, you can't make arrays of concrete parameterized types. This is a pretty good explanation of what's going on. The Spring type is essentially the same as saying Map batchValues. The parameter types are for documentation only. This gaping hole in the Java type system is a tradeoff for performance.

Hu? That spring function does something completely different. The problem which prevent the original author from doing what he want, is is that the generic part of the type don't exists at runtime. So you can't create a new object of the same type.
–
MTilstedJun 7 '12 at 8:20