--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Wed Jul 27 19:00:53 2011 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Wed Jul 27 19:01:08 2011 +0100
@@ -1837,7 +1837,7 @@
try {
constructor = rs.resolveDiamond(tree.pos(),
localEnv,
- clazztype.tsym.type,
+ clazztype,
argtypes,
typeargtypes);
} finally {
@@ -2872,8 +2872,10 @@
if (clazztype.tag == CLASS) {
List<Type> formals = clazztype.tsym.type.getTypeArguments();
-
- if (actuals.length() == formals.length() || actuals.length() == 0) {
+ if (actuals.isEmpty()) //diamond
+ actuals = formals;
+
+ if (actuals.length() == formals.length()) {
List<Type> a = actuals;
List<Type> f = formals;
while (a.nonEmpty()) {