8005299: Add FunctionalInterface checking to javac
authormcimadamore
Wed, 16 Jan 2013 16:30:11 +0000
changeset 15361 01f1828683e6
parent 15360 450af2a9e3c9
child 15362 f564dcca5525
8005299: Add FunctionalInterface checking to javac Summary: Javac should check that types annotated with @FunctionalInterface are indeed functional interfaces Reviewed-by: jjg
langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java
langtools/src/share/classes/com/sun/tools/javac/code/Types.java
langtools/src/share/classes/com/sun/tools/javac/comp/Check.java
langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties
langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java
langtools/test/tools/javac/diags/examples.not-yet.txt
langtools/test/tools/javac/diags/examples/BadFunctionalIntfAnno.java
langtools/test/tools/javac/lambda/BadConv03.out
langtools/test/tools/javac/lambda/BadLambdaPos.out
langtools/test/tools/javac/lambda/BadTargetType.out
langtools/test/tools/javac/lambda/FunctionalInterfaceAnno.java
langtools/test/tools/javac/lambda/FunctionalInterfaceAnno.out
langtools/test/tools/javac/lambda/Intersection01.out
langtools/test/tools/javac/lambda/LambdaConv09.out
langtools/test/tools/javac/lambda/LambdaExpr10.out
langtools/test/tools/javac/lambda/MethodReference04.out
langtools/test/tools/javac/lambda/TargetType17.out
langtools/test/tools/javac/lambda/TargetType43.out
langtools/test/tools/javac/lambda/funcInterfaces/LambdaTest2_neg1.out
langtools/test/tools/javac/lambda/funcInterfaces/NonSAM1.out
langtools/test/tools/javac/lambda/funcInterfaces/NonSAM3.out
langtools/test/tools/javac/lambda/lambdaExpression/AbstractClass_neg.out
langtools/test/tools/javac/lambda/lambdaExpression/InvalidExpression5.out
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java	Wed Jan 16 16:30:11 2013 +0000
@@ -164,6 +164,7 @@
     public final Type repeatableType;
     public final Type documentedType;
     public final Type elementTypeType;
+    public final Type functionalInterfaceType;
 
     /** The symbol representing the length field of an array.
      */
@@ -507,6 +508,7 @@
         nativeHeaderType = enterClass("java.lang.annotation.Native");
         nativeHeaderType_old = enterClass("javax.tools.annotation.GenerateNativeHeader");
         lambdaMetafactory = enterClass("java.lang.invoke.LambdaMetafactory");
