changeset 1145:a4fc85ec18eb

Implement parser changes to support C#-like syntax for lambda expressions. Examples: x -> x + 1 (x) -> x + 1 (int x) -> x + 1 (int x, int y) -> x + y (x, y) -> x + y (x, y) -> { System.out.printf("%d + %d = %d%n", x, y, x+y); } () -> { System.out.println("I am a Runnable"); } Note: 'thin' arrow is still used (instead of 'fat' (=>) arrow a la C#). This will be a topic for further refinement.
author mcimadamore
date Fri, 09 Sep 2011 14:19:45 +0100
parents a2d6528a494d
children c2ce16bef6f9
files src/share/classes/com/sun/tools/javac/parser/JavacParser.java src/share/classes/com/sun/tools/javac/parser/Scanner.java src/share/classes/com/sun/tools/javac/parser/Token.java src/share/classes/com/sun/tools/javac/resources/compiler.properties test/tools/javac/api/TestJavacTaskScanner.java test/tools/javac/defender/Pos01.java test/tools/javac/diags/examples.not-yet.txt test/tools/javac/lambda/BadAccess.java test/tools/javac/lambda/BadAccess.out test/tools/javac/lambda/BadAccess02.java test/tools/javac/lambda/BadAccess02.out test/tools/javac/lambda/BadAccess03.java test/tools/javac/lambda/BadAccess03.out test/tools/javac/lambda/BadBreakContinue.java test/tools/javac/lambda/BadBreakContinue.out test/tools/javac/lambda/BadConv03.java test/tools/javac/lambda/BadConv04.java test/tools/javac/lambda/BadLambdaPos.java test/tools/javac/lambda/BadLambdaToken.java test/tools/javac/lambda/BadLambdaToken.out test/tools/javac/lambda/BadReturn.java test/tools/javac/lambda/BadReturn.out test/tools/javac/lambda/BadStatementInLambda.java test/tools/javac/lambda/BadStatementInLambda.out test/tools/javac/lambda/BadStatementInLambda02.java test/tools/javac/lambda/BadStatementInLambda02.out test/tools/javac/lambda/BadTargetType.java test/tools/javac/lambda/Conformance01.java test/tools/javac/lambda/Defender01.java test/tools/javac/lambda/ExceptionTransparency01.java test/tools/javac/lambda/ExceptionTransparency02.java test/tools/javac/lambda/ExceptionTransparency03.java test/tools/javac/lambda/ExceptionTransparency04.java test/tools/javac/lambda/LambdaCapture01.java test/tools/javac/lambda/LambdaCapture02.java test/tools/javac/lambda/LambdaCapture03.java test/tools/javac/lambda/LambdaCapture04.java test/tools/javac/lambda/LambdaCapture05.java test/tools/javac/lambda/LambdaConv01.java test/tools/javac/lambda/LambdaConv03.java test/tools/javac/lambda/LambdaConv05.java test/tools/javac/lambda/LambdaConv06.java test/tools/javac/lambda/LambdaConv08.java test/tools/javac/lambda/LambdaConv09.java test/tools/javac/lambda/LambdaConv10.java test/tools/javac/lambda/LambdaConv11.java test/tools/javac/lambda/LambdaConv12.java test/tools/javac/lambda/LambdaConv13.java test/tools/javac/lambda/LambdaConv16.java test/tools/javac/lambda/LambdaConv17.java test/tools/javac/lambda/LambdaConv19.java test/tools/javac/lambda/LambdaConversionTest.java test/tools/javac/lambda/LambdaExpr01.java test/tools/javac/lambda/LambdaExpr02.java test/tools/javac/lambda/LambdaExpr04.java test/tools/javac/lambda/LambdaExpr05.java test/tools/javac/lambda/LambdaExpr06.java test/tools/javac/lambda/LambdaExpr07.java test/tools/javac/lambda/LambdaExpr08.java test/tools/javac/lambda/LambdaExpr09.java test/tools/javac/lambda/LambdaExpr10.java test/tools/javac/lambda/LambdaExprNotVoid.java test/tools/javac/lambda/LambdaScope01.java test/tools/javac/lambda/LambdaScope02.java test/tools/javac/lambda/LambdaScope03.java test/tools/javac/lambda/LocalBreakAndContinue.java test/tools/javac/lambda/MethodReference12.java test/tools/javac/lambda/NakedThis.java test/tools/javac/lambda/SourceLevelTest.java test/tools/javac/lambda/TargetType01.java test/tools/javac/lambda/TargetType02.java test/tools/javac/lambda/TargetType03.java test/tools/javac/lambda/TargetType04.java test/tools/javac/lambda/TargetType05.java test/tools/javac/lambda/TargetType06.java test/tools/javac/lambda/TargetType07.java test/tools/javac/lambda/TargetType08.java test/tools/javac/lambda/TargetType10.java test/tools/javac/lambda/TargetType11.java test/tools/javac/lambda/TargetType12.java test/tools/javac/lambda/TargetType13.java test/tools/javac/lambda/TargetType14.java test/tools/javac/lambda/TargetType15.java test/tools/javac/lambda/TargetType16.java test/tools/javac/lambda/TargetType17.java test/tools/javac/lambda/TargetType18.java test/tools/javac/lambda/TargetType19.java test/tools/javac/lambda/TargetType20.java test/tools/javac/lambda/TargetType21.java test/tools/javac/lambda/TargetType22.java test/tools/javac/lambda/TargetType23.java test/tools/javac/lambda/TargetType24.java test/tools/javac/lambda/TargetType24.out test/tools/javac/lambda/TargetType25.java test/tools/javac/lambda/TargetType26.java test/tools/javac/lambda/TargetType27.java test/tools/javac/lambda/TargetType28.java test/tools/javac/lambda/TargetType29.java test/tools/javac/lambda/sqe/SAM_types/LambdaTest1.java test/tools/javac/lambda/sqe/SAM_types/LambdaTest1_neg1.java test/tools/javac/lambda/sqe/SAM_types/LambdaTest1_neg1.out test/tools/javac/lambda/sqe/SAM_types/LambdaTest1_neg2.java test/tools/javac/lambda/sqe/SAM_types/LambdaTest1_neg3.java test/tools/javac/lambda/sqe/SAM_types/LambdaTest2_SAM1.java test/tools/javac/lambda/sqe/SAM_types/LambdaTest2_SAM2.java test/tools/javac/lambda/sqe/SAM_types/LambdaTest2_neg1.java test/tools/javac/lambda/sqe/SAM_types/NonSAM1.java test/tools/javac/lambda/sqe/SAM_types/NonSAM3.java test/tools/javac/lambda/sqe/lambdaExpression/AbstractClass_neg.java test/tools/javac/lambda/sqe/lambdaExpression/AccessNonStatic_neg.java test/tools/javac/lambda/sqe/lambdaExpression/AccessNonStatic_neg.out test/tools/javac/lambda/sqe/lambdaExpression/EffectivelyFinal_neg.java test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression1.java test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression3.java test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression4.java test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression5.java test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression6.java test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression6.out test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest1.java test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest2.java test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest3.java test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest4.java test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest5.java test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest6.java
diffstat 124 files changed, 663 insertions(+), 809 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Fri Sep 09 14:19:45 2011 +0100
@@ -902,12 +902,25 @@
                 }
             } else return illegal();
             break;
-        case LAMBDA:
-        case HASH:
-            t = lambdaExpressionOrStatement();
-            break;
         case LPAREN:
