changeset 3106:15eac63a34a3

Undo local hack for TAs in lambdas in field initializers.
author wmdietl
date Mon, 16 Dec 2013 16:16:23 -0500
parents 83579eb1c8f4
children e71a15c7143d
files src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java
diffstat 1 files changed, 17 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java	Mon Dec 16 16:15:29 2013 -0500
+++ b/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java	Mon Dec 16 16:16:23 2013 -0500
@@ -346,28 +346,25 @@
                     sym.owner.type.asMethodType().recvtype = type;
                     // note that the typeAnnotations will also be added to the owner below.
                 } else {
-                    // TODO: don't do anything if sym is a lambda parameter.
-                    // How can we check for that?
-                    if (sym.owner.type != null) {
-                        MethodType methType = sym.owner.type.asMethodType();
-                        List<VarSymbol> params = ((MethodSymbol)sym.owner).params;
-                        List<Type> oldArgs = methType.argtypes;
-                        ListBuffer<Type> newArgs = new ListBuffer<Type>();
-                        boolean found = false;
-                        while (params.nonEmpty()) {
-                            if (params.head == sym) {
-                                newArgs.add(type);
-                                found = true;
-                            } else {
-                                newArgs.add(oldArgs.head);
-                            }
-                            oldArgs = oldArgs.tail;
-                            params = params.tail;
+                    MethodType methType = sym.owner.type.asMethodType();
+                    List<VarSymbol> params = ((MethodSymbol)sym.owner).params;
+                    List<Type> oldArgs = methType.argtypes;
+                    ListBuffer<Type> newArgs = new ListBuffer<Type>();
+                    boolean found = false;
+                    while (params.nonEmpty()) {
+                        if (params.head == sym) {
+                            newArgs.add(type);
+                            found = true;
+                        } else {
+                            newArgs.add(oldArgs.head);
                         }
-                        if (found) {
-                            methType.argtypes = newArgs.toList();
-                        }
+                        oldArgs = oldArgs.tail;
+                        params = params.tail;
                     }
+                    if (found) {
+                        methType.argtypes = newArgs.toList();
+                    }
+                    // Should we raise an error if !found?
                 }
             } else {
                 sym.type = type;