+        functionalInterfaceType = enterClass("java.lang.FunctionalInterface");
 
         synthesizeEmptyInterfaceIfMissing(autoCloseableType);
         synthesizeEmptyInterfaceIfMissing(cloneableType);
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Wed Jan 16 16:30:11 2013 +0000
@@ -392,9 +392,9 @@
          * Compute the function descriptor associated with a given functional interface
          */
         public FunctionDescriptor findDescriptorInternal(TypeSymbol origin, CompoundScope membersCache) throws FunctionDescriptorLookupError {
-            if (!origin.isInterface()) {
+            if (!origin.isInterface() || (origin.flags() & ANNOTATION) != 0) {
                 //t must be an interface
-                throw failure("not.a.functional.intf");
+                throw failure("not.a.functional.intf", origin);
             }
 
             final ListBuffer<Symbol> abstracts = ListBuffer.lb();
@@ -406,13 +406,13 @@
                     abstracts.append(sym);
                 } else {
                     //the target method(s) should be the only abstract members of t
-                    throw failure("not.a.functional.intf.1",
+                    throw failure("not.a.functional.intf.1",  origin,
                             diags.fragment("incompatible.abstracts", Kinds.kindName(origin), origin));
                 }
             }
             if (abstracts.isEmpty()) {
                 //t must define a suitable non-generic method
-                throw failure("not.a.functional.intf.1",
+                throw failure("not.a.functional.intf.1", origin,
                             diags.fragment("no.abstracts", Kinds.kindName(origin), origin));
             } else if (abstracts.size() == 1) {
                 return new FunctionDescriptor(abstracts.first());
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Wed Jan 16 16:30:11 2013 +0000
@@ -2601,6 +2601,18 @@
             if (!isOverrider(s))
                 log.error(a.pos(), "method.does.not.override.superclass");
         }
+
+        if (a.annotationType.type.tsym == syms.functionalInterfaceType.tsym) {
+            if (s.kind != TYP) {
+                log.error(a.pos(), "bad.functional.intf.anno");
+            } else {
+                try {
+                    types.findDescriptorSymbol((TypeSymbol)s);
+                } catch (Types.FunctionDescriptorLookupError ex) {
+                    log.error(a.pos(), "bad.functional.intf.anno.1", ex.getDiagnostic());
+                }
+            }
+        }
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Wed Jan 16 16:30:11 2013 +0000
@@ -178,13 +178,22 @@
 compiler.misc.incompatible.abstracts=\
     multiple non-overriding abstract methods found in {0} {1}
 
-compiler.misc.not.a.functional.intf=\
-    the target type must be a functional interface
+compiler.err.bad.functional.intf.anno=\
+    Unexpected @FunctionalInterface annotation
 
 # 0: message segment
+compiler.err.bad.functional.intf.anno.1=\
+    Unexpected @FunctionalInterface annotation\n\
+    {0}
+
+# 0: symbol
+compiler.misc.not.a.functional.intf=\
+    {0} is not a functional interface
+
+# 0: symbol, 1: message segment
 compiler.misc.not.a.functional.intf.1=\
-    the target type must be a functional interface\n\
-    {0}
+    {0} is not a functional interface\n\
+    {1}
 
 # 0: symbol, 1: symbol kind, 2: symbol
 compiler.misc.invalid.generic.lambda.target=\
--- a/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Wed Jan 16 16:30:11 2013 +0000
@@ -288,7 +288,7 @@
 
         public String simplify(Symbol s) {
             String name = s.getQualifiedName().toString();
-            if (!s.type.isCompound()) {
+            if (!s.type.isCompound() && !s.type.isPrimitive()) {
                 List<Symbol> conflicts = nameClashes.get(s.getSimpleName());
                 if (conflicts == null ||
                     (conflicts.size() == 1 &&
--- a/langtools/test/tools/javac/diags/examples.not-yet.txt	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/test/tools/javac/diags/examples.not-yet.txt	Wed Jan 16 16:30:11 2013 +0000
@@ -1,6 +1,7 @@
 compiler.err.already.annotated                          # internal compiler error?
 compiler.err.already.defined.this.unit                  # seems to be masked by compiler.err.duplicate.class
 compiler.err.annotation.value.not.allowable.type        # cannot happen: precluded by complete type-specific tests
+compiler.err.bad.functional.intf.anno                   # seems to be masked by compiler.err.annotation.type.not.applicable
 compiler.err.cant.read.file                             # (apt.JavaCompiler?)
 compiler.err.cant.select.static.class.from.param.type
 compiler.err.dc.unterminated.string                     # cannot happen
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/BadFunctionalIntfAnno.java	Wed Jan 16 16:30:11 2013 +0000
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2013, 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.
+ */
+
+// key: compiler.err.bad.functional.intf.anno.1
+// key: compiler.misc.not.a.functional.intf
+
+@FunctionalInterface
+class BadFunctionalIntfAnno { }
--- a/langtools/test/tools/javac/lambda/BadConv03.out	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/test/tools/javac/lambda/BadConv03.out	Wed Jan 16 16:30:11 2013 +0000
@@ -1,2 +1,2 @@
-BadConv03.java:19:11: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, BadConv03.B))
+BadConv03.java:19:11: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: BadConv03.B, (compiler.misc.incompatible.abstracts: kindname.interface, BadConv03.B))
 1 error
--- a/langtools/test/tools/javac/lambda/BadLambdaPos.out	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/test/tools/javac/lambda/BadLambdaPos.out	Wed Jan 16 16:30:11 2013 +0000
@@ -4,6 +4,6 @@
 BadLambdaPos.java:23:18: compiler.err.unexpected.lambda
 BadLambdaPos.java:23:34: compiler.err.unexpected.lambda
 BadLambdaPos.java:24:21: compiler.err.unexpected.lambda
-BadLambdaPos.java:28:22: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
-BadLambdaPos.java:29:28: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
+BadLambdaPos.java:28:22: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
+BadLambdaPos.java:29:28: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
 8 errors
--- a/langtools/test/tools/javac/lambda/BadTargetType.out	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/test/tools/javac/lambda/BadTargetType.out	Wed Jan 16 16:30:11 2013 +0000
@@ -1,5 +1,5 @@
-BadTargetType.java:16:24: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
-BadTargetType.java:17:17: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
-BadTargetType.java:20:9: compiler.err.cant.apply.symbol: kindname.method, m1, java.lang.Object, @460, kindname.class, BadTargetType, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.not.a.functional.intf))
-BadTargetType.java:21:9: compiler.err.cant.apply.symbol: kindname.method, m2, java.lang.Object, @489, kindname.class, BadTargetType, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.not.a.functional.intf))
+BadTargetType.java:16:24: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
+BadTargetType.java:17:17: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
+BadTargetType.java:20:9: compiler.err.cant.apply.symbol: kindname.method, m1, java.lang.Object, @460, kindname.class, BadTargetType, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.not.a.functional.intf: java.lang.Object))
+BadTargetType.java:21:9: compiler.err.cant.apply.symbol: kindname.method, m2, java.lang.Object, @489, kindname.class, BadTargetType, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.not.a.functional.intf: java.lang.Object))
 4 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/FunctionalInterfaceAnno.java	Wed Jan 16 16:30:11 2013 +0000
