changeset 814:72a97b863b48

Misc bug fixes: *) project lambda features should be enabled with source >= 8 *) lambda finder erroneously reports that some anonymous inner class with multiple method defs are 'lambdifiable' *) javac crashes when compiling a program containing a bad cast from lambda to primitive *) regression involving return type-inference of under-constrained variables in generic constructor calls
author mcimadamore
date Wed, 15 Dec 2010 16:23:31 +0000
parents 7af674c07fca
children f9e407ab55b4
files src/share/classes/com/sun/tools/javac/code/Source.java src/share/classes/com/sun/tools/javac/code/Types.java src/share/classes/com/sun/tools/javac/comp/Attr.java src/share/classes/com/sun/tools/javac/jvm/Target.java src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java src/share/classes/com/sun/tools/javac/resources/compiler.properties src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java src/share/classes/javax/lang/model/SourceVersion.java test/tools/javac/api/T6395981.java test/tools/javac/api/TestContainTypes.java test/tools/javac/defender/Neg03.out test/tools/javac/lambda/BadLambdaFinder01.java test/tools/javac/lambda/BadLambdaFinder01.out test/tools/javac/lambda/Conformance01.java test/tools/javac/lambda/SourceLevelTest.java test/tools/javac/lambda/SourceLevelTest.out test/tools/javac/lambda/TargetType17.java test/tools/javac/lambda/TargetType17.out test/tools/javac/meth/InvokeDyn.java test/tools/javac/meth/InvokeDynTrans.java test/tools/javac/meth/InvokeMH.java test/tools/javac/meth/InvokeMHTrans.java test/tools/javac/processing/warnings/TestSourceVersionWarnings.java test/tools/javac/quid/T6999438.java
diffstat 24 files changed, 278 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/code/Source.java	Wed Dec 15 13:26:05 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/code/Source.java	Wed Dec 15 16:23:31 2010 +0000
@@ -65,7 +65,10 @@
     JDK1_6("1.6"),
 
     /** 1.7 covers the to be determined language features that will be added in JDK 7. */
-    JDK1_7("1.7");
+    JDK1_7("1.7"),
+
+    /** 1.8 covers the to be determined language features that will be added in JDK 8. */
+    JDK1_8("1.8");
 
     private static final Context.Key<Source> sourceKey
         = new Context.Key<Source>();
@@ -92,13 +95,14 @@
         tab.put("5", JDK1_5); // Make 5 an alias for 1.5
         tab.put("6", JDK1_6); // Make 6 an alias for 1.6
         tab.put("7", JDK1_7); // Make 7 an alias for 1.7
+        tab.put("8", JDK1_8); // Make 7 an alias for 1.7
     }
 
     private Source(String name) {
         this.name = name;
     }
 