-            if (typeArgs == null && (mode & EXPR) != 0) {
+            //is it a lambda?
+            S.pushState();
+            S.nextToken();
+            int depth = 0;
+            while ((S.token() != RPAREN || depth > 0) &&
+                    S.token() != EOF) {
+                if (S.token() == RPAREN) {
+                    depth--;
+                }
+                S.nextToken();
+            }
+            accept(RPAREN);
+            if (S.token() == ARROW) {
+                S.popState();
+                t = lambdaExpressionOrStatement();
+            } else {
+                S.popState();
+                if (typeArgs == null && (mode & EXPR) != 0) {
                 S.pushState();
                 S.nextToken();
                 mode = EXPR | TYPE | NOPARAMS | NOLAMBDA;
@@ -973,7 +986,7 @@
                     case INTLITERAL: case LONGLITERAL: case FLOATLITERAL:
                     case DOUBLELITERAL: case CHARLITERAL: case STRINGLITERAL:
                     case TRUE: case FALSE: case NULL:
-                        case NEW: case IDENTIFIER: case HASH: case LAMBDA: case ASSERT: case ENUM:
+                        case NEW: case IDENTIFIER: case HASH: case ASSERT: case ENUM:
                     case BYTE: case SHORT: case CHAR: case INT:
                     case LONG: case FLOAT: case DOUBLE: case BOOLEAN: case VOID:
                         JCExpression t1 = term3();
@@ -982,6 +995,7 @@
                 }
             } else return illegal();
             t = toP(F.at(pos).Parens(t));
+            }
             break;
         case THIS:
             if ((mode & EXPR) != 0) {
@@ -1023,131 +1037,136 @@
             break;
         case IDENTIFIER: case ASSERT: case ENUM:
             if (typeArgs != null) return illegal();
-            t = toP(F.at(S.pos()).Ident(ident()));
-            loop: while (true) {
-                pos = S.pos();
-                switch (S.token()) {
-                case LBRACKET:
-                    S.nextToken();
-                    if (S.token() == RBRACKET) {
+            if ((mode & EXPR) != 0 &&
+                    S.peekToken() == ARROW) {
+                t = lambdaExpressionOrStatement();
+            } else {
+                t = toP(F.at(S.pos()).Ident(ident()));
+                loop: while (true) {
+                    pos = S.pos();
+                    switch (S.token()) {
+                    case LBRACKET:
                         S.nextToken();
-                        t = bracketsOpt(t);
-                        t = toP(F.at(pos).TypeArray(t));
-                        t = bracketsSuffix(t);
-                    } else {
+                        if (S.token() == RBRACKET) {
+                            S.nextToken();
+                            t = bracketsOpt(t);
+                            t = toP(F.at(pos).TypeArray(t));
+                            t = bracketsSuffix(t);
+                        } else {
+                            if ((mode & EXPR) != 0) {
+                                mode = EXPR;
+                                JCExpression t1 = term();
+                                t = to(F.at(pos).Indexed(t, t1));
+                            }
+                            accept(RBRACKET);
+                        }
+                        break loop;
+                    case LPAREN:
                         if ((mode & EXPR) != 0) {
                             mode = EXPR;
-                            JCExpression t1 = term();
-                            t = to(F.at(pos).Indexed(t, t1));
+                            t = arguments(typeArgs, t);
+                            typeArgs = null;
                         }
-                        accept(RBRACKET);
-                    }
-                    break loop;
-                case LPAREN:
-                    if ((mode & EXPR) != 0) {
-                        mode = EXPR;
-                        t = arguments(typeArgs, t);
-                        typeArgs = null;
-                    }
-                    break loop;
-                case DOT:
-                    S.nextToken();
-                    int oldmode = mode;
-                    mode &= ~NOPARAMS;
-                    typeArgs = typeArgumentsOpt(EXPR);
-                    mode = oldmode;
-                    if ((mode & EXPR) != 0) {
-                        switch (S.token()) {
-                        case CLASS:
-                            if (typeArgs != null) return illegal();
-                            mode = EXPR;
-                            t = to(F.at(pos).Select(t, names._class));
-                            S.nextToken();
-                            break loop;                        
-                        case THIS:
-                            if (typeArgs != null) return illegal();
-                            mode = EXPR;
-                            t = to(F.at(pos).Select(t, names._this));
-                            S.nextToken();
-                            break loop;
-                        case SUPER:
-                            mode = EXPR;
-                            t = to(F.at(pos).Select(t, names._super));
-                            t = superSuffix(typeArgs, t, pos);
-                            typeArgs = null;
-                            break loop;
-                        case NEW:
-                            if (typeArgs != null) return illegal();
-                            mode = EXPR;
-                            int pos1 = S.pos();
-                            S.nextToken();
-                            if (S.token() == LT) typeArgs = typeArguments(false);
-                            t = innerCreator(pos1, typeArgs, t);
-                            typeArgs = null;
-                            break loop;
-                        default:
-                            break;
-                        }
-                    }
-                    // typeArgs saved for next loop iteration.
-                    t = toP(F.at(pos).Select(t, ident()));
-                    break;
-                case LT:
-                    if ((mode & NOLAMBDA) == 0) {
-                        S.pushState();
-                        int oldPos = S.pos();
+                        break loop;
+                    case DOT:
                         S.nextToken();
-                        int prevMode = mode;
-                        mode |= EXPR | TYPE | TYPEARG| NOLAMBDA | DISJOINT;
-                        JCExpression t1 = term3();
-                        if ((mode & TYPE) != 0 &&
-                            (S.token() == COMMA || S.token() == GT)) {
-                            mode = prevMode;
-                            checkGenerics(oldPos);
-                            mode = TYPE;
-                            ListBuffer<JCExpression> args = new ListBuffer<JCExpression>();
-                            args.append(t1);
-                            while (S.token() == COMMA) {
+                        int oldmode = mode;
+                        mode &= ~NOPARAMS;
+                        typeArgs = typeArgumentsOpt(EXPR);
+                        mode = oldmode;
+                        if ((mode & EXPR) != 0) {
+                            switch (S.token()) {
+                            case CLASS:
+                                if (typeArgs != null) return illegal();
+                                mode = EXPR;
+                                t = to(F.at(pos).Select(t, names._class));
                                 S.nextToken();
-                                args.append(typeArgument());
-                            }
-                            if (S.token() == GT) {
-                                accept(GT);
-                                S.mergeState();
-                                t = toP(F.at(pos).TypeApply(t, args.toList()));
-                                if (S.token() == DOT) {
-                                    S.mergeState();
-                                    S.pushState();
-                                    accept(DOT);
-                                    if (S.token() == HASH) {
-                                        S.mergeState();
-                                        accept(HASH);
-                                        t = memberReferenceSuffix(S.pos(), t);
-                                        break loop;
-                                    }
-                                    S.popState();
-                                }
+                                break loop;                        
+                            case THIS:
+                                if (typeArgs != null) return illegal();
+                                mode = EXPR;
+                                t = to(F.at(pos).Select(t, names._this));
+                                S.nextToken();
+                                break loop;
+                            case SUPER:
+                                mode = EXPR;
+                                t = to(F.at(pos).Select(t, names._super));
+                                t = superSuffix(typeArgs, t, pos);
+                                typeArgs = null;
+                                break loop;
+                            case NEW:
+                                if (typeArgs != null) return illegal();
+                                mode = EXPR;
+                                int pos1 = S.pos();
+                                S.nextToken();
+                                if (S.token() == LT) typeArgs = typeArguments(false);
+                                t = innerCreator(pos1, typeArgs, t);
+                                typeArgs = null;
+                                break loop;
+                            default:
                                 break;
                             }
                         }
+                        // typeArgs saved for next loop iteration.
+                        t = toP(F.at(pos).Select(t, ident()));
+                        break;
+                    case LT:
+                        if ((mode & NOLAMBDA) == 0) {
+                            S.pushState();
+                            int oldPos = S.pos();
+                            S.nextToken();
+                            int prevMode = mode;
+                            mode |= EXPR | TYPE | TYPEARG| NOLAMBDA | DISJOINT;
+                            JCExpression t1 = term3();
+                            if ((mode & TYPE) != 0 &&
+                                (S.token() == COMMA || S.token() == GT)) {
+                                mode = prevMode;
+                                checkGenerics(oldPos);
+                                mode = TYPE;
+                                ListBuffer<JCExpression> args = new ListBuffer<JCExpression>();
+                                args.append(t1);
+                                while (S.token() == COMMA) {
+                                    S.nextToken();
+                                    args.append(typeArgument());
+                                }
+                                if (S.token() == GT) {
+                                    accept(GT);
+                                    S.mergeState();
+                                    t = toP(F.at(pos).TypeApply(t, args.toList()));
+                                    if (S.token() == DOT) {
+                                        S.mergeState();
+                                        S.pushState();
+                                        accept(DOT);
+                                        if (S.token() == HASH) {
+                                            S.mergeState();
+                                            accept(HASH);
+                                            t = memberReferenceSuffix(S.pos(), t);
+                                            break loop;
+                                        }
+                                        S.popState();
+                                    }
+                                    break;
+                                }
+                            }
+                            mode = EXPR;
+                            S.popState();
+                        }
+                        break loop;
+                    case HASH:
                         mode = EXPR;
-                        S.popState();
+                        if (typeArgs != null) return illegal();
+                        accept(HASH);
+                        t = memberReferenceSuffix(S.pos(), t);
+                        break loop;
+                    default:
+                        break loop;
                     }
-                    break loop;
-                case HASH:
-                    mode = EXPR;
-                    if (typeArgs != null) return illegal();
-                    accept(HASH);
-                    t = memberReferenceSuffix(S.pos(), t);
-                    break loop;
-                default:
-                    break loop;
                 }
             }
             if (typeArgs != null) illegal();            
             if ((mode & NOLAMBDA) != 0) {
                 t = typeArgumentsOpt(t);
-            }            
+            }
             break;
         case BYTE: case SHORT: case CHAR: case INT: case LONG: case FLOAT:
         case DOUBLE: case BOOLEAN:
@@ -1265,87 +1284,25 @@
     }
 
     JCExpression lambdaExpressionOrStatement(int pos) {
-        if (S.token() == HASH) {
-            log.error(pos, "bad.lambda.token", LAMBDA);
-            accept(HASH);
-        }
-        return lambdaExpressionOrStatement(pos, isLambdaWithArgs());
-    }
-
-    boolean isLambdaWithArgs() {
-        S.pushState();
-        boolean arrowFound = false;
-        int depth = 0;
-        S.nextToken();
-        loop: while (S.token() != EOF) {
-            switch (S.token()) {
-                case LAMBDA: depth++; break;
-                case LBRACE: depth++; break;
-                case RBRACE: 
-                    if (depth == 0) {
-                        break loop;
-                    } else {
-                        depth--;
-                        break;
-                    }
-                case ARROW:
-                    if (depth == 0) {
-                        arrowFound = true;
-                        break loop;
-                    } else {
-                        break;
-                    }
-            }
-            S.nextToken();
-        }
-        S.popState();
-        return arrowFound;
-    }
-
-    @SuppressWarnings("fallthrough")
-    JCExpression lambdaExpressionOrStatement(int pos, boolean hasArgs) {
         mode = EXPR;
         checkLambda();
         int pos2 = S.pos();
-        if (S.token() == LBRACE ||
-                S.token() == LAMBDA) {
-            S.nextToken();
+        List<JCVariableDecl> args = List.nil();
+        if (S.token() == LPAREN) {
+            args = formalParameters(true);
+        } else {
+            args = List.of(variableDeclaratorId(F.at(pos).Modifiers(0), null));
+        }
 
-            List<JCVariableDecl> args = List.nil();
-            if (hasArgs) {
-                args = formalParameters(true);
-            }
-
-            S.pushState();
-            boolean isBlock = false;
-
-            if (S.token() == RBRACE) {
-                //empty block
-                isBlock = true;
-            }
-            else {
-                StatementKind sk = statementKind();
-                switch (sk) {
-                    case STATEMENT: isBlock = true; break;
-                    case EXPRESSION_STATEMENT:
-                    case EXPRESSION:
-                        parseExpression();
-                        isBlock = S.token() != RBRACE;
-                        break;
-                }
-            }
-            S.popState();
-
-            return isBlock ?
-                lambdaStatement(args, pos, pos2) :
-                lambdaExpression(args, pos);
-        }
-        else {
-            return syntaxError("expected", LBRACE);
-        }
+        accept(ARROW);
+        
+        return S.token() == LBRACE ?
+            lambdaStatement(args, pos, pos2) :
+            lambdaExpression(args, pos);
     }
 
     JCExpression lambdaStatement(List<JCVariableDecl> args, int pos, int pos2) {
+        accept(LBRACE);
         JCBlock block = block(pos2, 0, true);
         accept(RBRACE);
         return toP(F.at(pos).Lambda(args, block));
@@ -1353,7 +1310,6 @@
 
     JCExpression lambdaExpression(List<JCVariableDecl> args, int pos) {
         JCTree expr = parseExpression();
-        accept(RBRACE);
         return toP(F.at(pos).Lambda(args, expr));
     }
 
@@ -1932,53 +1888,6 @@
         }
     }
 
-    enum StatementKind {
-        ERRONEOUS,
-        STATEMENT,
-        EXPRESSION,
-        EXPRESSION_STATEMENT;
-    }
-
-    @SuppressWarnings("fallthrough")
-    StatementKind statementKind() {
-        switch (S.token()) {
-            case LBRACE: case IF: case FOR: case WHILE: case DO: case TRY:
-            case SWITCH: case SYNCHRONIZED: case RETURN: case THROW: case BREAK:
-            case CONTINUE: case SEMI: case ELSE: case FINALLY: case CATCH:
-            case INTERFACE: case CLASS: case MONKEYS_AT: case FINAL:
-            case ABSTRACT: case STRICTFP:
-                return StatementKind.STATEMENT;
-            case ENUM:
-            case ASSERT:
-                if (allowEnums && S.token() == ENUM) {
-                    return StatementKind.ERRONEOUS;
-                } else if (allowAsserts && S.token() == ASSERT) {
-                    return StatementKind.STATEMENT;
-                }
-            /* fall through to default */
-            default:
-                try {
-                    S.pushState();
-                    JCExpression t = term(EXPR | TYPE);
-                    if (S.token() == COLON && t.getTag() == JCTree.IDENT) {
-                        return StatementKind.STATEMENT;
-                    } else if ((lastmode & TYPE) != 0 &&
-                               (S.token() == IDENTIFIER ||
-                                S.token() == ASSERT ||
-                                S.token() == ENUM)) {
-                        return StatementKind.STATEMENT;
-                    } else {
-                        return isExpressionStatement(t) ?
-                            StatementKind.EXPRESSION_STATEMENT :
-                            StatementKind.EXPRESSION;
-                    }
-                }
-                finally {
-                    S.popState();
-                }
-        }
-    }
-
     /** Statement =
      *       Block
      *     | IF ParExpression Statement [ELSE Statement]
@@ -3124,10 +3033,11 @@
     List<JCVariableDecl> formalParameters(boolean lambda) {
         ListBuffer<JCVariableDecl> params = new ListBuffer<JCVariableDecl>();
         JCVariableDecl lastParam = null;
-        if (!lambda) {
+        Token endOfArgs = lambda ? ARROW : RPAREN;
+        if (!lambda || S.token() == LPAREN) {
             accept(LPAREN);
+            endOfArgs = RPAREN;
         }
-        Token endOfArgs = lambda ? ARROW : RPAREN;
         if (S.token() != endOfArgs) {
             params.append(lastParam = formalParameter(lambda));
             while ((lastParam.mods.flags & Flags.VARARGS) == 0 && S.token() == COMMA) {
@@ -3157,7 +3067,7 @@
         JCExpression type = parseType();
         if (lambda && (
                 S.token() == COMMA ||
-                S.token() == ARROW)) {
+                S.token() == RPAREN)) {
             S.popState();
             return variableDeclaratorId(mods, null);
         }
@@ -3202,22 +3112,6 @@
         }
     }
 
-    protected boolean isExpressionStatement(JCExpression t) {
-        switch(t.getTag()) {
-            case JCTree.PREINC: case JCTree.PREDEC:
-            case JCTree.POSTINC: case JCTree.POSTDEC:
-            case JCTree.ASSIGN:
-            case JCTree.BITOR_ASG: case JCTree.BITXOR_ASG: case JCTree.BITAND_ASG:
-            case JCTree.SL_ASG: case JCTree.SR_ASG: case JCTree.USR_ASG:
-            case JCTree.PLUS_ASG: case JCTree.MINUS_ASG:
-            case JCTree.MUL_ASG: case JCTree.DIV_ASG: case JCTree.MOD_ASG:
-            case JCTree.APPLY: case JCTree.NEWCLASS:
-            case JCTree.ERRONEOUS:
-                return true;
-            default: return false;
-        }
-    }
-
     /** Return precedence of operator represented by token,
      *  -1 if token is not a binary operator. @see TreeInfo.opPrec
      */
--- a/src/share/classes/com/sun/tools/javac/parser/Scanner.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/src/share/classes/com/sun/tools/javac/parser/Scanner.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1038,13 +1038,7 @@
                     return;
                 case '#':
                     scanChar();
-                    if (ch == '{') {
-                        scanChar();
-                        token = LAMBDA;
-                    } else if (allowMethodReferences && scanOperator('#')) {
-                    } else {
-                        token = HASH;
-                    }
+                    token = HASH;
                     return;
                 default:
                     if (isSpecial(ch)) {
--- a/src/share/classes/com/sun/tools/javac/parser/Token.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/src/share/classes/com/sun/tools/javac/parser/Token.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -111,7 +111,6 @@
     COMMA(","),
     DOT("."),
     HASH("#"),
-    LAMBDA("#{"),
     ARROW("->"),
     ELLIPSIS("..."),
     EQ("="),
--- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Tue Sep 06 11:34:14 2011 +0100
+++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Fri Sep 09 14:19:45 2011 +0100
@@ -649,9 +649,6 @@
 compiler.err.not.encl.class=\
     not an enclosing class: {0}
 
-compiler.err.bad.lambda.token=\
-    A lambda expression must be start with the ''{0}'' token (no separators)
-
 # 0: name, 1: type, 2: unused
 compiler.err.operator.cant.be.applied=\
     bad operand type {1} for unary operator ''{0}''
--- a/test/tools/javac/api/TestJavacTaskScanner.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/api/TestJavacTaskScanner.java	Fri Sep 09 14:19:45 2011 +0100
@@ -38,6 +38,7 @@
 import java.nio.*;
 import java.nio.charset.Charset;
 import java.util.Arrays;
+import java.util.Stack;
 import javax.lang.model.element.Element;
 import javax.lang.model.element.TypeElement;
 import javax.lang.model.type.DeclaredType;
@@ -91,7 +92,7 @@
         System.out.println("#parseTypeElements: " + numParseTypeElements);
         System.out.println("#allMembers: " + numAllMembers);
 
-        check(numTokens, "#Tokens", 1222);
+        check(numTokens, "#Tokens", 1398);
         check(numParseTypeElements, "#parseTypeElements", 136);
         check(numAllMembers, "#allMembers", 67);
     }
@@ -169,6 +170,8 @@
 }
 
 class MyScanner extends Scanner {
+    
+    Stack<Integer> tokens = new Stack<Integer>();
 
     public static class Factory extends ScannerFactory {
         public Factory(Context context, TestJavacTaskScanner test) {
@@ -204,10 +207,37 @@
         this.test = test;
     }
 
+    @Override
+    public void pushState() {
+        super.pushState();
+        tokens.push(0);
+    }
+    
+    @Override
+    public void popState() {
+        super.popState();
+        tokens.pop();
+    }
+
+    @Override
+    public void mergeState() {
+        super.mergeState();
+        if (tokens.size() > 1) {
+            int i = tokens.pop();
+            tokens.push(tokens.pop() + i);
+        } else if (tokens.size() == 1) {
+            test.numTokens += tokens.pop();
+        }
+    }
+
     public void nextToken() {
         super.nextToken();
         System.err.format("Saw token %s (%s)%n", token(), name());
-        test.numTokens++;
+        if (tokens.size() == 0) {
+            test.numTokens++;
+        } else {
+            tokens.push(tokens.pop() + 1);
+        }
     }
 
     private TestJavacTaskScanner test;
--- a/test/tools/javac/defender/Pos01.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/defender/Pos01.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,7 +46,7 @@
     public static void main(String[] args) {
        MyList<Integer> l = new MyList<Integer>();
        l.add(1); l.add(2); l.add(3);
-       l.map(#{ Integer x -> x * x });
+       l.map((Integer x) -> x * x );
     }
 
     static <T> List<T> listMapper(List<T> l, Mapper<T> mapper) {
--- a/test/tools/javac/diags/examples.not-yet.txt	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/diags/examples.not-yet.txt	Fri Sep 09 14:19:45 2011 +0100
@@ -116,7 +116,6 @@
 compiler.warn.unknown.enum.constant                     # in bad class file
 compiler.warn.unknown.enum.constant.reason              # in bad class file
 compiler.err.bad.defender.method.body                                            #LAMBDA
-compiler.err.bad.lambda.token                                                    #LAMBDA
 compiler.err.break.inside.lambda                                                 #LAMBDA
 compiler.err.cant.access.argtype.in.sam.desc                                     #LAMBDA
 compiler.err.cant.access.return.in.sam.desc                                      #LAMBDA
--- a/test/tools/javac/lambda/BadAccess.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadAccess.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,12 +40,12 @@
     static void test1() {
         int l = 0; //effectively final
         final int L = 0;
-        SAM s = #{ i + I + l + L };
+        SAM s = ()-> i + I + l + L;
     }
 
     void test2() {
         int l = 0; //effectively final
         final int L = 0;
-        SAM s = #{ i + I + l + L };
+        SAM s = ()-> i + I + l + L;
     }
 }
--- a/test/tools/javac/lambda/BadAccess.out	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadAccess.out	Fri Sep 09 14:19:45 2011 +0100
@@ -1,2 +1,2 @@
-BadAccess.java:43:20: compiler.err.non-static.cant.be.ref: kindname.variable, i
+BadAccess.java:43:22: compiler.err.non-static.cant.be.ref: kindname.variable, i
 1 error
--- a/test/tools/javac/lambda/BadAccess02.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadAccess02.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
         int j = 0; //non-effectively final
         j = 2;
         final int L = 0;
-        SAM s = #{ int h -> int k = 0; return h + j + l + L; };
+        SAM s = (int h) -> { int k = 0; return h + j + l + L; };
     }
 
     void test2() {
@@ -47,6 +47,6 @@
         int j = 0; //non-effectively final
         j = 2;
         final int L = 0;
-        SAM s = #{ int h -> int k = 0; return h + k + j + l + L; };
+        SAM s = (int h) -> { int k = 0; return h + k + j + l + L; };
     }
 }
--- a/test/tools/javac/lambda/BadAccess02.out	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadAccess02.out	Fri Sep 09 14:19:45 2011 +0100
@@ -1,3 +1,3 @@
-BadAccess02.java:42:51: compiler.err.cant.ref.non.effectively.final.var: j
-BadAccess02.java:50:55: compiler.err.cant.ref.non.effectively.final.var: j
+BadAccess02.java:42:52: compiler.err.cant.ref.non.effectively.final.var: j
+BadAccess02.java:50:56: compiler.err.cant.ref.non.effectively.final.var: j
 2 errors
--- a/test/tools/javac/lambda/BadAccess03.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadAccess03.java	Fri Sep 09 14:19:45 2011 +0100
@@ -31,6 +31,6 @@
     void test() {
         int k = 0;
         int n = 2; //effectively final variable
-	Runnable r = #{	k = n; }; //error
+	Runnable r = ()-> { k = n; }; //error
     }
 }
--- a/test/tools/javac/lambda/BadAccess03.out	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadAccess03.out	Fri Sep 09 14:19:45 2011 +0100
@@ -1,2 +1,2 @@
-BadAccess03.java:34:25: compiler.err.cant.ref.non.effectively.final.var: k
+BadAccess03.java:34:29: compiler.err.cant.ref.non.effectively.final.var: k
 1 error
--- a/test/tools/javac/lambda/BadBreakContinue.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadBreakContinue.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,20 +34,20 @@
        void m();
     }
 
-    SAM s1 = #{ break; };
-    SAM s2 = #{ continue; };
-    SAM s3 = #{
-        SAM s3_1 = #{ break; };
-        SAM s3_2 = #{ continue; };
+    SAM s1 = ()-> { break; };
+    SAM s2 = ()-> { continue; };
+    SAM s3 = ()-> {
+        SAM s3_1 = ()-> { break; };
+        SAM s3_2 = ()-> { continue; };
     };
 
     void test() {
         loop: while (true) {
-            SAM s1 = #{ break loop; };
-            SAM s2 = #{ continue loop; };
-            SAM s3 = #{
-                SAM s3_1 = #{ break loop; };
-                SAM s3_2 = #{ continue loop; };
+            SAM s1 = ()-> { break loop; };
+            SAM s2 = ()-> { continue loop; };
+            SAM s3 = ()-> {
+                SAM s3_1 = ()-> { break loop; };
+                SAM s3_2 = ()-> { continue loop; };
             };
         }
     }
--- a/test/tools/javac/lambda/BadBreakContinue.out	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadBreakContinue.out	Fri Sep 09 14:19:45 2011 +0100
@@ -1,9 +1,9 @@
-BadBreakContinue.java:37:17: compiler.err.break.inside.lambda
-BadBreakContinue.java:38:17: compiler.err.cont.inside.lambda
-BadBreakContinue.java:40:23: compiler.err.break.inside.lambda
-BadBreakContinue.java:41:23: compiler.err.cont.inside.lambda
-BadBreakContinue.java:46:25: compiler.err.undef.label: loop
-BadBreakContinue.java:47:25: compiler.err.undef.label: loop
-BadBreakContinue.java:49:31: compiler.err.undef.label: loop
-BadBreakContinue.java:50:31: compiler.err.undef.label: loop
+BadBreakContinue.java:37:21: compiler.err.break.inside.lambda
+BadBreakContinue.java:38:21: compiler.err.cont.inside.lambda
+BadBreakContinue.java:40:27: compiler.err.break.inside.lambda
+BadBreakContinue.java:41:27: compiler.err.cont.inside.lambda
+BadBreakContinue.java:46:29: compiler.err.undef.label: loop
+BadBreakContinue.java:47:29: compiler.err.undef.label: loop
+BadBreakContinue.java:49:35: compiler.err.undef.label: loop
+BadBreakContinue.java:50:35: compiler.err.undef.label: loop
 8 errors
--- a/test/tools/javac/lambda/BadConv03.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadConv03.java	Fri Sep 09 14:19:45 2011 +0100
@@ -37,5 +37,5 @@
         void a(int i);
     }
 