@@ -0,0 +1,33 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary smoke test for functional interface annotation
+ * @compile/fail/ref=FunctionalInterfaceAnno.out -XDrawDiagnostics FunctionalInterfaceAnno.java
+ */
+class FunctionalInterfaceAnno {
+    @FunctionalInterface
+    static class A { } //not an interface
+
+    @FunctionalInterface
+    static abstract class B { } //not an interface
+
+    @FunctionalInterface
+    enum C { } //not an interface
+
+    @FunctionalInterface
+    @interface D { } //not an interface
+
+    @FunctionalInterface
+    interface E { } //no abstracts
+
+    @FunctionalInterface
+    interface F { default void m() { } } //no abstracts
+
+    @FunctionalInterface
+    interface G { String toString(); } //no abstracts
+
+    @FunctionalInterface
+    interface H { void m(); void n(); } //incompatible abstracts
+
+    @FunctionalInterface
+    interface I { void m(); } //ok
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/FunctionalInterfaceAnno.out	Wed Jan 16 16:30:11 2013 +0000
@@ -0,0 +1,9 @@
+FunctionalInterfaceAnno.java:7:5: compiler.err.bad.functional.intf.anno.1: (compiler.misc.not.a.functional.intf: FunctionalInterfaceAnno.A)
+FunctionalInterfaceAnno.java:10:5: compiler.err.bad.functional.intf.anno.1: (compiler.misc.not.a.functional.intf: FunctionalInterfaceAnno.B)
+FunctionalInterfaceAnno.java:13:5: compiler.err.bad.functional.intf.anno.1: (compiler.misc.not.a.functional.intf: FunctionalInterfaceAnno.C)
+FunctionalInterfaceAnno.java:16:5: compiler.err.bad.functional.intf.anno.1: (compiler.misc.not.a.functional.intf: FunctionalInterfaceAnno.D)
+FunctionalInterfaceAnno.java:19:5: compiler.err.bad.functional.intf.anno.1: (compiler.misc.not.a.functional.intf.1: FunctionalInterfaceAnno.E, (compiler.misc.no.abstracts: kindname.interface, FunctionalInterfaceAnno.E))
+FunctionalInterfaceAnno.java:22:5: compiler.err.bad.functional.intf.anno.1: (compiler.misc.not.a.functional.intf.1: FunctionalInterfaceAnno.F, (compiler.misc.no.abstracts: kindname.interface, FunctionalInterfaceAnno.F))
+FunctionalInterfaceAnno.java:25:5: compiler.err.bad.functional.intf.anno.1: (compiler.misc.not.a.functional.intf.1: FunctionalInterfaceAnno.G, (compiler.misc.no.abstracts: kindname.interface, FunctionalInterfaceAnno.G))
+FunctionalInterfaceAnno.java:28:5: compiler.err.bad.functional.intf.anno.1: (compiler.misc.not.a.functional.intf.1: FunctionalInterfaceAnno.H, (compiler.misc.incompatible.abstracts: kindname.interface, FunctionalInterfaceAnno.H))
+8 errors
--- a/langtools/test/tools/javac/lambda/Intersection01.out	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/test/tools/javac/lambda/Intersection01.out	Wed Jan 16 16:30:11 2013 +0000
@@ -1,3 +1,3 @@
-Intersection01.java:36:45: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.no.abstracts: kindname.interface, java.io.Serializable))
-Intersection01.java:38:45: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.no.abstracts: kindname.interface, java.io.Serializable))
+Intersection01.java:36:45: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: java.io.Serializable, (compiler.misc.no.abstracts: kindname.interface, java.io.Serializable))
+Intersection01.java:38:45: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: java.io.Serializable, (compiler.misc.no.abstracts: kindname.interface, java.io.Serializable))
 2 errors