-    public static final Source DEFAULT = JDK1_7;
+    public static final Source DEFAULT = JDK1_8;
 
     public static Source lookup(String name) {
         return tab.get(name);
@@ -131,9 +135,6 @@
     public boolean allowMulticatch() {
         return compareTo(JDK1_7) >= 0;
     }
-    public boolean allowDefenderMethods() {
-        return compareTo(JDK1_7) >= 0;
-    }
     public boolean allowEnums() {
         return compareTo(JDK1_5) >= 0;
     }
@@ -181,13 +182,16 @@
         return compareTo(JDK1_7) >= 0;
     }
     public boolean allowLambda() {
-        return compareTo(JDK1_7) >= 0;
+        return compareTo(JDK1_8) >= 0;
     }
     public boolean allowThrowTypeParameters() {
-        return compareTo(JDK1_7) >= 0;
+        return compareTo(JDK1_8) >= 0;
     }
     public boolean allowMethodReferences() {
-        return compareTo(JDK1_7) >= 0;
+        return compareTo(JDK1_8) >= 0;
+    }
+    public boolean allowDefenderMethods() {
+        return compareTo(JDK1_8) >= 0;
     }
     public static SourceVersion toSourceVersion(Source source) {
         switch(source) {
@@ -203,6 +207,8 @@
             return RELEASE_6;
         case JDK1_7:
             return RELEASE_7;
+        case JDK1_8:
+            return RELEASE_8;
         default:
             return null;
         }
--- a/src/share/classes/com/sun/tools/javac/code/Types.java	Wed Dec 15 13:26:05 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Wed Dec 15 16:23:31 2010 +0000
@@ -624,7 +624,7 @@
             Object[] args2 = new Object[args.length + 3];
             args2[0] = getTargetName();
             args2[1] = Kinds.kindName(samType.tsym);
-            args2[2] = samType.tsym;
+            args2[2] = samType;
             int pos = 3;
             for (Object o : args) {
                 args2[pos] = o;
--- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Dec 15 13:26:05 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Dec 15 16:23:31 2010 +0000
@@ -1782,14 +1782,6 @@
                 //       ...
                 //     }
 
-                if (allowLambda &&
-                        identifyLambdaCandidate &&
-                        clazztype.tag == CLASS &&
-                        lambdaOrReferenceAllowed(tree) &&
-                        !types.findSAM(clazztype, env).isErroneous()) {
-                    log.note(tree.def, "potential.lambda.found");
-                }
-
                 if (Resolve.isStatic(env)) cdef.mods.flags |= STATIC;
 
                 if (clazztype.tsym.isInterface()) {
@@ -1800,6 +1792,8 @@
 
                 attribStat(cdef, localEnv);
 
+                checkLambdaCandidate(tree, cdef.sym, clazztype);
+
                 // If an outer instance is given,
                 // prefix it to the constructor arguments
                 // and delete it from the new expression
@@ -1838,11 +1832,38 @@
             //we need to 'close' open type-variables in the constructor type
             //this can happen if the constructor is passed a lambda expression
             tree.constructorType.asMethodType(types).restype =
-                    check(tree, tree.constructorType.getReturnType(), VAL, pkind, pt);
+                    check(tree, tree.constructorType.getReturnType(), VAL, pkind, syms.voidType);
         }
         result = check(tree, owntype, VAL, pkind, pt);
         chk.validate(tree.typeargs, localEnv);
     }
+    //WHERE
+        private void checkLambdaCandidate(JCNewClass tree, ClassSymbol csym, Type clazztype) {
+            if (allowLambda &&
+                    identifyLambdaCandidate &&
+                    clazztype.tag == CLASS &&
+                    lambdaOrReferenceAllowed(tree) &&
+                    !types.findSAM(clazztype, env).isErroneous()) {
+                Types.SAMResult res = types.findSAM(clazztype, env);
+                int count = 0;
+                boolean found = false;
+                for (Symbol sym : csym.members().getElements()) {
+                    if ((sym.flags() & SYNTHETIC) != 0 ||
+                            sym.isConstructor()) continue;
+                    count++;
+                    if (sym.kind != MTH ||
+                            !sym.name.equals(res.getTargetName())) continue;
+                    Type mtype = types.memberType(clazztype, sym);
+                    if (types.overrideEquivalent(mtype, res.getTargetType())) {
+                        found = true;
+                    }
+                }
+                if (found && count == 1) {
+                    log.note(tree.def, "potential.lambda.found");
+                }
+            }
+        }
+
 
     Type attribDiamond(Env<AttrContext> env,
                         JCNewClass tree,
--- a/src/share/classes/com/sun/tools/javac/jvm/Target.java	Wed Dec 15 13:26:05 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/jvm/Target.java	Wed Dec 15 16:23:31 2010 +0000
@@ -66,7 +66,10 @@
     JDK1_6("1.6", 50, 0),
 
     /** JDK 7. */
-    JDK1_7("1.7", 51, 0);
+    JDK1_7("1.7", 51, 0),
+
+    /** JDK 8. (alias for JDK 7 for now) */
+    JDK1_8("1.8", 51, 0);
 
     private static final Context.Key<Target> targetKey =
         new Context.Key<Target>();
@@ -242,7 +245,7 @@
         return compareTo(JDK1_5) >= 0;
     }
     public boolean useDefenderFlag() {
-        return compareTo(JDK1_7) >= 0;
+        return compareTo(JDK1_8) >= 0;
     }
 
     /** Return the character to be used in constructing synthetic
@@ -324,6 +327,6 @@
      *  the defender methods language feature
      */
     public boolean hasDefenderAttribute() {
-        return compareTo(JDK1_7) >= 0;
+        return compareTo(JDK1_8) >= 0;
     }
 }
