In the Java specification (http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.9), new has the following form:
ClassInstanceCreationExpression ::=
| new TypeArguments_opt TypeDeclSpecifier TypeArgumentsOrDiamond_opt
( ArgumentListopt ) ClassBodyopt
| Primary . new TypeArguments_opt Identifier TypeArgumentsOrDiamond_opt
( ArgumentListopt ) ClassBodyopt
What is the purpose of the first optional type argument list after the new? I was not able to find it from my read of section 15.9 (all references to type arguments list seem to refer to the list after the type/identifier). Testing out random bits on the standard Java compiler yields confusing results:
public class Foo<T> { }
// ...
Foo<Integer> t1 = new <Integer> Foo<Integer>(); // works
Foo<Integer> t2 = new <Integer> Foo(); // works -- unchecked warning missing the type arg after Foo
Foo<Integer> t3 = new <Boolean> Foo<Integer>(); // works
Foo<Integer> t4 = new <Float, Boolean> Foo<Integer>(); // works
Foo<Integer> t5 = new <NotDefined> Foo<Integer>(); // fails -- NotDefined is undefined
On theses simple examples, it doesn't seem like this first parameter list does anything meaningful although it parses and checks for the validity of its arguments.