--- a/langtools/test/tools/javac/lambda/LambdaConv09.out	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/test/tools/javac/lambda/LambdaConv09.out	Wed Jan 16 16:30:11 2013 +0000
@@ -1,5 +1,5 @@
-LambdaConv09.java:42:19: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.no.abstracts: kindname.interface, LambdaConv09.Foo1))
-LambdaConv09.java:43:19: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.no.abstracts: kindname.interface, LambdaConv09.Foo2))
-LambdaConv09.java:44:19: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.no.abstracts: kindname.interface, LambdaConv09.Foo3))
-LambdaConv09.java:46:19: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.no.abstracts: kindname.interface, LambdaConv09.Foo5))
+LambdaConv09.java:42:19: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: LambdaConv09.Foo1, (compiler.misc.no.abstracts: kindname.interface, LambdaConv09.Foo1))
+LambdaConv09.java:43:19: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: LambdaConv09.Foo2, (compiler.misc.no.abstracts: kindname.interface, LambdaConv09.Foo2))
+LambdaConv09.java:44:19: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: LambdaConv09.Foo3, (compiler.misc.no.abstracts: kindname.interface, LambdaConv09.Foo3))
+LambdaConv09.java:46:19: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: LambdaConv09.Foo5, (compiler.misc.no.abstracts: kindname.interface, LambdaConv09.Foo5))
 4 errors
--- a/langtools/test/tools/javac/lambda/LambdaExpr10.out	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/test/tools/javac/lambda/LambdaExpr10.out	Wed Jan 16 16:30:11 2013 +0000
@@ -1,9 +1,9 @@
-LambdaExpr10.java:18:28: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
-LambdaExpr10.java:19:32: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
-LambdaExpr10.java:23:40: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
-LambdaExpr10.java:24:46: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
-LambdaExpr10.java:28:29: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
-LambdaExpr10.java:29:33: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
+LambdaExpr10.java:18:28: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
+LambdaExpr10.java:19:32: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
+LambdaExpr10.java:23:40: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
+LambdaExpr10.java:24:46: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
+LambdaExpr10.java:28:29: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
+LambdaExpr10.java:29:33: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
 LambdaExpr10.java:33:35: compiler.err.prob.found.req: (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.inconvertible.types: java.lang.Object, void))
 LambdaExpr10.java:34:49: compiler.err.prob.found.req: (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.inconvertible.types: java.lang.Object, void))
 8 errors
--- a/langtools/test/tools/javac/lambda/MethodReference04.out	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/test/tools/javac/lambda/MethodReference04.out	Wed Jan 16 16:30:11 2013 +0000
@@ -1,2 +1,2 @@
-MethodReference04.java:13:16: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
+MethodReference04.java:13:16: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
 1 error
--- a/langtools/test/tools/javac/lambda/TargetType17.out	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/test/tools/javac/lambda/TargetType17.out	Wed Jan 16 16:30:11 2013 +0000
@@ -1,9 +1,9 @@
-TargetType17.java:14:21: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
-TargetType17.java:15:23: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
-TargetType17.java:16:19: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
-TargetType17.java:17:21: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
-TargetType17.java:18:23: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
-TargetType17.java:19:25: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
-TargetType17.java:20:21: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
-TargetType17.java:21:27: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
+TargetType17.java:14:21: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: byte)
+TargetType17.java:15:23: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: short)
+TargetType17.java:16:19: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: int)
+TargetType17.java:17:21: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: long)
+TargetType17.java:18:23: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: float)
+TargetType17.java:19:25: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: double)
+TargetType17.java:20:21: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: char)
+TargetType17.java:21:27: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: boolean)
 8 errors
--- a/langtools/test/tools/javac/lambda/TargetType43.out	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/test/tools/javac/lambda/TargetType43.out	Wed Jan 16 16:30:11 2013 +0000
@@ -1,5 +1,5 @@
-TargetType43.java:13:20: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
+TargetType43.java:13:20: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
 TargetType43.java:13:30: compiler.err.cant.resolve.location: kindname.class, NonExistentClass, , , (compiler.misc.location: kindname.class, TargetType43, null)