--- a/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java	Wed Dec 15 13:26:05 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java	Wed Dec 15 16:23:31 2010 +0000
@@ -49,7 +49,7 @@
  */
 @SupportedAnnotationTypes("*")
 // TODO: Change to version 7 based visitors when available
-@SupportedSourceVersion(SourceVersion.RELEASE_7)
+@SupportedSourceVersion(SourceVersion.RELEASE_8)
 public class PrintingProcessor extends AbstractProcessor {
     PrintWriter writer;
 
--- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Wed Dec 15 13:26:05 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Wed Dec 15 16:23:31 2010 +0000
@@ -1424,23 +1424,23 @@
 
 compiler.err.lambda.not.supported.in.source=\
     lambda expressions are not supported in -source {0}\n\
-(use -source 7 or higher to enable strings in switch)
+(use -source 8 or higher to enable lambda expressions)
 
 compiler.err.func.types.not.supported.in.source=\
     function types are not supported in -source {0}\n\
-(use -source 7 or higher and -XDallowFunctionTypes to enable function types)
+(use -source 8 or higher and -XDallowFunctionTypes to enable function types)
 
 compiler.err.defender.methods.not.supported.in.source=\
     defender methods are not supported in -source {0}\n\
-(use -source 7 or higher to enable defender methods)
+(use -source 8 or higher to enable defender methods)
 
 compiler.err.throw.typarams.not.supported.in.source=\
     ''throws'' type-parameters are not supported in -source {0}\n\
-(use -source 7 or higher to enable ''throws'' type-parameters)
+(use -source 8 or higher to enable ''throws'' type-parameters)
 
 compiler.err.method.references.not.supported.in.source=\
     method references are not supported in -source {0}\n\
-(use -source 7 or higher to enable method references)
+(use -source 8 or higher to enable method references)
 
 ########################################
 # Diagnostics for where clause implementation
--- a/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Wed Dec 15 13:26:05 2010 +0000
+++ b/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Wed Dec 15 16:23:31 2010 +0000
@@ -360,6 +360,13 @@
         }
 
         @Override