-    B b = #{ };
+    B b = ()-> { };
 }
--- a/test/tools/javac/lambda/BadConv04.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadConv04.java	Fri Sep 09 14:19:45 2011 +0100
@@ -39,5 +39,5 @@
 
     interface SAM extends I1, I2 {}
 
-    SAM s = #{ };
+    SAM s = ()-> { };
 }
--- a/test/tools/javac/lambda/BadLambdaPos.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadLambdaPos.java	Fri Sep 09 14:19:45 2011 +0100
@@ -36,17 +36,17 @@
     void test(Object x) {}
 
     void test1() {
-        test(#{ int x -> } + #{ int x -> } );
-        test(#{ int x -> } instanceof Object );
+        test((int x)-> { } + (int x)-> { } );
+        test((int x)-> { } instanceof Object );
     }
 
     void test2() {
-        int i2 = #{ int x -> } + #{ int x -> };
-        boolean b = #{ int x -> } instanceof Object;
+        int i2 = (int x)-> { } + (int x)-> { };
+        boolean b = (int x)-> { } instanceof Object;
     }
 
     void test3() {
-        test((Object)#{ int x -> });
-        Object o = (Object)#{ int x -> };
+        test((Object)(int x)-> { });
+        Object o = (Object)(int x)-> { };
     }
 }
--- a/test/tools/javac/lambda/BadLambdaToken.java	Tue Sep 06 11:34:14 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary check that lambda expression starts with '#{' (no separators)
- * @author  Maurizio Cimadamore
- * @compile/fail/ref=BadLambdaToken.out -XDrawDiagnostics BadLambdaToken.java
- *
- */
-class BadLambdaToken {
-
-    interface SAM {
-        void m(Integer x);
-    }
-
-    void test() {
-        SAM s = # { int x -> };
-        SAM s = #
-                { int x -> };
-    }
-}
--- a/test/tools/javac/lambda/BadLambdaToken.out	Tue Sep 06 11:34:14 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-BadLambdaToken.java:38:17: compiler.err.bad.lambda.token: #{
-BadLambdaToken.java:39:17: compiler.err.bad.lambda.token: #{
-2 errors
--- a/test/tools/javac/lambda/BadReturn.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadReturn.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
     }
 
     static void testNeg1() {
-        SAM s = #{
+        SAM s = ()-> {
             if (true) {
                 return "";
             } else {
@@ -44,11 +44,11 @@
     }
 
     static void testNeg2() {
-        SAM s = #{ return System.out.println(""); };
+        SAM s = ()-> { return System.out.println(""); };
     }
 
     static void testPos() {
-        SAM s = #{
+        SAM s = ()-> {
             if (false) {
                 return 10;
             }
--- a/test/tools/javac/lambda/BadReturn.out	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadReturn.out	Fri Sep 09 14:19:45 2011 +0100
@@ -1,3 +1,3 @@
 BadReturn.java:42:42: compiler.err.cant.ret.void.expr
-BadReturn.java:47:45: compiler.err.cant.ret.void.expr
+BadReturn.java:47:49: compiler.err.cant.ret.void.expr
 2 errors
--- a/test/tools/javac/lambda/BadStatementInLambda.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadStatementInLambda.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@
         Object m();
     }
 
-    SAM t1 = #{ null; };
-    SAM t2 = #{ 1; };
-    SAM t3 = #{ 1 + 5; };
+    SAM t1 = ()-> { null; };
+    SAM t2 = ()-> { 1; };
+    SAM t3 = ()-> { 1 + 5; };
 }
--- a/test/tools/javac/lambda/BadStatementInLambda.out	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadStatementInLambda.out	Fri Sep 09 14:19:45 2011 +0100
@@ -1,4 +1,4 @@
-BadStatementInLambda.java:37:17: compiler.err.not.stmt
-BadStatementInLambda.java:38:17: compiler.err.not.stmt
-BadStatementInLambda.java:39:19: compiler.err.not.stmt
+BadStatementInLambda.java:37:21: compiler.err.not.stmt
+BadStatementInLambda.java:38:21: compiler.err.not.stmt
+BadStatementInLambda.java:39:23: compiler.err.not.stmt
 3 errors
--- a/test/tools/javac/lambda/BadStatementInLambda02.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadStatementInLambda02.java	Fri Sep 09 14:19:45 2011 +0100
@@ -34,7 +34,7 @@
         void m();
     }
 
-    { call(#{ -> System.out.println(new NonExistentClass() + ""); }); }
+    { call(()-> { System.out.println(new NonExistentClass() + ""); }); }
 
     void call(SAM s) { }
 }
--- a/test/tools/javac/lambda/BadStatementInLambda02.out	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadStatementInLambda02.out	Fri Sep 09 14:19:45 2011 +0100
@@ -1,2 +1,2 @@
-BadStatementInLambda02.java:37:41: compiler.err.cant.resolve: kindname.class, NonExistentClass, , 
+BadStatementInLambda02.java:37:42: compiler.err.cant.resolve: kindname.class, NonExistentClass, , 
 1 error
--- a/test/tools/javac/lambda/BadTargetType.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/BadTargetType.java	Fri Sep 09 14:19:45 2011 +0100
@@ -34,11 +34,11 @@
     static void m1(Object o) {}
     void m2(Object o) {}
 
-    static Object l1 = #{ int pos -> };
-    Object l2 = #{ int pos -> };
+    static Object l1 = (int pos)-> { };
+    Object l2 = (int pos)-> { };
 
     {
-        m1(#{ int pos -> });
-        m2(#{ int pos -> });
+        m1((int pos)-> { });
+        m2((int pos)-> { });
     }
 }
--- a/test/tools/javac/lambda/Conformance01.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/Conformance01.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/test/tools/javac/lambda/Defender01.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/Defender01.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,5 +39,5 @@
         static void n(A a){};
     }
 
-    A t = #{ null };
+    A t = ()-> null;
 }
--- a/test/tools/javac/lambda/ExceptionTransparency01.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/ExceptionTransparency01.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@
 
     static void test(final boolean cond) {
         try {
-            call(#{ if (cond) throw new A(); else throw new B();});
+            call(()-> { if (cond) throw new A(); else throw new B();});
         }
         catch (final A|B ex) {
             CatchNumber catchNumber = ex.getClass().getAnnotation(CatchNumber.class);
--- a/test/tools/javac/lambda/ExceptionTransparency02.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/ExceptionTransparency02.java	Fri Sep 09 14:19:45 2011 +0100
@@ -39,16 +39,16 @@
     public static <throws E> void m2(Block<E> block1, Block<E> block2) throws E {}
 
     public static void main(String[] args) {
-        m1(#{ } );
-        m2(#{ }, #{ });
+        m1(()-> { } );
+        m2(()-> { }, ()-> { });
         try {
-            m2(#{ throw new A(); }, #{ });
-            m2(#{ }, #{ throw new A(); });
+            m2(()-> { throw new A(); }, ()-> { });
+            m2(()-> { }, ()-> { throw new A(); });
         }
         catch (A a) {}
         try {
-            m2(#{ throw new A(); }, #{ throw new B(); });
-            m2(#{ throw new B(); }, #{ throw new A(); });
+            m2(()-> { throw new A(); }, ()-> { throw new B(); });
+            m2(()-> { throw new B(); }, ()-> { throw new A(); });
         }
         catch (final A | B ex) {}
     }
--- a/test/tools/javac/lambda/ExceptionTransparency03.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/ExceptionTransparency03.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,8 +40,8 @@
     static abstract class IntSortableList extends AbstractList<Integer> implements SortableList<Integer> { }
 
     void test(IntSortableList isl) {
-        isl.forEach((Func<Integer,Integer, Exception>)#{ i -> throw new Exception(); } );
-        isl.forEach(  #{ i -> throw new Exception(); } );
-        isl.<Exception>forEach( #{ i -> throw new Exception(); } );
+        isl.forEach((Func<Integer,Integer, Exception>)i -> { throw new Exception(); } );
+        isl.forEach( i -> { throw new Exception(); });
+        isl.<Exception>forEach( i -> { throw new Exception(); } );
     }
 }
--- a/test/tools/javac/lambda/ExceptionTransparency04.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/ExceptionTransparency04.java	Fri Sep 09 14:19:45 2011 +0100
@@ -39,11 +39,11 @@
     <throws Z> SAM<Z> call(SAM<Z> s) { return null; }
 
     void test() {
-        SAM<?> s1 = call(#{ if (true) throw new IOException(); else throw new ClassNotFoundException(); });
-        SAM<ClassNotFoundException> s2 = call(#{ if (true) throw new IOException(); else throw new ClassNotFoundException(); });
-        SAM<IOException> s3 = call(#{ if (true) throw new IOException(); else throw new ClassNotFoundException(); });
-        SAM<IOException|ClassNotFoundException> s4 = call(#{ if (true) throw new IOException(); else throw new ClassNotFoundException(); });
-        SAM<ClassNotFoundException|IOException> s5 = call(#{ if (true) throw new IOException(); else throw new ClassNotFoundException(); });
-        SAM<ClassNotFoundException|FileNotFoundException> s6 = call(#{ if (true) throw new IOException(); else throw new ClassNotFoundException(); });
+        SAM<?> s1 = call(()-> { if (true) throw new IOException(); else throw new ClassNotFoundException(); });
+        SAM<ClassNotFoundException> s2 = call(()-> { if (true) throw new IOException(); else throw new ClassNotFoundException(); });
+        SAM<IOException> s3 = call(()-> { if (true) throw new IOException(); else throw new ClassNotFoundException(); });
+        SAM<IOException|ClassNotFoundException> s4 = call(()-> { if (true) throw new IOException(); else throw new ClassNotFoundException(); });
+        SAM<ClassNotFoundException|IOException> s5 = call(()-> { if (true) throw new IOException(); else throw new ClassNotFoundException(); });
+        SAM<ClassNotFoundException|FileNotFoundException> s6 = call(()-> { if (true) throw new IOException(); else throw new ClassNotFoundException(); });
     }
 }
--- a/test/tools/javac/lambda/LambdaCapture01.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaCapture01.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,7 @@
     //Simple local capture
     void test1() {
         final int N = 1;
-        int x = LambdaCapture01.<Integer,Integer>exec(#{ Integer x -> x + N }, 3);
+        int x = LambdaCapture01.<Integer,Integer>exec((Integer x) -> x + N, 3);
         assertTrue(4 == x);
     }
 
@@ -66,7 +66,7 @@
         new Tester() {
             public void test() {
                 final int M = 2;
-                int x = LambdaCapture01.<Integer,Integer>exec(#{ Integer x -> x + N + M }, 3);
+                int x = LambdaCapture01.<Integer,Integer>exec((Integer x) -> x + N + M, 3);
                 assertTrue(6 == x);
             }
         }.test();
@@ -78,7 +78,7 @@
         class MyTester implements Tester {
             public void test() {
                 final int M = 2;
-                int x = LambdaCapture01.<Integer,Integer>exec(#{ Integer x -> x + N + M }, 3);
+                int x = LambdaCapture01.<Integer,Integer>exec((Integer x) -> x + N + M, 3);
                 assertTrue(6 == x);
             }
         }
@@ -88,9 +88,9 @@
     //access to field from enclosing scope
     void test4() {
         final int N = 4;
-        int x1 = LambdaCapture01.<Integer,Integer>exec(#{ Integer x -> x + n + N }, 3);
+        int x1 = LambdaCapture01.<Integer,Integer>exec((Integer x) -> x + n + N, 3);
         assertTrue(12 == x1);
-        int x2 = LambdaCapture01.<Integer,Integer>exec(#{ Integer x -> x + LambdaCapture01.this.n + N }, 3);
+        int x2 = LambdaCapture01.<Integer,Integer>exec((Integer x) -> x + LambdaCapture01.this.n + N, 3);
         assertTrue(12 == x2);
     }
 
--- a/test/tools/javac/lambda/LambdaCapture02.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaCapture02.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,7 @@
     //Simple local capture
     void test1() {
         final Integer N = 1;
-        int x = LambdaCapture02.<Integer,Integer>exec(#{ Integer x -> x + N }, 3);
+        int x = LambdaCapture02.<Integer,Integer>exec((Integer x) -> x + N, 3);
         assertTrue(4 == x);
     }
 
@@ -66,7 +66,7 @@
         new Tester() {
             public void test() {
                 final Integer M = 2;
-                int x = LambdaCapture02.<Integer,Integer>exec(#{ Integer x -> x + N + M }, 3);
+                int x = LambdaCapture02.<Integer,Integer>exec((Integer x) -> x + N + M, 3);
                 assertTrue(6 == x);
             }
         }.test();
@@ -78,7 +78,7 @@
         class MyTester implements Tester {
             public void test() {
                 final Integer M = 2;
-                int x = LambdaCapture02.<Integer,Integer>exec(#{ Integer x -> x + N + M }, 3);
+                int x = LambdaCapture02.<Integer,Integer>exec((Integer x) -> x + N + M, 3);
                 assertTrue(6 == x);
             }
         }
@@ -88,9 +88,9 @@
     //access to field from enclosing scope
     void test4() {
         final Integer N = 4;
-        int x1 = LambdaCapture02.<Integer,Integer>exec(#{ Integer x -> x + n + N }, 3);
+        int x1 = LambdaCapture02.<Integer,Integer>exec((Integer x) -> x + n + N, 3);
         assertTrue(12 == x1);
-        int x2 = LambdaCapture02.<Integer,Integer>exec(#{ Integer x -> x + LambdaCapture02.this.n + N }, 3);
+        int x2 = LambdaCapture02.<Integer,Integer>exec((Integer x) -> x + LambdaCapture02.this.n + N, 3);
         assertTrue(12 == x2);
     }
 
--- a/test/tools/javac/lambda/LambdaCapture03.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaCapture03.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,7 @@
                   class B {
                        void test() {
                            final Integer N3 = 3;
-                           int x = LambdaCapture03.exec(#{ Integer x -> x + n1 + n2 + N1 + N2 + N3 }, 30);
+                           int x = LambdaCapture03.exec((Integer x) -> x + n1 + n2 + N1 + N2 + N3, 30);
                            assertTrue(x == 66);
                        }
                   }
@@ -80,7 +80,7 @@
                 new Tester() {
                     public void test() {
                         final Integer N3 = 3;
-                        int x = LambdaCapture03.exec(#{ Integer x -> x + n1 + n2 + N1 + N2 + N3 }, 30);
+                        int x = LambdaCapture03.exec((Integer x) -> x + n1 + n2 + N1 + N2 + N3, 30);
                         assertTrue(x == 66);
                     }
                 }.test();
--- a/test/tools/javac/lambda/LambdaCapture04.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaCapture04.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -62,7 +62,7 @@
                   class B {
                        void test() {
                            final Integer N3 = 3;
-                           exec(#{ final Integer x -> new Tester() { public void test() { assertTrue(x + n1 + n2 + N1 + N2 + N3 == 66); } }.test()},30);
+                           exec((final Integer x) -> new Tester() { public void test() { assertTrue(x + n1 + n2 + N1 + N2 + N3 == 66); } }.test(),30);
                        }
                   }
                   new B().test();
@@ -80,11 +80,12 @@
                   class B {
                        void test() {
                            final Integer N3 = 3;
-                           exec(#{ final Integer x ->
+                           exec((final Integer x) -> {
                                class LocTester implements Tester {
                                    public void test() { assertTrue(x + n1 + n2 + N1 + N2 + N3 == 66); }
                                };
-                               new LocTester().test();},30);
+                               new LocTester().test();
+                           },30);
                        }
                   }
                   new B().test();
@@ -102,7 +103,7 @@
                 new Tester() {
                     public void test() {
                         final Integer N3 = 3;
-                        exec(#{ final Integer x -> new Tester() { public void test() { assertTrue(x + n1 + n2 + N1 + N2 + N3 == 66); } }.test()},30);
+                        exec((final Integer x) -> new Tester() { public void test() { assertTrue(x + n1 + n2 + N1 + N2 + N3 == 66); } }.test(),30);
                     }
                 }.test();
             }
@@ -118,11 +119,12 @@
                 new Tester() {
                     public void test() {
                         final Integer N3 = 3;
-                        exec(#{ final Integer x ->
+                        exec((final Integer x) -> {
                             class LocTester implements Tester {
                                 public void test() { assertTrue(x + n1 + n2 + N1 + N2 + N3 == 66); }
                             };
-                            new LocTester().test();},30);
+                            new LocTester().test();
+                        },30);
                     }
                 }.test();
             }
--- a/test/tools/javac/lambda/LambdaCapture05.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaCapture05.java	Fri Sep 09 14:19:45 2011 +0100
@@ -49,19 +49,19 @@
     int i = 40;
 
     void test1(final int a0) {
-        exec(#{ final Integer a1 ->
-            final Integer x2 = 10; exec(#{ final Integer a2 ->
+        exec((final Integer a1) -> {
+            final Integer x2 = 10; exec((final Integer a2) -> {
                 final Integer x3 = 20;
-                exec(#{ final Integer a3 -> assertTrue(106 == (a0 + a1 + a2 + a3 + x2 + x3 + i))},3);
+                exec((final Integer a3) -> assertTrue(106 == (a0 + a1 + a2 + a3 + x2 + x3 + i)),3);
             },2);
         },1);
     }
 
     static void test2(final int a0) {
-        exec(#{ final Integer a1 ->
-            final Integer x2 = 10; exec(#{ final Integer a2 ->
+        exec((final Integer a1) -> {
+            final Integer x2 = 10; exec((final Integer a2) -> {
                 final Integer x3 = 20;
-                exec(#{ final Integer a3 -> assertTrue(66 == (a0 + a1 + a2 + a3 + x2 + x3))}, 3);
+                exec((final Integer a3) -> assertTrue(66 == (a0 + a1 + a2 + a3 + x2 + x3)), 3);
             }, 2);
         }, 1);
     }
--- a/test/tools/javac/lambda/LambdaConv01.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaConv01.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,17 +61,17 @@
 
     static {
         //Assignment conversion:
-        VoidToInt f1 = #{3};
+        VoidToInt f1 = ()-> 3;
         assertTrue(3 == f1.foo());
         //Covariant returns:
-        TU<Number, Integer> f2 = #{ Integer x -> x };
+        TU<Number, Integer> f2 = (Integer x) -> x;
         assertTrue(3 == f2.foo(3));
         //Method resolution with boxing:
-        int x = LambdaConv01.<Integer,Integer>exec(#{ Integer x -> x }, 3);
+        int x = LambdaConv01.<Integer,Integer>exec((Integer x) -> x, 3);
         assertTrue(3 == x);
         //Runtime exception transparency:
         try {
-            LambdaConv01.<Integer,Object>exec(#{ Object x -> x.hashCode() }, null);
+            LambdaConv01.<Integer,Object>exec((Object x) -> x.hashCode(), null);
         }
         catch (RuntimeException e) {
             assertTrue(true);
@@ -80,17 +80,17 @@
 
     {
         //Assignment conversion:
-        VoidToInt f1 = #{3};
+        VoidToInt f1 = ()-> 3;
         assertTrue(3 == f1.foo());
         //Covariant returns:
-        TU<Number, Integer> f2 = #{ Integer x -> x };
+        TU<Number, Integer> f2 = (Integer x) -> x;
         assertTrue(3 == f2.foo(3));
         //Method resolution with boxing:
-        int x = LambdaConv01.<Integer,Integer>exec(#{ Integer x -> x }, 3);
+        int x = LambdaConv01.<Integer,Integer>exec((Integer x) -> x, 3);
         assertTrue(3 == x);
         //Runtime exception transparency:
         try {
-            LambdaConv01.<Integer,Object>exec(#{ Object x -> x.hashCode() }, null);
+            LambdaConv01.<Integer,Object>exec((Object x) -> x.hashCode(), null);
         }
         catch (RuntimeException e) {
             assertTrue(true);
@@ -99,17 +99,17 @@
 
     public static void test1() {
         //Assignment conversion:
-        VoidToInt f1 = #{3};
+        VoidToInt f1 = ()-> 3;
         assertTrue(3 == f1.foo());
         //Covariant returns:
-        TU<Number, Integer> f2 = #{ Integer x -> x };
+        TU<Number, Integer> f2 = (Integer x) -> x;
         assertTrue(3 == f2.foo(3));
         //Method resolution with boxing:
-        int x = LambdaConv01.<Integer,Integer>exec(#{ Integer x -> x }, 3);
+        int x = LambdaConv01.<Integer,Integer>exec((Integer x) -> x, 3);
         assertTrue(3 == x);
         //Runtime exception transparency:
         try {
-            LambdaConv01.<Integer,Object>exec(#{ Object x -> x.hashCode() }, null);
+            LambdaConv01.<Integer,Object>exec((Object x) -> x.hashCode(), null);
         }
         catch (RuntimeException e) {
             assertTrue(true);
@@ -118,17 +118,17 @@
 
     public void test2() {
         //Assignment conversion:
-        VoidToInt f1 = #{3};
+        VoidToInt f1 = ()-> 3;
         assertTrue(3 == f1.foo());
         //Covariant returns:
-        TU<Number, Integer> f2 = #{ Integer x -> x };
+        TU<Number, Integer> f2 = (Integer x) -> x;
         assertTrue(3 == f2.foo(3));
         //Method resolution with boxing:
-        int x = LambdaConv01.<Integer,Integer>exec(#{ Integer x -> x }, 3);
+        int x = LambdaConv01.<Integer,Integer>exec((Integer x) -> x, 3);
         assertTrue(3 == x);
         //Runtime exception transparency:
         try {
-            LambdaConv01.<Integer,Object>exec(#{ Object x -> x.hashCode() }, null);
+            LambdaConv01.<Integer,Object>exec((Object x) -> x.hashCode(), null);
         }
         catch (RuntimeException e) {
             assertTrue(true);
--- a/test/tools/javac/lambda/LambdaConv03.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaConv03.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,16 +50,16 @@
 
     static {
         //void
-        exec(#{ Integer x -> assertTrue(x == 3); }, 3);
+        exec((Integer x) -> assertTrue(x == 3), 3);
         //Covariant returns:
-        int i = exec(#{ Integer x -> return x;}, 3);
+        int i = exec((Integer x) -> { return x; }, 3);
         assertTrue(3 == i);
         //Method resolution with boxing:
-        int x = exec(#{ Integer x -> return x;}, 3);
+        int x = exec((Integer x) -> { return x; }, 3);
         assertTrue(3 == x);
         //Runtime exception transparency:
         try {
-            exec(#{ Object x -> return x.hashCode();}, null);
+            exec((Object x) -> { return x.hashCode(); }, null);
         }
         catch (RuntimeException e) {
             assertTrue(true);
@@ -68,16 +68,16 @@
 
     {
         //void
-        exec(#{ Integer x -> assertTrue(x == 3); }, 3);
+        exec((Integer x) -> assertTrue(x == 3), 3);
         //Covariant returns:
-        int i = exec(#{ Integer x -> return x;}, 3);
+        int i = exec((Integer x) -> { return x; }, 3);
         assertTrue(3 == i);
         //Method resolution with boxing:
-        int x = exec(#{ Integer x -> return x;}, 3);
+        int x = exec((Integer x) -> { return x; }, 3);
         assertTrue(3 == x);
         //Runtime exception transparency:
         try {
-            exec(#{ Object x -> return x.hashCode();}, null);
+            exec((Object x) -> { return x.hashCode(); }, null);
         }
         catch (RuntimeException e) {
             assertTrue(true);
@@ -86,16 +86,16 @@
 
     public static void test1() {
         //void
-        exec(#{ Integer x -> assertTrue(x == 3); }, 3);
+        exec((Integer x) -> assertTrue(x == 3), 3);
         //Covariant returns:
-        int i = exec(#{ Integer x -> return x;}, 3);
+        int i = exec((Integer x) -> { return x; }, 3);
         assertTrue(3 == i);
         //Method resolution with boxing:
-        int x = exec(#{ Integer x -> return x;}, 3);
+        int x = exec((Integer x) -> { return x; }, 3);
         assertTrue(3 == x);
         //Runtime exception transparency:
         try {
-            exec(#{ Object x -> return x.hashCode();}, null);
+            exec((Object x) -> { return x.hashCode(); }, null);
         }
         catch (RuntimeException e) {
             assertTrue(true);
@@ -104,16 +104,16 @@
 
     public void test2() {
         //void
-        exec(#{ Integer x -> assertTrue(x == 3); }, 3);
+        exec((Integer x) -> assertTrue(x == 3), 3);
         //Covariant returns:
-        int i = exec(#{ Integer x -> return x;}, 3);
+        int i = exec((Integer x) -> { return x; }, 3);
         assertTrue(3 == i);
         //Method resolution with boxing:
-        int x = exec(#{ Integer x -> return x;}, 3);
+        int x = exec((Integer x) -> { return x; }, 3);
         assertTrue(3 == x);
         //Runtime exception transparency:
         try {
-            exec(#{ Object x -> return x.hashCode();}, null);
+            exec((Object x) -> { return x.hashCode(); }, null);
         }
         catch (RuntimeException e) {
             assertTrue(true);
--- a/test/tools/javac/lambda/LambdaConv05.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaConv05.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
 
     void sort(List<String> data) {
       Collections.sort(data,
-                       #{ String a, String b -> LambdaConv05.this.count++; return a.length()-b.length(); });
+                       (String a, String b) -> { LambdaConv05.this.count++; return a.length()-b.length(); });
     }
 
     public static void main(String[] args) {
--- a/test/tools/javac/lambda/LambdaConv06.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaConv06.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
 class LambdaConv06 {
 
     private int t() {
-        return a(#{ final Object indexed ->
+        return a((final Object indexed) -> {
             return b(new R() {
                 public String build(final Object index) {
                     return "";
--- a/test/tools/javac/lambda/LambdaConv08.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaConv08.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,7 @@
     public static void call(ObjectF objectFunc) {  }
 
     public static void main(String[] args)   {
-        call(#{ "Hello" });
+        call(()-> "Hello");
         assertTrue(assertionCount == 1);
     }
 }
--- a/test/tools/javac/lambda/LambdaConv09.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaConv09.java	Fri Sep 09 14:19:45 2011 +0100
@@ -60,12 +60,12 @@
     interface Foo7<T> extends Foo2, Foo6<T> { }
 
     void test() {
-        Foo1 f1 = #{};
-        Foo2 f2 = #{};
-        Foo3 f3 = #{ x -> true };
-        Foo4 f4 = #{ x, y -> 1 };
-        Foo5 f5 = #{ x -> true };
-        Foo6 f6 = #{ x, y -> 1 };
-        Foo7 f7 = #{ x, y -> 1 };
+        Foo1 f1 = ()-> { };
+        Foo2 f2 = ()-> { };
+        Foo3 f3 = x -> true;
+        Foo4 f4 = (x, y) -> 1;
+        Foo5 f5 = x -> true;
+        Foo6 f6 = (x, y) -> 1;
+        Foo7 f7 = (x, y) -> 1;
     }
 }
--- a/test/tools/javac/lambda/LambdaConv10.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaConv10.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,6 @@
     interface Method1<R, A1, throws E> { public R call( A1 a1 ) throws E; }
 
     public static void main( final String... notUsed ) throws Throwable {
-        Method1<Integer,Integer,void> m1 = #{ int i -> 2 * i };
+        Method1<Integer,Integer,void> m1 = (int i) -> 2 * i;
     }
 }
--- a/test/tools/javac/lambda/LambdaConv11.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaConv11.java	Fri Sep 09 14:19:45 2011 +0100
@@ -36,5 +36,5 @@
         public int compare(X left, X right);
     }
 
-    SAM<T> y = #{l, r -> 0 };
+    SAM<T> y = (l, r) -> 0;
 }
--- a/test/tools/javac/lambda/LambdaConv12.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaConv12.java	Fri Sep 09 14:19:45 2011 +0100
@@ -37,7 +37,7 @@
     }
 
     void test() {
-        new LambdaConv12(#{});
-        new LambdaConv12(#{}) {};
+        new LambdaConv12(()-> { });
+        new LambdaConv12(()-> { }) {};
     }
 }
--- a/test/tools/javac/lambda/LambdaConv13.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaConv13.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@
     interface D extends A, I {}
     interface E extends B, I {}
 
-    C c = #{};
-    D d = #{};
-    D e = #{};
+    C c = ()-> { };
+    D d = ()-> { };
+    D e = ()-> { };
 }
--- a/test/tools/javac/lambda/LambdaConv16.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaConv16.java	Fri Sep 09 14:19:45 2011 +0100
@@ -53,9 +53,9 @@
     static void test(AB ab, List l) { ab.m(l); }
 
     public static void main(String[] args) {
-        AB ab = #{List list -> assertTrue(true); return new ArrayList<String>(); };
+        AB ab = (List list) -> { assertTrue(true); return new ArrayList<String>(); };
         ab.m(null);
-        test(#{List list -> assertTrue(true); return new ArrayList<String>(); }, null);
+        test((List list) -> { assertTrue(true); return new ArrayList<String>(); }, null);
         assertTrue(assertionCount == 2);
     }
 }
--- a/test/tools/javac/lambda/LambdaConv17.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaConv17.java	Fri Sep 09 14:19:45 2011 +0100
@@ -32,5 +32,5 @@
        void m() throws Exception;
     }
 
-    SAM s = #{ -> try (AutoCloseable ac = null){ } };
+    SAM s = ()-> { try (AutoCloseable ac = null){ } };
 }
--- a/test/tools/javac/lambda/LambdaConv19.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaConv19.java	Fri Sep 09 14:19:45 2011 +0100
@@ -33,5 +33,5 @@
         void m();
     }
 
-    SAM s = (SAM)#{ };
+    SAM s = (SAM)()-> { };
 }
--- a/test/tools/javac/lambda/LambdaConversionTest.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaConversionTest.java	Fri Sep 09 14:19:45 2011 +0100
@@ -167,7 +167,7 @@
     };
 
     SourceFile clientSourceFile = new SourceFile("Client.java",
-                                                 "#I\n class Client { Sam s = #{ x -> null }; }") {
+                                                 "#I\n class Client { Sam s = x -> null; }") {
         public String toString() {
             return template.replaceAll("#I", samPkg.getImportStat());
         }
--- a/test/tools/javac/lambda/LambdaExpr01.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaExpr01.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -64,62 +64,62 @@
     }
 
     static {
-        S_int s_i = #{3};
+        S_int s_i = ()-> 3;
         assertTrue(3 == s_i.m());
-        S_Integer s_I = #{3};
+        S_Integer s_I = ()-> 3;
         assertTrue(3 == s_I.m());
-        S_int_int s_i_i = #{ int x -> x + 1 };
+        S_int_int s_i_i = (int x)-> x+1;
         assertTrue(4 == s_i_i.m(3));
-        S_int_Integer s_i_I = #{ int x -> x + 1 };
+        S_int_Integer s_i_I = (int x)-> x+1;
         assertTrue(4 == s_i_I.m(3));
-        S_Integer_int s_I_i = #{ Integer x -> x.intValue() + 1 };
+        S_Integer_int s_I_i = (Integer x) -> x.intValue() + 1;
         assertTrue(4 == s_I_i.m(3));
-        S_Integer_Integer s_I_I = #{ Integer x -> x.intValue() + 1 };
+        S_Integer_Integer s_I_I = (Integer x) -> x.intValue() + 1;
         assertTrue(4 == s_I_I.m(3));
     }
 
     {
-        S_int s_i = #{3};
+        S_int s_i = ()-> 3;
         assertTrue(3 == s_i.m());
-        S_Integer s_I = #{3};
+        S_Integer s_I = ()-> 3;
         assertTrue(3 == s_I.m());
-        S_int_int s_i_i = #{ int x -> x + 1 };
+        S_int_int s_i_i = (int x)-> x+1;
         assertTrue(4 == s_i_i.m(3));
-        S_int_Integer s_i_I = #{ int x -> x + 1 };
+        S_int_Integer s_i_I = (int x)-> x+1;
         assertTrue(4 == s_i_I.m(3));
-        S_Integer_int s_I_i = #{ Integer x -> x.intValue() + 1 };
+        S_Integer_int s_I_i = (Integer x) -> x.intValue() + 1;
         assertTrue(4 == s_I_i.m(3));
-        S_Integer_Integer s_I_I = #{ Integer x -> x.intValue() + 1 };
+        S_Integer_Integer s_I_I = (Integer x) -> x.intValue() + 1;
         assertTrue(4 == s_I_I.m(3));
     }
 
     static void test1() {
-        S_int s_i = #{3};
+        S_int s_i = ()-> 3;
         assertTrue(3 == s_i.m());
-        S_Integer s_I = #{3};
+        S_Integer s_I = ()-> 3;
         assertTrue(3 == s_I.m());
-        S_int_int s_i_i = #{ int x -> x + 1 };
+        S_int_int s_i_i = (int x)-> x+1;
         assertTrue(4 == s_i_i.m(3));
-        S_int_Integer s_i_I = #{ int x -> x + 1 };
+        S_int_Integer s_i_I = (int x)-> x+1;
         assertTrue(4 == s_i_I.m(3));
-        S_Integer_int s_I_i = #{ Integer x -> x.intValue() + 1 };
+        S_Integer_int s_I_i = (Integer x) -> x.intValue() + 1;
         assertTrue(4 == s_I_i.m(3));
-        S_Integer_Integer s_I_I = #{ Integer x -> x.intValue() + 1 };
+        S_Integer_Integer s_I_I = (Integer x) -> x.intValue() + 1;
         assertTrue(4 == s_I_I.m(3));
     }
 
     void test2() {
-        S_int s_i = #{3};
+        S_int s_i = ()-> 3;
         assertTrue(3 == s_i.m());
-        S_Integer s_I = #{3};
+        S_Integer s_I = ()-> 3;
         assertTrue(3 == s_I.m());
-        S_int_int s_i_i = #{ int x -> x + 1 };
+        S_int_int s_i_i = (int x)-> x+1;
         assertTrue(4 == s_i_i.m(3));
-        S_int_Integer s_i_I = #{ int x -> x + 1 };
+        S_int_Integer s_i_I = (int x)-> x+1;
         assertTrue(4 == s_i_I.m(3));
-        S_Integer_int s_I_i = #{ Integer x -> x.intValue() + 1 };
+        S_Integer_int s_I_i = (Integer x) -> x.intValue() + 1;
         assertTrue(4 == s_I_i.m(3));
-        S_Integer_Integer s_I_I = #{ Integer x -> x.intValue() + 1 };
+        S_Integer_Integer s_I_I = (Integer x) -> x.intValue() + 1;
         assertTrue(4 == s_I_I.m(3));
     }
 
--- a/test/tools/javac/lambda/LambdaExpr02.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaExpr02.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -64,62 +64,62 @@
     }
 
     static {
-        S_int s_i = #{ return 3; };
+        S_int s_i = ()-> { return 3; };
         assertTrue(3 == s_i.m());
-        S_Integer s_I = #{ return 3; };
+        S_Integer s_I = ()-> { return 3; };
         assertTrue(3 == s_I.m());
-        S_int_int s_i_i = #{ int x -> return x + 1; };
+        S_int_int s_i_i = (int x) -> { return x + 1; };
         assertTrue(4 == s_i_i.m(3));
-        S_int_Integer s_i_I = #{ int x -> return x + 1; };
+        S_int_Integer s_i_I = (int x) -> { return x + 1; };
         assertTrue(4 == s_i_I.m(3));
-        S_Integer_int s_I_i = #{ Integer x -> return x.intValue() + 1; };
+        S_Integer_int s_I_i = (Integer x) -> { return x.intValue() + 1; };
         assertTrue(4 == s_I_i.m(3));
-        S_Integer_Integer s_I_I = #{ Integer x -> return x.intValue() + 1; };
+        S_Integer_Integer s_I_I = (Integer x) -> { return x.intValue() + 1; };
         assertTrue(4 == s_I_I.m(3));
     }
 
     {
-        S_int s_i = #{ return 3; };
+        S_int s_i = ()-> { return 3; };
         assertTrue(3 == s_i.m());
-        S_Integer s_I = #{ return 3; };
+        S_Integer s_I = ()-> { return 3; };
         assertTrue(3 == s_I.m());
-        S_int_int s_i_i = #{ int x -> return x + 1; };
+        S_int_int s_i_i = (int x) -> { return x + 1; };
         assertTrue(4 == s_i_i.m(3));
-        S_int_Integer s_i_I = #{ int x -> return x + 1; };
+        S_int_Integer s_i_I = (int x) -> { return x + 1; };
         assertTrue(4 == s_i_I.m(3));
-        S_Integer_int s_I_i = #{ Integer x -> return x.intValue() + 1; };
+        S_Integer_int s_I_i = (Integer x) -> { return x.intValue() + 1; };
         assertTrue(4 == s_I_i.m(3));
-        S_Integer_Integer s_I_I = #{ Integer x -> return x.intValue() + 1; };
+        S_Integer_Integer s_I_I = (Integer x) -> { return x.intValue() + 1; };
         assertTrue(4 == s_I_I.m(3));
     }
 
     static void test1() {
-        S_int s_i = #{ return 3; };
+        S_int s_i = ()-> { return 3; };
         assertTrue(3 == s_i.m());
-        S_Integer s_I = #{ return 3; };
+        S_Integer s_I = ()-> { return 3; };
         assertTrue(3 == s_I.m());
-        S_int_int s_i_i = #{ int x -> return x + 1; };
+        S_int_int s_i_i = (int x) -> { return x + 1; };
         assertTrue(4 == s_i_i.m(3));
-        S_int_Integer s_i_I = #{ int x -> return x + 1; };
+        S_int_Integer s_i_I = (int x) -> { return x + 1; };
         assertTrue(4 == s_i_I.m(3));
-        S_Integer_int s_I_i = #{ Integer x -> return x.intValue() + 1; };
+        S_Integer_int s_I_i = (Integer x) -> { return x.intValue() + 1; };
         assertTrue(4 == s_I_i.m(3));
-        S_Integer_Integer s_I_I = #{ Integer x -> return x.intValue() + 1; };
+        S_Integer_Integer s_I_I = (Integer x) -> { return x.intValue() + 1; };
         assertTrue(4 == s_I_I.m(3));
     }
 
     void test2() {
-        S_int s_i = #{ return 3; };
+        S_int s_i = ()-> { return 3; };
         assertTrue(3 == s_i.m());
-        S_Integer s_I = #{ return 3; };
+        S_Integer s_I = ()-> { return 3; };
         assertTrue(3 == s_I.m());
-        S_int_int s_i_i = #{ int x -> return x + 1; };
+        S_int_int s_i_i = (int x) -> { return x + 1; };
         assertTrue(4 == s_i_i.m(3));
-        S_int_Integer s_i_I = #{ int x -> return x + 1; };
+        S_int_Integer s_i_I = (int x) -> { return x + 1; };
         assertTrue(4 == s_i_I.m(3));
-        S_Integer_int s_I_i = #{ Integer x -> return x.intValue() + 1; };
+        S_Integer_int s_I_i = (Integer x) -> { return x.intValue() + 1; };
         assertTrue(4 == s_I_i.m(3));
-        S_Integer_Integer s_I_I = #{ Integer x -> return x.intValue() + 1; };
+        S_Integer_Integer s_I_I = (Integer x) -> { return x.intValue() + 1; };
         assertTrue(4 == s_I_I.m(3));
     }
 
--- a/test/tools/javac/lambda/LambdaExpr04.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaExpr04.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,11 +34,11 @@
     interface SAM {
         void m(int i);
     }
-    static SAM lambda_01 = #{ int pos -> };
+    static SAM lambda_01 = (int pos) -> { };
 
-    static final SAM lambda_02 = #{ int pos -> };
+    static final SAM lambda_02 = (int pos) -> { };
 
-    SAM lambda_03 = #{ int pos -> };
+    SAM lambda_03 = (int pos) -> { };
 
-    final SAM lambda_04 = #{ int pos -> };
+    final SAM lambda_04 = (int pos) -> { };
 }
--- a/test/tools/javac/lambda/LambdaExpr05.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaExpr05.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,6 @@
 
     interface SAM { int foo(int i); }
 
-    SAM s1 = #{i -> i * 2 };
-    SAM s2 = #{i -> 2 * i };
+    SAM s1 = i -> i * 2;
+    SAM s2 = i -> 2 * i;
 }
--- a/test/tools/javac/lambda/LambdaExpr06.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaExpr06.java	Fri Sep 09 14:19:45 2011 +0100
@@ -43,7 +43,7 @@
     }
 
     public static void main(String[] args) {
-        A a = #{ ((B)#{ i -> i * 2 }).dup(3) };
+        A a = ()-> ((B)i -> i * 2).dup(3);
         assertTrue(a.m() == 6);
     }
 }
--- a/test/tools/javac/lambda/LambdaExpr07.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaExpr07.java	Fri Sep 09 14:19:45 2011 +0100
@@ -44,7 +44,7 @@
     String S = "A";
 
     void test() {
-        Block<String, Block<String, String>> o = #{s1 -> #{s2 -> S + s1 + s2 } };
+        Block<String, Block<String, String>> o = s1 -> s2 -> S + s1 + s2;
         assertTrue(o.apply("B").apply("C").equals("ABC"));
     }
 
--- a/test/tools/javac/lambda/LambdaExpr08.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaExpr08.java	Fri Sep 09 14:19:45 2011 +0100
@@ -36,6 +36,6 @@
     void test() {
         final String s;
         s = "";
-        SAM sam = #{ -> s };
+        SAM sam = () -> s;
     }
 }
--- a/test/tools/javac/lambda/LambdaExpr09.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaExpr09.java	Fri Sep 09 14:19:45 2011 +0100
@@ -36,17 +36,17 @@
     void apply(Object[] obj_arr) { }
 
     void test1() {
-        Block<?>[] arr1 =  { #{ t -> }, #{ t -> } };
-        Block<?>[][] arr2 =  { { #{ t -> }, #{ t -> } }, { #{ t -> }, #{ t -> } } };
+        Block<?>[] arr1 =  { t -> { }, t -> { } };
+        Block<?>[][] arr2 =  { { t -> { }, t -> { } }, { t -> { }, t -> { } } };
     }
 
     void test2() {
-        Block<?>[] arr1 =  new Block<?>[]{ #{ t -> }, #{ t -> } };
-        Block<?>[][] arr2 =  new Block<?>[][]{ { #{ t -> }, #{ t -> } }, { #{ t -> }, #{ t -> } } };
+        Block<?>[] arr1 =  new Block<?>[]{ t -> { }, t -> { } };
+        Block<?>[][] arr2 =  new Block<?>[][]{ { t -> { }, t -> { } }, { t -> { }, t -> { } } };
     }
 
     void test3() {
-        apply(new Block<?>[]{ #{ t -> }, #{ t -> } });
-        apply(new Block<?>[][]{ { #{ t -> }, #{ t -> } }, { #{ t -> }, #{ t -> } } });
+        apply(new Block<?>[]{ t -> { }, t -> { } });
+        apply(new Block<?>[][]{ { t -> { }, t -> { } }, { t -> { }, t -> { } } });
     }
 }
--- a/test/tools/javac/lambda/LambdaExpr10.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaExpr10.java	Fri Sep 09 14:19:45 2011 +0100
@@ -36,23 +36,23 @@
     void apply(Object[] obj_arr) { }
 
     void test1() {
-        Object[] arr1 =  { #{ t -> } };
-        Object[][] arr2 =  { { #{ t -> } } };
+        Object[] arr1 =  { t -> { } };
+        Object[][] arr2 =  { { t -> { } } };
     }
 
     void test2() {
-        Object[] arr1 =  new Object[]{ #{ t -> } };
-        Object[][] arr2 =  new Object[][]{ { #{ t -> } } };
+        Object[] arr1 =  new Object[]{ t -> { } };
+        Object[][] arr2 =  new Object[][]{ { t -> { } } };
     }
 
     void test3() {
-        apply(new Object[]{ #{ t -> } });
-        apply(new Object[][]{ { #{ t -> } } });
+        apply(new Object[]{ t -> { } });
+        apply(new Object[][]{ { t -> { } } });
     }
 
     void test4() {
-        Block<?>[] arr1 =  { #{ t -> t } };
-        Block<?>[] arr2 =  new Block<?>[]{ #{ t -> t } };
-        apply(new Block<?>[]{ #{ t -> }, #{ t -> } });
+        Block<?>[] arr1 =  { t -> t };
+        Block<?>[] arr2 =  new Block<?>[]{ t -> t };
+        apply(new Block<?>[]{ t -> { }, t -> { } });
     }
 }
--- a/test/tools/javac/lambda/LambdaExprNotVoid.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaExprNotVoid.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,6 @@
 
     interface SAM { void foo(int i); }
 
-    SAM s1 = #{ i -> i * 2 };
-    SAM s2 = #{ i -> 2 * i };
+    SAM s1 = i -> i * 2;
+    SAM s2 = i -> 2 * i;
 }
--- a/test/tools/javac/lambda/LambdaScope01.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaScope01.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -55,7 +55,7 @@
 
     public void test1() {
         try {
-            int x = LambdaScope01.<Integer,Integer>exec(#{ Integer x -> x * hashCode() }, 3);
+            int x = LambdaScope01.<Integer,Integer>exec((Integer x) -> x * hashCode(), 3);
         }
         catch (RuntimeException e) {
             assertTrue(true); //should throw
@@ -64,7 +64,7 @@
 
     public void test2() {
         final int n = 10;
-        int x = LambdaScope01.<Integer,Integer>exec(#{ Integer x -> x + n }, 3);
+        int x = LambdaScope01.<Integer,Integer>exec((Integer x) -> x + n, 3);
         assertTrue(13 == x);
     }
 
--- a/test/tools/javac/lambda/LambdaScope02.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaScope02.java	Fri Sep 09 14:19:45 2011 +0100
@@ -50,8 +50,8 @@
     static void call(Callable c) { c.call(); }
     
     void test() {
-        call(#{ assertTrue(LambdaScope02.this.toString().equals("Callable1")); });
-        call(#{ assertTrue(toString().equals("Callable1")); });
+        call(()-> { assertTrue(LambdaScope02.this.toString().equals("Callable1")); });
+        call(()-> { assertTrue(toString().equals("Callable1")); });
     }
 
     public static void main(String[] args) {
--- a/test/tools/javac/lambda/LambdaScope03.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LambdaScope03.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,14 +45,14 @@
     static void call(SAM s) { s.m(); }
 
     void test() {
-        call(#{ assertTrue(LambdaScope03.this.getClass().equals(getClass())); });
-        call(#{ assertTrue(LambdaScope03.this.getClass().equals(this.getClass())); });
-        call(#{ assertTrue(LambdaScope03.this.hashCode() == hashCode()); });
-        call(#{ assertTrue(LambdaScope03.this.hashCode() == this.hashCode()); });
-        call(#{ assertTrue(LambdaScope03.this.toString().equals(toString())); });
-        call(#{ assertTrue(LambdaScope03.this.toString().equals(this.toString())); });
-        call(#{ assertTrue(LambdaScope03.this.equals(this)); });
-        call(#{ assertTrue(equals(LambdaScope03.this)); });
+        call(()-> { assertTrue(LambdaScope03.this.getClass().equals(getClass())); });
+        call(()-> { assertTrue(LambdaScope03.this.getClass().equals(this.getClass())); });
+        call(()-> { assertTrue(LambdaScope03.this.hashCode() == hashCode()); });
+        call(()-> { assertTrue(LambdaScope03.this.hashCode() == this.hashCode()); });
+        call(()-> { assertTrue(LambdaScope03.this.toString().equals(toString())); });
+        call(()-> { assertTrue(LambdaScope03.this.toString().equals(this.toString())); });
+        call(()-> { assertTrue(LambdaScope03.this.equals(this)); });
+        call(()-> { assertTrue(equals(LambdaScope03.this)); });
     }
 
     public static void main(String[] args) {
--- a/test/tools/javac/lambda/LocalBreakAndContinue.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/LocalBreakAndContinue.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,6 @@
        void m();
     }
 
-    SAM s1 = #{ while (true) break; };
-    SAM s2 = #{ while (true) continue; };
+    SAM s1 = ()-> { while (true) break; };
+    SAM s2 = ()-> { while (true) continue; };
 }
--- a/test/tools/javac/lambda/MethodReference12.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/MethodReference12.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
     public static void main(String[] args) {
         try {
             test(MethodReference12#print(int));
-            test(#{ i -> System.out.println(i); } );
+            test(i -> { System.out.println(i); } );
         }
         catch (Throwable t) {
             t.printStackTrace();
--- a/test/tools/javac/lambda/NakedThis.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/NakedThis.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,6 @@
         NakedThis m(int x);
     }
   
-    SAM s1 = #{ int x -> this };
-    SAM s2 = #{ int x -> NakedThis.this };
+    SAM s1 = (int x) -> this;
+    SAM s2 = (int x) -> NakedThis.this;
 }
--- a/test/tools/javac/lambda/SourceLevelTest.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/SourceLevelTest.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@
         void m();
     }
 
-    SAM s1 = #{ };
+    SAM s1 = () -> { };
     SAM s2 = this#m();
     SourceLevelTest<void> slt = null;
     SourceLevelTest<java.io.IOException|UnsupportedOperationException> slt = null;
--- a/test/tools/javac/lambda/TargetType01.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType01.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,6 @@
 
     static {
         //ambiguity here - the compiler does not try all the combinations!
-        M(#{ final x1 -> return M(#{ x2 -> return x1 + x2; });});
+        M((final x1) -> { return M( x2 -> { return x1 + x2; });});
     }
 }
--- a/test/tools/javac/lambda/TargetType02.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType02.java	Fri Sep 09 14:19:45 2011 +0100
@@ -50,7 +50,7 @@
     static <Z extends String> void call(S2<Z> s) { s.m(2); assertTrue(false); }
 
     void test() {
-        call(#{ i -> toString(); return i; });
+        call(i -> { toString(); return i; });
     }
 
     public static void main(String[] args) {
--- a/test/tools/javac/lambda/TargetType03.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType03.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@
         numbers.add(3);
         numbers.add(4);
         numbers.add(5);
-        List<Integer> sqNumbers = numbers.map(#{ a -> a * a });
+        List<Integer> sqNumbers = numbers.map(a -> a * a);
         //check invariants
         if (numbers.size() != sqNumbers.size()) {
             throw new AssertionError();
--- a/test/tools/javac/lambda/TargetType04.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType04.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
        Y m(X x);
     }
 
-    S<Integer, Integer> s1 = #{ i -> return i; }; //ok
-    S<Double, Integer> s2 = #{ i -> return i; }; //no
-    S<Integer, Double> s3 = #{ i -> return i; }; //no
+    S<Integer, Integer> s1 = i -> { return i; }; //ok
+    S<Double, Integer> s2 = i -> { return i; }; //no
+    S<Integer, Double> s3 = i -> { return i; }; //no
 }
--- a/test/tools/javac/lambda/TargetType05.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType05.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
     }
 
     public static void main(String[] args) {
-        Func<Integer, Integer> f = #{ i -> return i == 1 ? 1 : f.call(i-1) * i; };
+        Func<Integer, Integer> f = i -> { return i == 1 ? 1 : f.call(i-1) * i; };
         assertTrue(f.call(5) == 120);
         assertTrue(assertionCount == 1);
     }
--- a/test/tools/javac/lambda/TargetType06.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType06.java	Fri Sep 09 14:19:45 2011 +0100
@@ -43,6 +43,6 @@
     static <B> List<B> map(Function<B, B> function) { return null; }
 
     void test() {
-        List<Foo> l = map(#{ foo -> foo.getFoo() });
+        List<Foo> l = map(foo -> foo.getFoo());
     }
 }
--- a/test/tools/javac/lambda/TargetType07.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType07.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,6 @@
     public static <X> void call(SAM2<X> s) { }
 
     public static void main(String[] args) {
-        call((SAM1<Integer>)#{ 1 });
+        call((SAM1<Integer>)()-> 1 );
     }
 }
--- a/test/tools/javac/lambda/TargetType08.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType08.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,6 @@
     public static void call(SAM2 s) { }
 
     public static void main(String[] args) {
-        call((SAM1)#{ "Hello!" });
+        call((SAM1)()-> "Hello!" );
     }
 }
--- a/test/tools/javac/lambda/TargetType10.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType10.java	Fri Sep 09 14:19:45 2011 +0100
@@ -36,6 +36,6 @@
 
     static class Test {
         <A,B,C> Function<A,C> compose(Function<B,C> g, Function<A,? extends B> f) { return null; }
-        { compose(#{ x ->  "a" + x }, #{ x -> x + "b" }); }
+        { compose(x ->  "a" + x, x -> x + "b"); }
     }
 }
--- a/test/tools/javac/lambda/TargetType11.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType11.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
         public <T> Predicate<T> and(Predicate<? super T>... first) { return null; }
         public Predicate<Character> forPredicate(Predicate<? super Character> predicate) { return null; }
         
-        Predicate<Character> c2 = forPredicate(#{ c -> c.compareTo('e') < 0 });
-        Predicate<Integer> k = and(#{ i -> i > 0 }, #{ i -> i % 2 == 0 });
+        Predicate<Character> c2 = forPredicate(c -> c.compareTo('e') < 0);
+        Predicate<Integer> k = and(i -> i > 0, i -> i % 2 == 0);
     }
 }
--- a/test/tools/javac/lambda/TargetType12.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType12.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
     }
 
     static <T, U extends Comparable<? super U>> void sortBy2(T[] array, Extractor<T, U> extractor) {
-        Comparator<T> comparator = #{ left,right -> extractor.get(left).compareTo(extractor.get(right)) };
+        Comparator<T> comparator = (left,right) -> extractor.get(left).compareTo(extractor.get(right));
         Arrays.sort(array, comparator);
     }
 }
--- a/test/tools/javac/lambda/TargetType13.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType13.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,6 @@
     static <throws E> void call(SAM<E> s) throws E { }
 
     void test() {
-        call(#{ i -> if (i == 2) throw new Exception(); return; });
+        call(i -> { if (i == 2) throw new Exception(); return; });
     }
 }
--- a/test/tools/javac/lambda/TargetType14.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType14.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,10 +35,10 @@
     }
 
     static void test() {
-        SAM<Integer> s1 = #{ i, j -> i + j };
-        m(#{ i, j -> i + j });
-        SAM<Integer> s2 = m2(#{ i, j -> i + j }); //ok
-        SAM<Integer> s3 = m2(#{ i, j -> "" + i + j }); //no
+        SAM<Integer> s1 = (i, j) -> i + j;
+        m((i, j) -> i + j);
+        SAM<Integer> s2 = m2((i, j) -> i + j); //ok
+        SAM<Integer> s3 = m2((i, j) -> "" + i + j); //no
     }
 
     static void m(SAM<Integer> s) { }
--- a/test/tools/javac/lambda/TargetType15.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType15.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,13 +38,13 @@
     void m2(SAM<? super String> f_2) {}
     void m3(SAM<?> f_3) {}
 
-    SAM<? extends String> f_1 = #{ a, b -> a };
-    SAM<? super String> f_2 = #{ a, b -> a };
-    SAM<?> f_3 = #{ a, b -> a };
+    SAM<? extends String> f_1 = (a, b) -> a;
+    SAM<? super String> f_2 = (a, b) -> a;
+    SAM<?> f_3 = (a, b) -> a;
 
     {
-        m1(#{ a, b -> a });
-        m2(#{ a, b -> a });
-        m3(#{ a, b -> a });
+        m1((a, b) -> a);
+        m2((a, b) -> a);
+        m3((a, b) -> a);
     }
 }
--- a/test/tools/javac/lambda/TargetType16.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType16.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,7 @@
     static <T> void m(SAM2<T> s2) { assertTrue(false); }
 
     public static void main(String[] args) {
-        m(#{ System.out.println("Hello!") }); //'void' has precedence
+        m(() -> System.out.println("Hello!")); //'void' has precedence
         assertTrue(assertionCount == 1);
     }
 }
--- a/test/tools/javac/lambda/TargetType17.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType17.java	Fri Sep 09 14:19:45 2011 +0100
@@ -32,12 +32,12 @@
         boolean m(X x);
     }
 
-    byte b = (byte) #{ true };
-    short s = (short) #{ 1 };
-    int i = (int) #{ 1 };
-    long l = (long) #{ 1L };
-    float f = (float) #{ 1.0F };
-    double d = (double) #{ 1.0 };
-    char c = (char) #{ 'c' };
-    boolean z = (boolean) #{ true };
+    byte b = (byte) ()-> true;
+    short s = (short) ()-> 1;
+    int i = (int) ()-> 1;
+    long l = (long) ()-> 1L;
+    float f = (float) ()-> 1.0F;
+    double d = (double) ()-> 1.0;
+    char c = (char) ()-> 'c';
+    boolean z = (boolean) ()-> true;
 }
--- a/test/tools/javac/lambda/TargetType18.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType18.java	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,6 @@
 
 
     public static <T> Folder<T> max() {
-        return #{ a, b -> (((Comparable)a).compareTo(b)<0)? b: a };
+        return (a, b) -> (((Comparable)a).compareTo(b)<0)? b: a;
     }
 }
--- a/test/tools/javac/lambda/TargetType19.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType19.java	Fri Sep 09 14:19:45 2011 +0100
@@ -37,5 +37,5 @@
 
     <Z> void call(SAM<? extends Z> s, Z z) {  }
 
-   { call(#{ List<? extends String> p -> }, 1); }
+   { call((List<? extends String> p) -> { }, 1); }
 }
--- a/test/tools/javac/lambda/TargetType20.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType20.java	Fri Sep 09 14:19:45 2011 +0100
@@ -37,6 +37,6 @@
 
     class Test {
        <Z> void call(SAM2<Z> x, SAM2<Z> y) { }
-       { call(#{ -> Collections.emptyList() }, #{ -> new ArrayList<String>() }); }
+       { call(() -> Collections.emptyList(), () -> new ArrayList<String>()); }
     }
 }
--- a/test/tools/javac/lambda/TargetType21.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType21.java	Fri Sep 09 14:19:45 2011 +0100
@@ -46,9 +46,9 @@
     <R,A> void call(SAM3<R,A> sam) { }
 
     void test() {
-        call(#{ x -> throw new Exception(); }); //ok - resolves to call(SAM1)
-        call(#{ x -> System.out.println(""); }); //ok - resolves to call(SAM2)
-        call(#{ x -> return (Object) null; }); //error - call(SAM3) is not applicable because of cyclic inference
-        call(#{ x -> return null; }); ////ok - resolves to call(SAM1)
+        call(x -> { throw new Exception(); }); //ok - resolves to call(SAM1)
+        call(x -> { System.out.println(""); }); //ok - resolves to call(SAM2)
+        call(x -> { return (Object) null; }); //error - call(SAM3) is not applicable because of cyclic inference
+        call(x -> { return null; }); ////ok - resolves to call(SAM1)
     }
 }
--- a/test/tools/javac/lambda/TargetType22.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType22.java	Fri Sep 09 14:19:45 2011 +0100
@@ -57,9 +57,9 @@
     void call(SamX<String> s) { }
 
     void test() {
-        call(#{ -> });
-        call(#{ a1 -> }); //ambiguous - both call(Sam1) and call(SamX) match
-        call(#{ a1, a2 -> });
-        call(#{ a1, a2, a3 -> });
+        call(() -> { });
+        call(a1 -> { }); //ambiguous - both call(Sam1) and call(SamX) match
+        call((a1, a2) -> { });
+        call((a1, a2, a3) -> { });
     }
 }
--- a/test/tools/javac/lambda/TargetType23.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType23.java	Fri Sep 09 14:19:45 2011 +0100
@@ -53,6 +53,6 @@
     <Z> void call(Sam3<Z> s) { }
 
     void test() {
-        call(#{ -> throw new RuntimeException(); }); //ambiguous - both call(Sam0), call(Sam2), call(Sam3) match
+        call(()-> { throw new RuntimeException(); }); //ambiguous - both call(Sam0), call(Sam2), call(Sam3) match
     }
 }
--- a/test/tools/javac/lambda/TargetType24.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType24.java	Fri Sep 09 14:19:45 2011 +0100
@@ -50,11 +50,11 @@
     }
 
     void test(Array<String> as, final Array<Character> ac) {
-        final boolean b1 = as.forAll(#{s -> ac.forAll(#{ c -> false }) }); //ok
-        final String s1 = as.forAll2(#{s -> ac.forAll2(#{ c -> "" }) }); //ok
-	final boolean b2 = as.forAll(#{s -> ac.forAll(#{ c -> "" }) }); //fail
-        final String s2 = as.forAll2(#{s -> ac.forAll2(#{ c -> false }) }); //fail
-	final boolean b3 = as.forAll((F<String, Boolean>)#{s -> ac.forAll((F<Character, Boolean>)#{ c -> "" }) }); //fail
-        final String s3 = as.forAll((FSub<String, String>)#{s -> ac.forAll((FSub<Character, String>)#{ c -> false }) }); //fail
+        final boolean b1 = as.forAll(s -> ac.forAll(c -> false)); //ok
+        final String s1 = as.forAll2(s -> ac.forAll2(c -> "")); //ok
+	final boolean b2 = as.forAll(s -> ac.forAll(c -> "" )); //fail
+        final String s2 = as.forAll2(s -> ac.forAll2(c -> false)); //fail
+	final boolean b3 = as.forAll((F<String, Boolean>)s -> ac.forAll((F<Character, Boolean>)c -> "")); //fail
+        final String s3 = as.forAll((FSub<String, String>)s -> ac.forAll((FSub<Character, String>)c -> false)); //fail
     }
 }
--- a/test/tools/javac/lambda/TargetType24.out	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType24.out	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
 TargetType24.java:55:37: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.String, boolean
-TargetType24.java:56:47: compiler.err.cant.apply.symbol.1: kindname.method, forAll2, TargetType24.FSub<java.lang.Character,java.lang.String>, compiler.misc.type.lambda, kindname.class, TargetType24.Array<A>, (compiler.misc.no.conforming.assignment.exists.1: compiler.misc.type.lambda, TargetType24.FSub<java.lang.Character,java.lang.String>, (compiler.misc.infer.incompatible.ret.types.in.lambda: boolean))
-TargetType24.java:57:98: compiler.err.prob.found.req: (compiler.misc.incompatible.types.1: (compiler.misc.infer.incompatible.ret.types.in.lambda: java.lang.String)), compiler.misc.type.lambda, TargetType24.F<java.lang.Character,java.lang.Boolean>
-TargetType24.java:58:101: compiler.err.prob.found.req: (compiler.misc.incompatible.types.1: (compiler.misc.infer.incompatible.ret.types.in.lambda: boolean)), compiler.misc.type.lambda, TargetType24.FSub<java.lang.Character,java.lang.String>
+TargetType24.java:56:45: compiler.err.cant.apply.symbol.1: kindname.method, forAll2, TargetType24.FSub<java.lang.Character,java.lang.String>, compiler.misc.type.lambda, kindname.class, TargetType24.Array<A>, (compiler.misc.no.conforming.assignment.exists.1: compiler.misc.type.lambda, TargetType24.FSub<java.lang.Character,java.lang.String>, (compiler.misc.infer.incompatible.ret.types.in.lambda: boolean))
+TargetType24.java:57:96: compiler.err.prob.found.req: (compiler.misc.incompatible.types.1: (compiler.misc.infer.incompatible.ret.types.in.lambda: java.lang.String)), compiler.misc.type.lambda, TargetType24.F<java.lang.Character,java.lang.Boolean>
+TargetType24.java:58:99: compiler.err.prob.found.req: (compiler.misc.incompatible.types.1: (compiler.misc.infer.incompatible.ret.types.in.lambda: boolean)), compiler.misc.type.lambda, TargetType24.FSub<java.lang.Character,java.lang.String>
 4 errors
--- a/test/tools/javac/lambda/TargetType25.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType25.java	Fri Sep 09 14:19:45 2011 +0100
@@ -38,26 +38,26 @@
     <Z> void m3(F<String, F<String, F<String, Z>>> f) {  }
 
     void testExprLambdaInMethodContext() {
-        m1(#{ s1 -> 1});
-        m2(#{ s1 -> #{ s2 -> 1 }});
-        m3(#{ s1 -> #{ s2 -> #{ s3 -> 1 }}});
+        m1(s1 -> 1);
+        m2(s1 -> s2 -> 1);
+        m3(s1 -> s2 -> s3 -> 1);
     }
 
     void testExprLambdaInAssignmentContext() {
-        F<String, Integer> fn1 = #{ s1 -> 1};
-        F<String, F<String, Integer>> fn2 = #{ s1 -> #{ s2 -> 1 }};
-        F<String, F<String, F<String, Integer>>> fn3 = #{ s1 -> #{ s2 -> #{ s3 -> 1 }}};
+        F<String, Integer> fn1 = s1 -> 1;
+        F<String, F<String, Integer>> fn2 = s1 -> s2 -> 1;
+        F<String, F<String, F<String, Integer>>> fn3 = s1 -> s2 -> s3 -> 1;
     }
 
     void testStatementLambdaInMethodContext() {
-        m1(#{ s1 -> return 1; });
-        m2(#{ s1 -> return #{ s2 -> return 1; }; });
-        m3(#{ s1 -> return #{ s2 -> return  #{ s3 -> return 1; }; }; });
+        m1(s1 -> { return 1; });
+        m2(s1 -> { return s2 -> { return 1; }; });
+        m3(s1 -> { return s2 -> { return s3 -> { return 1; }; }; });
     }
 
     void testStatementLambdaInAssignmentContext() {
-        F<String, Integer> fn1 = #{ s1 -> return 1; };
-        F<String, F<String, Integer>> fn2 = #{ s1 -> return #{ s2 -> return 1; }; };
-        F<String, F<String, F<String, Integer>>> fn3 = #{ s1 -> return #{ s2 -> return  #{ s3 -> return 1; }; }; };
+        F<String, Integer> fn1 = s1 -> { return 1; };
+        F<String, F<String, Integer>> fn2 = s1 -> { return s2 -> { return 1; }; };
+        F<String, F<String, F<String, Integer>>> fn3 = s1 -> { return s2 -> { return s3 -> { return 1; }; }; };
     }
 }
--- a/test/tools/javac/lambda/TargetType26.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType26.java	Fri Sep 09 14:19:45 2011 +0100
@@ -34,5 +34,5 @@
 
     <Z> void call(Z z) { }
 
-    { call(#{ -> }); }
+    { call(() -> { }); }
 }
--- a/test/tools/javac/lambda/TargetType27.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType27.java	Fri Sep 09 14:19:45 2011 +0100
@@ -36,6 +36,6 @@
     <A, R> F<A, R> m(F<A, R>  f) { return null; }
 
     void test() {
-        m(#{ String s1 ->  #{ String s2 ->  new Integer(1) }});
+        m((String s1) ->  (String s2) ->  new Integer(1));
     }
 }
--- a/test/tools/javac/lambda/TargetType28.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType28.java	Fri Sep 09 14:19:45 2011 +0100
@@ -39,7 +39,7 @@
 
     <Z, R> SuperFoo<R> apply(A<Z, R> ax, Z x) { return null; }
 
-    SuperFoo<String> ls = apply(#{ x-> new Foo<>() }, 1);
-    SuperFoo<Integer> li = apply(#{ x-> new Foo<>() }, 1);
-    SuperFoo<?> lw = apply(#{ x-> new Foo<>() }, 1);
+    SuperFoo<String> ls = apply(x-> new Foo<>(), 1);
+    SuperFoo<Integer> li = apply(x-> new Foo<>(), 1);
+    SuperFoo<?> lw = apply(x-> new Foo<>(), 1);
 }
--- a/test/tools/javac/lambda/TargetType29.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/TargetType29.java	Fri Sep 09 14:19:45 2011 +0100
@@ -37,6 +37,6 @@
     private static <E> int reduce(Iterable<? extends E> iterable, Reducer<? super E, Integer> reducer) { return 0;  }
 
     void test(List<Integer> li) {
-        reduce(li, #{ e, v -> e + v});
+        reduce(li, (e, v) -> e + v);
     }
 }
--- a/test/tools/javac/lambda/sqe/SAM_types/LambdaTest1.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/SAM_types/LambdaTest1.java	Fri Sep 09 14:19:45 2011 +0100
@@ -37,35 +37,34 @@
 
         LambdaTest1 test = new LambdaTest1();
 
-        test.method2(#{ int n -> });
-        test.method2(#{ int n -> ;});
-        test.method2(#{ int n -> return;}); // ";" is mandatory here
-        test.method2(#{ int n -> System.out.println(n) });
-        test.method2(#{ int n -> System.out.println(n); }); // ";" is optional here
-        test.method2(#{ n -> System.out.println(n) }); //warning, explict type required for n?
+        test.method2((int n) -> { });
+        test.method2((int n) -> { });
+        test.method2((int n) -> { return; }); // ";" is mandatory here
+        test.method2((int n) -> System.out.println(n));
+        test.method2((int n) -> { System.out.println(n); }); // ";" is optional here
+        test.method2(n -> System.out.println(n)); //warning, explict type required for n?
 
-        test.method3(#{ System.out.println("implementing VoidVoid.vvMethod()") });
-        test.method3(#{});
+        test.method3(()-> System.out.println("implementing VoidVoid.vvMethod()"));
+        test.method3(() -> {});
 
-        test.method4(#{ 42 });
-        test.method4(#{ return 42; });//";" is mandatory here
+        test.method4(()-> 42);
+        test.method4(()-> { return 42; });//";" is mandatory here
 
-        test.method5(#{int n -> n+1});
-        test.method5(#{int n -> 42});
-        test.method5(#{int n -> return 42;});
+        test.method5((int n)-> n+1);
+        test.method5((int n) -> 42);
+        test.method5((int n) -> { return 42; });
         test.method5(
-            #{
-                int n ->{ //"{" optional here
+            (int n) -> { //"{" optional here
                 if(n > 0)
                     return n++;
                 else
-                    return n--;}//"}" optional here
+                    return n--;
             }
         );
 
-        Runnable r = #{System.out.println("Runnable.run() method implemented")};
+        Runnable r = ()-> System.out.println("Runnable.run() method implemented");
         r.run();
-        ((Runnable)#{System.out.println("Runnable.run() method implemented")}).run();
+        ((Runnable)()-> System.out.println("Runnable.run() method implemented")).run();
     }
 
     void method2(VoidInt a) {
@@ -74,7 +73,7 @@
         int n = 2; //effectively final variable
         System.out.println("method2() \"this\":" + this);
         ((Runnable)
-            #{
+            ()->{
                 System.out.println("inside lambda \"this\":" + this);
                 System.out.println("inside lambda accessing final variable N:" + N);
                 System.out.println("inside lambda accessing effectively final variable n:" + n);
--- a/test/tools/javac/lambda/sqe/SAM_types/LambdaTest1_neg1.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/SAM_types/LambdaTest1_neg1.java	Fri Sep 09 14:19:45 2011 +0100
@@ -8,6 +8,6 @@
 
 public class LambdaTest1_neg1 {
     void method() {
-        Comparator<Number> c = #{Number n1, Number n2 -> 42; }; //compile error, not a statement
+        Comparator<Number> c = (Number n1, Number n2) -> { 42; } //compile error, not a statement
     }
 }
--- a/test/tools/javac/lambda/sqe/SAM_types/LambdaTest1_neg1.out	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/SAM_types/LambdaTest1_neg1.out	Fri Sep 09 14:19:45 2011 +0100
@@ -1,2 +1,3 @@
-LambdaTest1_neg1.java:11:58: compiler.err.not.stmt
-1 error
+LambdaTest1_neg1.java:11:60: compiler.err.not.stmt
+LambdaTest1_neg1.java:11:65: compiler.err.expected: ';'
+2 errors
--- a/test/tools/javac/lambda/sqe/SAM_types/LambdaTest1_neg2.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/SAM_types/LambdaTest1_neg2.java	Fri Sep 09 14:19:45 2011 +0100
@@ -7,7 +7,7 @@
 public class LambdaTest1_neg2 {
     static void method() {
         ((Runnable)
-            #{
+            ()-> {
                 Object o = this; //use "this" inside lambda expression which is inside a static method, not allowed
             }
         ).run();
--- a/test/tools/javac/lambda/sqe/SAM_types/LambdaTest1_neg3.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/SAM_types/LambdaTest1_neg3.java	Fri Sep 09 14:19:45 2011 +0100
@@ -8,7 +8,7 @@
     void method() {
         int n = 2; //effectively final variable
         ((Runnable)
-            #{
+            ()-> {
                 int n2 = n; //inside lambda accessing effectively final variable;
             }
         ).run();
--- a/test/tools/javac/lambda/sqe/SAM_types/LambdaTest2_SAM1.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/SAM_types/LambdaTest2_SAM1.java	Fri Sep 09 14:19:45 2011 +0100
@@ -48,11 +48,11 @@
         files.add(new File("b.txt"));
 
         //type #2: Comparator<T>
-        Collections.sort(files, #{File f1, File f2 -> f1.getName().compareTo(f2.getName())});
+        Collections.sort(files, (File f1, File f2) -> f1.getName().compareTo(f2.getName()));
         for(File f : files)
             System.out.println(f.getName());
         System.out.println();
-        Collections.sort(files, #{File f1, File f2 -> (int)(f1.length() - f2.length())});
+        Collections.sort(files, (File f1, File f2) -> (int)(f1.length() - f2.length()));
         for(File f : files)
             System.out.println(f.getName() + " " + f.length());
         System.out.println();
@@ -60,16 +60,15 @@
         LambdaTest2_SAM1 test = new LambdaTest2_SAM1();
 
         //type #2:
-        test.methodMars(#{File f -> {
+        test.methodMars((File f) -> {
             System.out.println("implementing Mars<File>.getAge(File f)...");
             return (int)f.length();
-            }
         });
-        test.methodJupiter(#{int n -> n+1});
+        test.methodJupiter((int n) -> n+1);
 
         //type #3:
-        test.methodXY(#{ List<String> strList -> strList.size() });
-        test.methodXYZ(#{ List<String> strList -> 20 });
+        test.methodXY((List<String> strList) -> strList.size() );
+        test.methodXYZ((List<String> strList) -> 20 );
     }
 
     //type #2:
--- a/test/tools/javac/lambda/sqe/SAM_types/LambdaTest2_SAM2.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/SAM_types/LambdaTest2_SAM2.java	Fri Sep 09 14:19:45 2011 +0100
@@ -48,25 +48,25 @@
         LambdaTest2_SAM2 test = new LambdaTest2_SAM2();
 
         //type #4 a):
-        test.methodAB(#{List list -> 100});
+        test.methodAB((List list) -> 100);
 
         //type #4 b):
-        test.methodFGHI(#{String s -> new Integer(22)});
+        test.methodFGHI((String s) -> new Integer(22));
         //type #4 b):
-        test.methodJK(#{String s -> new ArrayList<Number>()});
-        test.methodJK(#{String s -> new ArrayList()});
+        test.methodJK((String s) -> new ArrayList<Number>());
+        test.methodJK((String s) -> new ArrayList());
         //type #4 b):
-        test.methodJL(#{String s -> new ArrayList<Number>()});
-        test.methodJL(#{String s -> new ArrayList()});
+        test.methodJL((String s) -> new ArrayList<Number>());
+        test.methodJL((String s) -> new ArrayList());
         //type #4 b):
-        test.methodJKL(#{String s -> new ArrayList<Number>()});
-        test.methodJKL(#{String s -> new ArrayList()});
+        test.methodJKL((String s) -> new ArrayList<Number>());
+        test.methodJKL((String s) -> new ArrayList());
         //type #4 b):
-        test.methodJKLM(#{String s -> new ArrayList<Number>()});
-        test.methodJKLM(#{String s -> new ArrayList()});
+        test.methodJKLM((String s) -> new ArrayList<Number>());
+        test.methodJKLM((String s) -> new ArrayList());
 
         // tyep #4 c):
-        test.methodNO(#{File f -> {
+        test.methodNO((File f) -> {
                 String temp = null;
                 StringBuffer sb = new StringBuffer();
                 try
@@ -78,10 +78,9 @@
                 catch(FileNotFoundException fne){throw fne;}
                 catch(IOException e){e.printStackTrace();}
                 return sb.toString();
-            }
         });
         // tyep #4 c):
-        test.methodNOP(#{File f -> {
+        test.methodNOP((File f) -> {
                 String temp = null;
                 StringBuffer sb = new StringBuffer();
                 try
@@ -92,39 +91,34 @@
                 }
                 catch(IOException e){e.printStackTrace();}
                 return sb.toString();
-            }
         });
         // type #4 c):
-        test.methodBooDoo(#{String s -> s.length()});
+        test.methodBooDoo((String s) -> s.length());
 
         //type #4 d):
-        test.methodQR(#{Iterable i -> new ArrayList<String>()});
-        test.methodQR(#{Iterable i -> new ArrayList()});
+        test.methodQR((Iterable i) -> new ArrayList<String>());
+        test.methodQR((Iterable i) -> new ArrayList());
         //type #4 d):
-        test.methodUV(#{List<String> list -> {
+        test.methodUV((List<String> list) -> {
                 test.exceptionMethod1();
                 test.exceptionMethod2();
                 return new ArrayList<String>();
-            }
         });
-        test.methodUV(#{List<String> list -> {
+        test.methodUV((List<String> list) -> {
                 test.exceptionMethod1();
                 test.exceptionMethod2();
                 return new ArrayList();
-            }
         });
         //type #4 d):
-        test.methodUVW(#{List list -> {
+        test.methodUVW((List list) -> {
                 test.exceptionMethod1();
                 test.exceptionMethod2();
                 return new ArrayList<String>();
-            }
         });
-        test.methodUVW(#{List list -> {
+        test.methodUVW((List list) -> {
                 test.exceptionMethod1();
                 test.exceptionMethod2();
                 return new ArrayList();
-            }
         });
     }
 
--- a/test/tools/javac/lambda/sqe/SAM_types/LambdaTest2_neg1.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/SAM_types/LambdaTest2_neg1.java	Fri Sep 09 14:19:45 2011 +0100
@@ -33,7 +33,7 @@
     public static void main(String[] args) {
         LambdaTest2_neg1 test = new LambdaTest2_neg1();
         //not convertible - QooRoo is not a SAM
-        test.methodQooRoo(#{Integer i -> });
+        test.methodQooRoo((Integer i) -> { });
     }
     
     void methodQooRoo(QooRoo<Integer, Integer, Void> qooroo) { }
--- a/test/tools/javac/lambda/sqe/SAM_types/NonSAM1.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/SAM_types/NonSAM1.java	Fri Sep 09 14:19:45 2011 +0100
@@ -6,7 +6,7 @@
 
 public class NonSAM1 {
     void method() {
-        Planet n = #{Object o -> true};
+        Planet n = (Object o) -> true;
         System.out.println("never reach here " + n);
     }
 }
--- a/test/tools/javac/lambda/sqe/SAM_types/NonSAM3.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/SAM_types/NonSAM3.java	Fri Sep 09 14:19:45 2011 +0100
@@ -10,13 +10,13 @@
 public class NonSAM3 {
     void method() {
         //all of the following will have compile error: "the target type of a lambda conversion has multiple non-overriding abstract methods"
-        FooBar fb = #{Number n -> 100};
-        FooBar fb2 = #{Integer i -> 100};
-        DE de = #{List<Integer> list -> 100};
-        DE de2 = #{List<?> list -> 100};
-        DE de3 = #{List list -> 100};
-        DE de4 = #{Collection<Integer> collection -> 100};
-        DE de5 = #{Collection<?> collection -> 100};
-        DE de6 = #{Collection collection-> 100};
+        FooBar fb = (Number n) -> 100;
+        FooBar fb2 = (Integer i) -> 100;
+        DE de = (List<Integer> list) -> 100;
+        DE de2 = (List<?> list) -> 100;
+        DE de3 = (List list) -> 100;
+        DE de4 = (Collection<Integer> collection) -> 100;
+        DE de5 = (Collection<?> collection) -> 100;
+        DE de6 = (Collection collection) -> 100;
     }
 }
--- a/test/tools/javac/lambda/sqe/lambdaExpression/AbstractClass_neg.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/lambdaExpression/AbstractClass_neg.java	Fri Sep 09 14:19:45 2011 +0100
@@ -11,6 +11,6 @@
     }
 
     void test() {
-        SAM s = #{ 6 };
+        SAM s = ()-> 6;
     }
 }
--- a/test/tools/javac/lambda/sqe/lambdaExpression/AccessNonStatic_neg.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/lambdaExpression/AccessNonStatic_neg.java	Fri Sep 09 14:19:45 2011 +0100
@@ -9,20 +9,16 @@
     private int n = 0;
 
     static {
-        ((Runnable)
-            #{
-                System.out.println(this);
-                System.out.println(n);
-            }
-        ).run();
+        ((Runnable) ()-> {
+            System.out.println(this);
+            System.out.println(n);
+        }).run();
     }
 
     public static void test() {
-        ((Runnable)
-            #{
-                Object o = this;
-                n++;
-            }
-        ).run();
+        ((Runnable) ()-> {
+            Object o = this;
+            n++;
+        }).run();
     }
 }
--- a/test/tools/javac/lambda/sqe/lambdaExpression/AccessNonStatic_neg.out	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/lambdaExpression/AccessNonStatic_neg.out	Fri Sep 09 14:19:45 2011 +0100
@@ -1,5 +1,5 @@
-AccessNonStatic_neg.java:14:36: compiler.err.non-static.cant.be.ref: kindname.variable, this
-AccessNonStatic_neg.java:15:36: compiler.err.non-static.cant.be.ref: kindname.variable, n
-AccessNonStatic_neg.java:23:28: compiler.err.non-static.cant.be.ref: kindname.variable, this
-AccessNonStatic_neg.java:24:17: compiler.err.non-static.cant.be.ref: kindname.variable, n
+AccessNonStatic_neg.java:13:32: compiler.err.non-static.cant.be.ref: kindname.variable, this
+AccessNonStatic_neg.java:14:32: compiler.err.non-static.cant.be.ref: kindname.variable, n
+AccessNonStatic_neg.java:20:24: compiler.err.non-static.cant.be.ref: kindname.variable, this
+AccessNonStatic_neg.java:21:13: compiler.err.non-static.cant.be.ref: kindname.variable, n
 4 errors
--- a/test/tools/javac/lambda/sqe/lambdaExpression/EffectivelyFinal_neg.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/lambdaExpression/EffectivelyFinal_neg.java	Fri Sep 09 14:19:45 2011 +0100
@@ -11,7 +11,7 @@
         String s2 = "a";
         int n = 1;
         ((Runnable)
-            #{
+            ()-> {
                 s2 = "b"; //re-assign illegal here
                 System.out.println(n);
                 System.out.println(s);
--- a/test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression1.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression1.java	Fri Sep 09 14:19:45 2011 +0100
@@ -9,7 +9,7 @@
 public class InvalidExpression1 {
 
     void test() {
-        Comparator<Number> c = #{ Number n1, Number n2 -> 42; }; //not a statement
-        Comparator<Number> c = #{ Number n1, Number n2 -> return 42 }; //";" expected
+        Comparator<Number> c = (Number n1, Number n2)-> { 42; }; //not a statement
+        Comparator<Number> c = (Number n1, Number n2)-> { return 42 }; //";" expected
     }
 }
--- a/test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression3.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression3.java	Fri Sep 09 14:19:45 2011 +0100
@@ -9,6 +9,6 @@
 public class InvalidExpression3 {
 
     void test() {
-        Comparator<Integer> c2 = #{ Integer i1, Integer i2 -> return "0"; }; //return type need to match
+        Comparator<Integer> c2 = (Integer i1, Integer i2) -> { return "0"; }; //return type need to match
     }
 }
--- a/test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression4.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression4.java	Fri Sep 09 14:19:45 2011 +0100
@@ -11,6 +11,6 @@
     }
 
     void test() {
-        SAM s = #{ Integer i -> }; //parameters not match, boxing not allowed here
+        SAM s = (Integer i) -> { }; //parameters not match, boxing not allowed here
     }
 }
--- a/test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression5.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression5.java	Fri Sep 09 14:19:45 2011 +0100
@@ -7,6 +7,6 @@
 public class InvalidExpression5 {
 
     void test() {
-        Object o = #{ int n -> }; // Invalid target type
+        Object o = (int n) -> { }; // Invalid target type
     }
 }
--- a/test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression6.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression6.java	Fri Sep 09 14:19:45 2011 +0100
@@ -11,7 +11,7 @@
     }
 
     void test() {
-        SAM s = #{ int n -> break;}; //break not allowed
-        s = #{ n -> continue;}; //continue not allowed
+        SAM s = (int n) -> { break; }; //break not allowed
+        s = (int n) -> { continue; }; //continue not allowed
     }
 }
--- a/test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression6.out	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/lambdaExpression/InvalidExpression6.out	Fri Sep 09 14:19:45 2011 +0100
@@ -1,3 +1,3 @@
-InvalidExpression6.java:14:29: compiler.err.break.inside.lambda
-InvalidExpression6.java:15:21: compiler.err.cont.inside.lambda
+InvalidExpression6.java:14:30: compiler.err.break.inside.lambda
+InvalidExpression6.java:15:26: compiler.err.cont.inside.lambda
 2 errors
--- a/test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest1.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest1.java	Fri Sep 09 14:19:45 2011 +0100
@@ -52,22 +52,22 @@
     }
 
     Runnable test3() {
-        return #{assertionStr += "Runnable6";};
+        return ()-> { assertionStr += "Runnable6"; };
     }
 
     public static void main(String[] args) {
 
         //lambda expressions for SAM interface Runnable:
         //assign:
-        Runnable r = #{assertionStr += "Runnable1 ";};
+        Runnable r = ()-> { assertionStr += "Runnable1 "; };
         r.run();
 
         //cast:
-        ((Runnable)#{assertionStr += "Runnable2 ";}).run();
+        ((Runnable)()-> { assertionStr += "Runnable2 "; }).run();
 
-        Object o = (Runnable)#{};
+        Object o = (Runnable)()-> {};
 
-        o = (Runnable)#{
+        o = (Runnable)()-> {
                 switch (assertionStr) {
                     case "Runnable1 Runnable2 ":
                         assertionStr += "Runnable3 ";
@@ -79,10 +79,10 @@
             };
 
         //method parameter:
-        test1(#{assertionStr += "Runnable4 "; return;});
+        test1(()-> { assertionStr += "Runnable4 "; return; });
 
         LambdaTest1 test = new LambdaTest1();
-        test.test2((Runnable)#{assertionStr += "Runnable5 ";});
+        test.test2((Runnable)()-> { assertionStr += "Runnable5 "; });
 
         //return type:
         r = test.test3();
@@ -97,14 +97,14 @@
         list.add(-5);
         list.add(100);
         list.add(9);
-        Collections.sort(list, #{Integer i1, Integer i2 -> i2 - i1});
+        Collections.sort(list, (Integer i1, Integer i2)-> i2 - i1);
         String result = "";
         for(int i : list)
             result += i + " ";
         assertTrue(result.equals("100 10 9 4 -5 "));
 
         Collections.sort(list,
-            #{i1, i2 ->
+            (i1, i2) -> {
                 String s1 = i1.toString();
                 String s2 = i2.toString();
                 return s1.length() - s2.length();
--- a/test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest2.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest2.java	Fri Sep 09 14:19:45 2011 +0100
@@ -40,14 +40,14 @@
     public static void main(String[] args) {
         LambdaTest2 test = new LambdaTest2();
 
-        test.method2(#{ int n -> ; });
-        test.method2(#{ n -> ; }); // "int" is optional here
-        test.method2(#{ n -> }); // ";" is optional here
-        test.method2(#{ int n -> return;}); // ";" is mandatory here
-        test.method2(#{ int n -> count += n; });
+        test.method2((int n) -> { ; });
+        test.method2(n -> { }); // "int" is optional here
+        test.method2((int n) -> { }); // ";" is optional here
+        test.method2((int n) -> { return; }); // ";" is mandatory here
+        test.method2((int n) -> { count += n; });
         assertTrue(count == 10);
 
-        VoidInt vi = #{int i ->
+        VoidInt vi = (int i) -> {
                             switch (i) {
                                 case 0:
                                     System.out.println("normal");
@@ -57,36 +57,31 @@
                             }
                        };
 
-        test.method3(#{ count++; });
-        test.method3(#{});
+        test.method3(()-> { count++; });
+        test.method3(() -> {});
         assertTrue(count == 11);
 
-        VoidVoid vv = #{ while(true)
+        VoidVoid vv = ()-> { while(true)
                             if(false)
                                 break;
                             else
                                 continue;
                        };
 
-        IntVoid iv1 = #{ 42 };
-        IntVoid iv2 = #{ return 43; };//";" is mandatory here
-        IntVoid iv3 = #{ -> 44 }; // "->" is optional here
-        IntVoid iv4 = #{ -> return 45; }; // "->" is optional here
+        IntVoid iv1 = () -> 42;
+        IntVoid iv2 = () -> { return 43; };//";" is mandatory here
         assertTrue(iv1.ivMethod() == 42);
         assertTrue(iv2.ivMethod() == 43);
-        assertTrue(iv3.ivMethod() == 44);
-        assertTrue(iv4.ivMethod() == 45);
-
-        IntInt ii1 = #{ int n -> n+1 };
-        IntInt ii2 = #{ n -> 42 };
-        IntInt ii3 = #{ n -> return 43; };
+        
+        IntInt ii1 = (int n) -> n+1;
+        IntInt ii2 = n -> 42;
+        IntInt ii3 = n -> { return 43; };
         IntInt ii4 =
-            #{
-                int n ->{ //"{" optional here
+            (int n) -> {
                 if(n > 0)
                     return n+1;
                 else
-                    return n-1;}//"}" optional here
+                    return n-1;
             };
         assertTrue(ii1.iiMethod(1) == 2);
         assertTrue(ii2.iiMethod(1) == 42);
--- a/test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest3.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest3.java	Fri Sep 09 14:19:45 2011 +0100
@@ -42,7 +42,7 @@
         int n = 2; //effectively final variable
 
         Runnable r = ((Runnable)
-            #{
+            () -> {
                 count += N;
                 count += n;
             }
--- a/test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest4.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest4.java	Fri Sep 09 14:19:45 2011 +0100
@@ -32,7 +32,7 @@
 
     {
         ((Runnable)
-            #{
+            ()-> {
                 this.init();
                 assertTrue(this.toString().equals(thisStr));
                 count++;
@@ -55,7 +55,7 @@
     private void m() {
         String s1 = this.toString();
         ((Runnable)
-            #{
+            ()-> {
                 assertTrue(this.toString().equals(thisStr));
                 assertTrue(this.toString().equals(s1));
             }
--- a/test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest5.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest5.java	Fri Sep 09 14:19:45 2011 +0100
@@ -46,19 +46,19 @@
     }
 
     public static void main(String[] args) {
-        B b = #{ int i -> ((A)#{ 5 }).m() };
+        B b = (int i) -> ((A)()-> 5).m();
         assertTrue(b.make(0) == 5);
 
-        A a = #{ ((A)#{ return 6; }).m() }; //self reference
+        A a = () -> ((A)()-> { return 6; }).m(); //self reference
         assertTrue(a.m() == 6);
 
-        A a2 = #{
-                  A an = #{ return 7; }; //self reference
+        A a2 = ()-> {
+                  A an = ()-> { return 7; }; //self reference
                   return an.m();
                 };
         assertTrue(a2.m() == 7);
 
-        A a3 = #{ a3.m() }; //self reference
+        A a3 = () -> a3.m(); //self reference
         try {
             a3.m();
         } catch(StackOverflowError e) {
@@ -66,7 +66,7 @@
         }
         assertTrue(count==1);
 
-        A a4 = #{ ((B)#{ int i -> ((A)#{ 9 }).m() }).make(0) };
+        A a4 = ()-> ((B)(int i)-> ((A)()-> 9).m() ).make(0);
         assertTrue(a4.m() == 9);
     }
 }
--- a/test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest6.java	Tue Sep 06 11:34:14 2011 +0100
+++ b/test/tools/javac/lambda/sqe/lambdaExpression/LambdaTest6.java	Fri Sep 09 14:19:45 2011 +0100
@@ -51,7 +51,7 @@
 
     private void test1()
     {
-        L la = #{ s -> };
+        L la = s -> { };
         la.m("hi");
         Class<? extends L> c1 = la.getClass();
         Method[] methods = c1.getDeclaredMethods();
@@ -67,7 +67,7 @@
 
     private void test2()
     {
-        KM km = #{ s -> };
+        KM km = s -> { };
         //km.m("hi");
         Class<? extends KM> c2 = km.getClass();
         Method[] methods = c2.getDeclaredMethods();
@@ -83,7 +83,7 @@
 
     private void test3()
     {
-        N na = #{ "hi" };
+        N na = ()-> "hi";
         assertTrue( na.m().equals("hi") );
         assertTrue( ((H)na).m().equals("hi") );
         Class<? extends N> c3 = na.getClass();