-TargetType43.java:14:9: compiler.err.cant.apply.symbol: kindname.method, m, java.lang.Object, @359, kindname.class, TargetType43, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.not.a.functional.intf))
+TargetType43.java:14:9: compiler.err.cant.apply.symbol: kindname.method, m, java.lang.Object, @359, kindname.class, TargetType43, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.not.a.functional.intf: java.lang.Object))
 TargetType43.java:14:21: compiler.err.cant.resolve.location: kindname.class, NonExistentClass, , , (compiler.misc.location: kindname.class, TargetType43, null)
 4 errors
--- a/langtools/test/tools/javac/lambda/funcInterfaces/LambdaTest2_neg1.out	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/test/tools/javac/lambda/funcInterfaces/LambdaTest2_neg1.out	Wed Jan 16 16:30:11 2013 +0000
@@ -1,2 +1,2 @@
-LambdaTest2_neg1.java:15:13: compiler.err.cant.apply.symbol: kindname.method, methodQooRoo, QooRoo<java.lang.Integer,java.lang.Integer,java.lang.Void>, @531, kindname.class, LambdaTest2_neg1, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, QooRoo)))
+LambdaTest2_neg1.java:15:13: compiler.err.cant.apply.symbol: kindname.method, methodQooRoo, QooRoo<java.lang.Integer,java.lang.Integer,java.lang.Void>, @531, kindname.class, LambdaTest2_neg1, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.not.a.functional.intf.1: QooRoo, (compiler.misc.incompatible.abstracts: kindname.interface, QooRoo)))
 1 error
--- a/langtools/test/tools/javac/lambda/funcInterfaces/NonSAM1.out	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/test/tools/javac/lambda/funcInterfaces/NonSAM1.out	Wed Jan 16 16:30:11 2013 +0000
@@ -1,2 +1,2 @@
-NonSAM1.java:11:20: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.no.abstracts: kindname.interface, Planet))
+NonSAM1.java:11:20: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: Planet, (compiler.misc.no.abstracts: kindname.interface, Planet))
 1 error
--- a/langtools/test/tools/javac/lambda/funcInterfaces/NonSAM3.out	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/test/tools/javac/lambda/funcInterfaces/NonSAM3.out	Wed Jan 16 16:30:11 2013 +0000
@@ -1,9 +1,9 @@
-NonSAM3.java:15:21: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, FooBar))
-NonSAM3.java:16:22: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, FooBar))
-NonSAM3.java:17:17: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, DE))
-NonSAM3.java:18:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, DE))
-NonSAM3.java:19:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, DE))
-NonSAM3.java:20:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, DE))
-NonSAM3.java:21:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, DE))
-NonSAM3.java:22:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, DE))
+NonSAM3.java:15:21: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: FooBar, (compiler.misc.incompatible.abstracts: kindname.interface, FooBar))
+NonSAM3.java:16:22: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: FooBar, (compiler.misc.incompatible.abstracts: kindname.interface, FooBar))
+NonSAM3.java:17:17: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: DE, (compiler.misc.incompatible.abstracts: kindname.interface, DE))
+NonSAM3.java:18:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: DE, (compiler.misc.incompatible.abstracts: kindname.interface, DE))
+NonSAM3.java:19:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: DE, (compiler.misc.incompatible.abstracts: kindname.interface, DE))
+NonSAM3.java:20:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: DE, (compiler.misc.incompatible.abstracts: kindname.interface, DE))
+NonSAM3.java:21:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: DE, (compiler.misc.incompatible.abstracts: kindname.interface, DE))
+NonSAM3.java:22:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: DE, (compiler.misc.incompatible.abstracts: kindname.interface, DE))
 8 errors
--- a/langtools/test/tools/javac/lambda/lambdaExpression/AbstractClass_neg.out	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/test/tools/javac/lambda/lambdaExpression/AbstractClass_neg.out	Wed Jan 16 16:30:11 2013 +0000
@@ -1,2 +1,2 @@
-AbstractClass_neg.java:16:17: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
+AbstractClass_neg.java:16:17: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: AbstractClass_neg.SAM)
 1 error
--- a/langtools/test/tools/javac/lambda/lambdaExpression/InvalidExpression5.out	Wed Jan 16 16:27:01 2013 +0000
+++ b/langtools/test/tools/javac/lambda/lambdaExpression/InvalidExpression5.out	Wed Jan 16 16:30:11 2013 +0000
@@ -1,2 +1,2 @@
-InvalidExpression5.java:12:20: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
+InvalidExpression5.java:12:20: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
 1 error