+        public String visitFunctionType(FunctionType t, Locale locale) {
+            return (t.getReturnType().isErroneous()) ?
+                localize(locale, "compiler.misc.type.lambda") :
+                super.visitFunctionType(t, locale);
+        }
+
+        @Override
         public String visitCapturedType(CapturedType t, Locale locale) {
             if (getConfiguration().isEnabled(RichFormatterFeature.WHERE_CLAUSES)) {
                 return localize(locale,
--- a/src/share/classes/javax/lang/model/SourceVersion.java	Wed Dec 15 13:26:05 2010 +0000
+++ b/src/share/classes/javax/lang/model/SourceVersion.java	Wed Dec 15 16:23:31 2010 +0000
@@ -124,7 +124,15 @@
      *
      * @since 1.7
      */
-    RELEASE_7;
+    RELEASE_7,
+
+    /**
+     * The version recognized by the Java Platform, Standard Edition
+     * 8.
+     *
+     * @since 1.8
+     */
+    RELEASE_8;
 
     // Note that when adding constants for newer releases, the
     // behavior of latest() and latestSupported() must be updated too.
@@ -135,7 +143,7 @@
      * @return the latest source version that can be modeled
      */
     public static SourceVersion latest() {
-        return RELEASE_7;
+        return RELEASE_8;
     }
 
     private static final SourceVersion latestSupported = getLatestSupported();
@@ -143,7 +151,9 @@
     private static SourceVersion getLatestSupported() {
         try {
             String specVersion = System.getProperty("java.specification.version");
-            if ("1.7".equals(specVersion))
+            if ("1.8".equals(specVersion))
+                return RELEASE_8;
+            else if ("1.7".equals(specVersion))
                 return RELEASE_7;
             else if ("1.6".equals(specVersion))
                 return RELEASE_6;
--- a/test/tools/javac/api/T6395981.java	Wed Dec 15 13:26:05 2010 +0000
+++ b/test/tools/javac/api/T6395981.java	Wed Dec 15 16:23:31 2010 +0000
@@ -28,8 +28,8 @@
  * @author  Peter von der Ah\u00e9
  * @run main/fail T6395981
  * @run main/fail T6395981 RELEASE_3 RELEASE_5 RELEASE_6
- * @run main/fail T6395981 RELEASE_0 RELEASE_1 RELEASE_2 RELEASE_3 RELEASE_4 RELEASE_5 RELEASE_6
- * @run main T6395981 RELEASE_3 RELEASE_4 RELEASE_5 RELEASE_6 RELEASE_7
+ * @run main/fail T6395981 RELEASE_0 RELEASE_1 RELEASE_2 RELEASE_3 RELEASE_4 RELEASE_5 RELEASE_6 RELEASE_&
+ * @run main T6395981 RELEASE_3 RELEASE_4 RELEASE_5 RELEASE_6 RELEASE_7 RELEASE_8
  */
 
 import java.util.EnumSet;
--- a/test/tools/javac/api/TestContainTypes.java	Wed Dec 15 13:26:05 2010 +0000
+++ b/test/tools/javac/api/TestContainTypes.java	Wed Dec 15 16:23:31 2010 +0000
@@ -151,7 +151,7 @@
         ct.analyze();
     }
 
-    @SupportedSourceVersion(SourceVersion.RELEASE_7)
+    @SupportedSourceVersion(SourceVersion.RELEASE_8)
     static class ContainTypesTester extends AbstractProcessor {
 
         boolean expected;
--- a/test/tools/javac/defender/Neg03.out	Wed Dec 15 13:26:05 2010 +0000
+++ b/test/tools/javac/defender/Neg03.out	Wed Dec 15 16:23:31 2010 +0000
@@ -1,3 +1,3 @@
 Neg03.java:57:12: compiler.err.does.not.override.abstract: Neg03.W, m(), Neg03.D
-Neg03.java:59:12: compiler.err.types.incompatible.diff.default: Neg03.A, Neg03.D, m()
+Neg03.java:59:12: compiler.err.types.incompatible.diff.default: Neg03.A, Neg03.B, m()
 2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/lambda/BadLambdaFinder01.java	Wed Dec 15 16:23:31 2010 +0000
@@ -0,0 +1,49 @@
+/*
+ * 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 lambda finder should not tag anonymous classes which override non-abstract methods in the SAM
+ * @compile/fail/ref=BadLambdaFinder01.out -XDidentifyLambdaCandidate=true -XDrawDiagnostics BadLambdaFinder01.java
+ */
+
+class BadLambdaFinder01 {
+
+    static abstract class SAM {
+       abstract void m1();
+       void m2() { }
+    }
+
+    SAM s1 = new SAM() {
+        void m1() {}
+        void m2() {}
+    };
+
+    SAM s2 = new SAM() {
+        void m1() {}
+    };
+
+    SAM s3 = new SAM() {
+        void m2() {}
+    };
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/lambda/BadLambdaFinder01.out	Wed Dec 15 16:23:31 2010 +0000
@@ -0,0 +1,3 @@
+BadLambdaFinder01.java:42:24: compiler.note.potential.lambda.found
+BadLambdaFinder01.java:46:24: compiler.err.does.not.override.abstract: compiler.misc.anonymous.class: BadLambdaFinder01$3, m1(), BadLambdaFinder01.SAM
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/lambda/Conformance01.java	Wed Dec 15 16:23:31 2010 +0000
@@ -0,0 +1,34 @@
+/*
+ * 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 lambda compiler regression with uninferred type-variables in generic constructor call
+ * @compile Conformance01.java
+ */
+
+class Conformance01 {
+    <T1, T2> Conformance01(T1 t) { }
+
+    Conformance01 c01 = new Conformance01(null);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/lambda/SourceLevelTest.java	Wed Dec 15 16:23:31 2010 +0000
@@ -0,0 +1,46 @@
+/*
+ * 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 features are not enabled with source < 8
+ * @compile/fail/ref=SourceLevelTest.out -XDrawDiagnostics -source 7 SourceLevelTest.java
+ */
+
+class SourceLevelTest<throws X> {
+    interface I {
+        void m() default SourceLevelTest.impl;
+    }
+
+    interface SAM {
+        void m();
+    }
+
+    SAM s1 = #{ };
+    SAM s2 = this#m();
+    SourceLevelTest<void> slt = null;
+    SourceLevelTest<java.io.IOException|UnsupportedOperationException> slt = null;
+
+    static void impl(I i) {}
+    void m() {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/lambda/SourceLevelTest.out	Wed Dec 15 16:23:31 2010 +0000
@@ -0,0 +1,7 @@
+- compiler.warn.source.no.bootclasspath: 1.7
+SourceLevelTest.java:30:23: compiler.err.throw.typarams.not.supported.in.source: 1.7
+SourceLevelTest.java:32:26: compiler.err.defender.methods.not.supported.in.source: 1.7
+SourceLevelTest.java:39:14: compiler.err.lambda.not.supported.in.source: 1.7
+SourceLevelTest.java:40:19: compiler.err.method.references.not.supported.in.source: 1.7
+4 errors
+1 warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/lambda/TargetType17.java	Wed Dec 15 16:23:31 2010 +0000
@@ -0,0 +1,43 @@
+/*
+ * 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 javac recovers succesfully from bad cast conversion to primitive type
+ * @compile/fail/ref=TargetType17.out -XDrawDiagnostics TargetType17.java
+ */
+
+class TargetType17 {
+    interface SAM<X> {
+        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 };
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/lambda/TargetType17.out	Wed Dec 15 16:23:31 2010 +0000
@@ -0,0 +1,9 @@
+TargetType17.java:35:21: compiler.err.prob.found.req: (compiler.misc.incompatible.types.1: (compiler.misc.target.for.lambda.conv.must.be.abstract: null, kindname.class, byte)), compiler.misc.type.lambda, byte
+TargetType17.java:36:23: compiler.err.prob.found.req: (compiler.misc.incompatible.types.1: (compiler.misc.target.for.lambda.conv.must.be.abstract: null, kindname.class, short)), compiler.misc.type.lambda, short
+TargetType17.java:37:19: compiler.err.prob.found.req: (compiler.misc.incompatible.types.1: (compiler.misc.target.for.lambda.conv.must.be.abstract: null, kindname.class, int)), compiler.misc.type.lambda, int
+TargetType17.java:38:21: compiler.err.prob.found.req: (compiler.misc.incompatible.types.1: (compiler.misc.target.for.lambda.conv.must.be.abstract: null, kindname.class, long)), compiler.misc.type.lambda, long
+TargetType17.java:39:23: compiler.err.prob.found.req: (compiler.misc.incompatible.types.1: (compiler.misc.target.for.lambda.conv.must.be.abstract: null, kindname.class, float)), compiler.misc.type.lambda, float
+TargetType17.java:40:25: compiler.err.prob.found.req: (compiler.misc.incompatible.types.1: (compiler.misc.target.for.lambda.conv.must.be.abstract: null, kindname.class, double)), compiler.misc.type.lambda, double
+TargetType17.java:41:21: compiler.err.prob.found.req: (compiler.misc.incompatible.types.1: (compiler.misc.target.for.lambda.conv.must.be.abstract: null, kindname.class, char)), compiler.misc.type.lambda, char
+TargetType17.java:42:27: compiler.err.prob.found.req: (compiler.misc.incompatible.types.1: (compiler.misc.target.for.lambda.conv.must.be.abstract: null, kindname.class, boolean)), compiler.misc.type.lambda, boolean
+8 errors
--- a/test/tools/javac/meth/InvokeDyn.java	Wed Dec 15 13:26:05 2010 +0000
+++ b/test/tools/javac/meth/InvokeDyn.java	Wed Dec 15 16:23:31 2010 +0000
@@ -28,7 +28,7 @@
  * @author jrose
  *
  * @library ..
- * @compile -source 7 -target 7 -XDinvokedynamic -XDallowTransitionalJSR292=no InvokeDyn.java
+ * @compile -XDinvokedynamic -XDallowTransitionalJSR292=no InvokeDyn.java
  */
 //No: @run main/othervm -XX:+EnableInvokeDynamic meth.InvokeDyn
 
--- a/test/tools/javac/meth/InvokeDynTrans.java	Wed Dec 15 13:26:05 2010 +0000
+++ b/test/tools/javac/meth/InvokeDynTrans.java	Wed Dec 15 16:23:31 2010 +0000
@@ -28,7 +28,7 @@
  * @author jrose
  *
  * @library ..
- * @compile/fail/ref=InvokeDynTrans.out -Werror -XDrawDiagnostics -source 7 -target 7 InvokeDynTrans.java
+ * @compile/fail/ref=InvokeDynTrans.out -Werror -XDrawDiagnostics InvokeDynTrans.java
  */
 //No: @run main/othervm -XX:+EnableInvokeDynamic meth.InvokeDyn
 
--- a/test/tools/javac/meth/InvokeMH.java	Wed Dec 15 13:26:05 2010 +0000
+++ b/test/tools/javac/meth/InvokeMH.java	Wed Dec 15 16:23:31 2010 +0000
@@ -27,7 +27,7 @@
  * @summary Generate call sites for method handle
  * @author jrose
  *
- * @compile -source 7 -target 7 -XDallowTransitionalJSR292=no InvokeMH.java
+ * @compile -XDallowTransitionalJSR292=no InvokeMH.java
  */
 
 /*
--- a/test/tools/javac/meth/InvokeMHTrans.java	Wed Dec 15 13:26:05 2010 +0000
+++ b/test/tools/javac/meth/InvokeMHTrans.java	Wed Dec 15 16:23:31 2010 +0000
@@ -26,7 +26,7 @@
  * @summary Generate call sites for method handle
  * @author jrose
  *
- * @compile/fail/ref=InvokeMHTrans.out -Werror -XDrawDiagnostics -source 7 -target 7 InvokeMHTrans.java
+ * @compile/fail/ref=InvokeMHTrans.out -Werror -XDrawDiagnostics InvokeMHTrans.java
  */
 
 /*
--- a/test/tools/javac/processing/warnings/TestSourceVersionWarnings.java	Wed Dec 15 13:26:05 2010 +0000
+++ b/test/tools/javac/processing/warnings/TestSourceVersionWarnings.java	Wed Dec 15 16:23:31 2010 +0000
@@ -35,7 +35,7 @@
  * @compile/ref=gold_sv_warn_5_6.out   -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_5 -source 1.6 -Xlint:-options HelloWorld.java
  * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 -Xlint:-options HelloWorld.java
  * @compile/ref=gold_unsp_warn.out     -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 -Xlint:-options -Aunsupported HelloWorld.java
- * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_7 -source 1.7                 HelloWorld.java
+ * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_7 -source 1.7 -Xlint:-options HelloWorld.java
  */
 
 import java.util.Set;
--- a/test/tools/javac/quid/T6999438.java	Wed Dec 15 13:26:05 2010 +0000
+++ b/test/tools/javac/quid/T6999438.java	Wed Dec 15 16:23:31 2010 +0000
@@ -1,7 +1,7 @@
 /* @test /nodynamiccopyright/
  * @bug 6999438
  * @summary remove support for exotic identifiers from JDK 7
- * @compile/fail/ref=T6999438.out -XDrawDiagnostics -source 7 T6999438.java
+ * @compile/fail/ref=T6999438.out -XDrawDiagnostics T6999438.java
  */
 
 class Test {