8005299: Add FunctionalInterface checking to javac

Wed, 16 Jan 2013 16:30:11 +0000

author
mcimadamore
date
Wed, 16 Jan 2013 16:30:11 +0000
changeset 1497
7aa2025bbb7b
parent 1496
f785dcac17b7
child 1498
1afdf1f1472b

8005299: Add FunctionalInterface checking to javac
Summary: Javac should check that types annotated with @FunctionalInterface are indeed functional interfaces
Reviewed-by: jjg

src/share/classes/com/sun/tools/javac/code/Symtab.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javac/code/Types.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javac/comp/Check.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javac/resources/compiler.properties file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java file | annotate | diff | comparison | revisions
test/tools/javac/diags/examples.not-yet.txt file | annotate | diff | comparison | revisions
test/tools/javac/diags/examples/BadFunctionalIntfAnno.java file | annotate | diff | comparison | revisions
test/tools/javac/lambda/BadConv03.out file | annotate | diff | comparison | revisions
test/tools/javac/lambda/BadLambdaPos.out file | annotate | diff | comparison | revisions
test/tools/javac/lambda/BadTargetType.out file | annotate | diff | comparison | revisions
test/tools/javac/lambda/FunctionalInterfaceAnno.java file | annotate | diff | comparison | revisions
test/tools/javac/lambda/FunctionalInterfaceAnno.out file | annotate | diff | comparison | revisions
test/tools/javac/lambda/Intersection01.out file | annotate | diff | comparison | revisions
test/tools/javac/lambda/LambdaConv09.out file | annotate | diff | comparison | revisions
test/tools/javac/lambda/LambdaExpr10.out file | annotate | diff | comparison | revisions
test/tools/javac/lambda/MethodReference04.out file | annotate | diff | comparison | revisions
test/tools/javac/lambda/TargetType17.out file | annotate | diff | comparison | revisions
test/tools/javac/lambda/TargetType43.out file | annotate | diff | comparison | revisions
test/tools/javac/lambda/funcInterfaces/LambdaTest2_neg1.out file | annotate | diff | comparison | revisions
test/tools/javac/lambda/funcInterfaces/NonSAM1.out file | annotate | diff | comparison | revisions
test/tools/javac/lambda/funcInterfaces/NonSAM3.out file | annotate | diff | comparison | revisions
test/tools/javac/lambda/lambdaExpression/AbstractClass_neg.out file | annotate | diff | comparison | revisions
test/tools/javac/lambda/lambdaExpression/InvalidExpression5.out file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Symtab.java	Wed Jan 16 16:27:01 2013 +0000
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Symtab.java	Wed Jan 16 16:30:11 2013 +0000
     1.3 @@ -164,6 +164,7 @@
     1.4      public final Type repeatableType;
     1.5      public final Type documentedType;
     1.6      public final Type elementTypeType;
     1.7 +    public final Type functionalInterfaceType;
     1.8  
     1.9      /** The symbol representing the length field of an array.
    1.10       */
    1.11 @@ -507,6 +508,7 @@
    1.12          nativeHeaderType = enterClass("java.lang.annotation.Native");
    1.13          nativeHeaderType_old = enterClass("javax.tools.annotation.GenerateNativeHeader");
    1.14          lambdaMetafactory = enterClass("java.lang.invoke.LambdaMetafactory");
    1.15 +        functionalInterfaceType = enterClass("java.lang.FunctionalInterface");
    1.16  
    1.17          synthesizeEmptyInterfaceIfMissing(autoCloseableType);
    1.18          synthesizeEmptyInterfaceIfMissing(cloneableType);
     2.1 --- a/src/share/classes/com/sun/tools/javac/code/Types.java	Wed Jan 16 16:27:01 2013 +0000
     2.2 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Wed Jan 16 16:30:11 2013 +0000
     2.3 @@ -392,9 +392,9 @@
     2.4           * Compute the function descriptor associated with a given functional interface
     2.5           */
     2.6          public FunctionDescriptor findDescriptorInternal(TypeSymbol origin, CompoundScope membersCache) throws FunctionDescriptorLookupError {
     2.7 -            if (!origin.isInterface()) {
     2.8 +            if (!origin.isInterface() || (origin.flags() & ANNOTATION) != 0) {
     2.9                  //t must be an interface
    2.10 -                throw failure("not.a.functional.intf");
    2.11 +                throw failure("not.a.functional.intf", origin);
    2.12              }
    2.13  
    2.14              final ListBuffer<Symbol> abstracts = ListBuffer.lb();
    2.15 @@ -406,13 +406,13 @@
    2.16                      abstracts.append(sym);
    2.17                  } else {
    2.18                      //the target method(s) should be the only abstract members of t
    2.19 -                    throw failure("not.a.functional.intf.1",
    2.20 +                    throw failure("not.a.functional.intf.1",  origin,
    2.21                              diags.fragment("incompatible.abstracts", Kinds.kindName(origin), origin));
    2.22                  }
    2.23              }
    2.24              if (abstracts.isEmpty()) {
    2.25                  //t must define a suitable non-generic method
    2.26 -                throw failure("not.a.functional.intf.1",
    2.27 +                throw failure("not.a.functional.intf.1", origin,
    2.28                              diags.fragment("no.abstracts", Kinds.kindName(origin), origin));
    2.29              } else if (abstracts.size() == 1) {
    2.30                  return new FunctionDescriptor(abstracts.first());
     3.1 --- a/src/share/classes/com/sun/tools/javac/comp/Check.java	Wed Jan 16 16:27:01 2013 +0000
     3.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java	Wed Jan 16 16:30:11 2013 +0000
     3.3 @@ -2601,6 +2601,18 @@
     3.4              if (!isOverrider(s))
     3.5                  log.error(a.pos(), "method.does.not.override.superclass");
     3.6          }
     3.7 +
     3.8 +        if (a.annotationType.type.tsym == syms.functionalInterfaceType.tsym) {
     3.9 +            if (s.kind != TYP) {
    3.10 +                log.error(a.pos(), "bad.functional.intf.anno");
    3.11 +            } else {
    3.12 +                try {
    3.13 +                    types.findDescriptorSymbol((TypeSymbol)s);
    3.14 +                } catch (Types.FunctionDescriptorLookupError ex) {
    3.15 +                    log.error(a.pos(), "bad.functional.intf.anno.1", ex.getDiagnostic());
    3.16 +                }
    3.17 +            }
    3.18 +        }
    3.19      }
    3.20  
    3.21      /**
     4.1 --- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Wed Jan 16 16:27:01 2013 +0000
     4.2 +++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Wed Jan 16 16:30:11 2013 +0000
     4.3 @@ -178,13 +178,22 @@
     4.4  compiler.misc.incompatible.abstracts=\
     4.5      multiple non-overriding abstract methods found in {0} {1}
     4.6  
     4.7 +compiler.err.bad.functional.intf.anno=\
     4.8 +    Unexpected @FunctionalInterface annotation
     4.9 +
    4.10 +# 0: message segment
    4.11 +compiler.err.bad.functional.intf.anno.1=\
    4.12 +    Unexpected @FunctionalInterface annotation\n\
    4.13 +    {0}
    4.14 +
    4.15 +# 0: symbol
    4.16  compiler.misc.not.a.functional.intf=\
    4.17 -    the target type must be a functional interface
    4.18 -
    4.19 -# 0: message segment
    4.20 +    {0} is not a functional interface
    4.21 +
    4.22 +# 0: symbol, 1: message segment
    4.23  compiler.misc.not.a.functional.intf.1=\
    4.24 -    the target type must be a functional interface\n\
    4.25 -    {0}
    4.26 +    {0} is not a functional interface\n\
    4.27 +    {1}
    4.28  
    4.29  # 0: symbol, 1: symbol kind, 2: symbol
    4.30  compiler.misc.invalid.generic.lambda.target=\
     5.1 --- a/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Wed Jan 16 16:27:01 2013 +0000
     5.2 +++ b/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Wed Jan 16 16:30:11 2013 +0000
     5.3 @@ -288,7 +288,7 @@
     5.4  
     5.5          public String simplify(Symbol s) {
     5.6              String name = s.getQualifiedName().toString();
     5.7 -            if (!s.type.isCompound()) {
     5.8 +            if (!s.type.isCompound() && !s.type.isPrimitive()) {
     5.9                  List<Symbol> conflicts = nameClashes.get(s.getSimpleName());
    5.10                  if (conflicts == null ||
    5.11                      (conflicts.size() == 1 &&
     6.1 --- a/test/tools/javac/diags/examples.not-yet.txt	Wed Jan 16 16:27:01 2013 +0000
     6.2 +++ b/test/tools/javac/diags/examples.not-yet.txt	Wed Jan 16 16:30:11 2013 +0000
     6.3 @@ -1,6 +1,7 @@
     6.4  compiler.err.already.annotated                          # internal compiler error?
     6.5  compiler.err.already.defined.this.unit                  # seems to be masked by compiler.err.duplicate.class
     6.6  compiler.err.annotation.value.not.allowable.type        # cannot happen: precluded by complete type-specific tests
     6.7 +compiler.err.bad.functional.intf.anno                   # seems to be masked by compiler.err.annotation.type.not.applicable
     6.8  compiler.err.cant.read.file                             # (apt.JavaCompiler?)
     6.9  compiler.err.cant.select.static.class.from.param.type
    6.10  compiler.err.dc.unterminated.string                     # cannot happen
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/test/tools/javac/diags/examples/BadFunctionalIntfAnno.java	Wed Jan 16 16:30:11 2013 +0000
     7.3 @@ -0,0 +1,28 @@
     7.4 +/*
     7.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
     7.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     7.7 + *
     7.8 + * This code is free software; you can redistribute it and/or modify it
     7.9 + * under the terms of the GNU General Public License version 2 only, as
    7.10 + * published by the Free Software Foundation.
    7.11 + *
    7.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    7.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    7.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    7.15 + * version 2 for more details (a copy is included in the LICENSE file that
    7.16 + * accompanied this code).
    7.17 + *
    7.18 + * You should have received a copy of the GNU General Public License version
    7.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    7.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    7.21 + *
    7.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    7.23 + * or visit www.oracle.com if you need additional information or have any
    7.24 + * questions.
    7.25 + */
    7.26 +
    7.27 +// key: compiler.err.bad.functional.intf.anno.1
    7.28 +// key: compiler.misc.not.a.functional.intf
    7.29 +
    7.30 +@FunctionalInterface
    7.31 +class BadFunctionalIntfAnno { }
     8.1 --- a/test/tools/javac/lambda/BadConv03.out	Wed Jan 16 16:27:01 2013 +0000
     8.2 +++ b/test/tools/javac/lambda/BadConv03.out	Wed Jan 16 16:30:11 2013 +0000
     8.3 @@ -1,2 +1,2 @@
     8.4 -BadConv03.java:19:11: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, BadConv03.B))
     8.5 +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))
     8.6  1 error
     9.1 --- a/test/tools/javac/lambda/BadLambdaPos.out	Wed Jan 16 16:27:01 2013 +0000
     9.2 +++ b/test/tools/javac/lambda/BadLambdaPos.out	Wed Jan 16 16:30:11 2013 +0000
     9.3 @@ -4,6 +4,6 @@
     9.4  BadLambdaPos.java:23:18: compiler.err.unexpected.lambda
     9.5  BadLambdaPos.java:23:34: compiler.err.unexpected.lambda
     9.6  BadLambdaPos.java:24:21: compiler.err.unexpected.lambda
     9.7 -BadLambdaPos.java:28:22: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
     9.8 -BadLambdaPos.java:29:28: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
     9.9 +BadLambdaPos.java:28:22: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
    9.10 +BadLambdaPos.java:29:28: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
    9.11  8 errors
    10.1 --- a/test/tools/javac/lambda/BadTargetType.out	Wed Jan 16 16:27:01 2013 +0000
    10.2 +++ b/test/tools/javac/lambda/BadTargetType.out	Wed Jan 16 16:30:11 2013 +0000
    10.3 @@ -1,5 +1,5 @@
    10.4 -BadTargetType.java:16:24: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
    10.5 -BadTargetType.java:17:17: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
    10.6 -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))
    10.7 -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))
    10.8 +BadTargetType.java:16:24: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
    10.9 +BadTargetType.java:17:17: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
   10.10 +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))
   10.11 +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))
   10.12  4 errors
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/test/tools/javac/lambda/FunctionalInterfaceAnno.java	Wed Jan 16 16:30:11 2013 +0000
    11.3 @@ -0,0 +1,33 @@
    11.4 +/*
    11.5 + * @test /nodynamiccopyright/
    11.6 + * @summary smoke test for functional interface annotation
    11.7 + * @compile/fail/ref=FunctionalInterfaceAnno.out -XDrawDiagnostics FunctionalInterfaceAnno.java
    11.8 + */
    11.9 +class FunctionalInterfaceAnno {
   11.10 +    @FunctionalInterface
   11.11 +    static class A { } //not an interface
   11.12 +
   11.13 +    @FunctionalInterface
   11.14 +    static abstract class B { } //not an interface
   11.15 +
   11.16 +    @FunctionalInterface
   11.17 +    enum C { } //not an interface
   11.18 +
   11.19 +    @FunctionalInterface
   11.20 +    @interface D { } //not an interface
   11.21 +
   11.22 +    @FunctionalInterface
   11.23 +    interface E { } //no abstracts
   11.24 +
   11.25 +    @FunctionalInterface
   11.26 +    interface F { default void m() { } } //no abstracts
   11.27 +
   11.28 +    @FunctionalInterface
   11.29 +    interface G { String toString(); } //no abstracts
   11.30 +
   11.31 +    @FunctionalInterface
   11.32 +    interface H { void m(); void n(); } //incompatible abstracts
   11.33 +
   11.34 +    @FunctionalInterface
   11.35 +    interface I { void m(); } //ok
   11.36 +}
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/test/tools/javac/lambda/FunctionalInterfaceAnno.out	Wed Jan 16 16:30:11 2013 +0000
    12.3 @@ -0,0 +1,9 @@
    12.4 +FunctionalInterfaceAnno.java:7:5: compiler.err.bad.functional.intf.anno.1: (compiler.misc.not.a.functional.intf: FunctionalInterfaceAnno.A)
    12.5 +FunctionalInterfaceAnno.java:10:5: compiler.err.bad.functional.intf.anno.1: (compiler.misc.not.a.functional.intf: FunctionalInterfaceAnno.B)
    12.6 +FunctionalInterfaceAnno.java:13:5: compiler.err.bad.functional.intf.anno.1: (compiler.misc.not.a.functional.intf: FunctionalInterfaceAnno.C)
    12.7 +FunctionalInterfaceAnno.java:16:5: compiler.err.bad.functional.intf.anno.1: (compiler.misc.not.a.functional.intf: FunctionalInterfaceAnno.D)
    12.8 +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))
    12.9 +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))
   12.10 +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))
   12.11 +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))
   12.12 +8 errors
    13.1 --- a/test/tools/javac/lambda/Intersection01.out	Wed Jan 16 16:27:01 2013 +0000
    13.2 +++ b/test/tools/javac/lambda/Intersection01.out	Wed Jan 16 16:30:11 2013 +0000
    13.3 @@ -1,3 +1,3 @@
    13.4 -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))
    13.5 -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))
    13.6 +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))
    13.7 +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))
    13.8  2 errors
    14.1 --- a/test/tools/javac/lambda/LambdaConv09.out	Wed Jan 16 16:27:01 2013 +0000
    14.2 +++ b/test/tools/javac/lambda/LambdaConv09.out	Wed Jan 16 16:30:11 2013 +0000
    14.3 @@ -1,5 +1,5 @@
    14.4 -LambdaConv09.java:42:19: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.no.abstracts: kindname.interface, LambdaConv09.Foo1))
    14.5 -LambdaConv09.java:43:19: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.no.abstracts: kindname.interface, LambdaConv09.Foo2))
    14.6 -LambdaConv09.java:44:19: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.no.abstracts: kindname.interface, LambdaConv09.Foo3))
    14.7 -LambdaConv09.java:46:19: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.no.abstracts: kindname.interface, LambdaConv09.Foo5))
    14.8 +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))
    14.9 +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))
   14.10 +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))
   14.11 +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))
   14.12  4 errors
    15.1 --- a/test/tools/javac/lambda/LambdaExpr10.out	Wed Jan 16 16:27:01 2013 +0000
    15.2 +++ b/test/tools/javac/lambda/LambdaExpr10.out	Wed Jan 16 16:30:11 2013 +0000
    15.3 @@ -1,9 +1,9 @@
    15.4 -LambdaExpr10.java:18:28: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
    15.5 -LambdaExpr10.java:19:32: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
    15.6 -LambdaExpr10.java:23:40: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
    15.7 -LambdaExpr10.java:24:46: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
    15.8 -LambdaExpr10.java:28:29: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
    15.9 -LambdaExpr10.java:29:33: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
   15.10 +LambdaExpr10.java:18:28: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
   15.11 +LambdaExpr10.java:19:32: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
   15.12 +LambdaExpr10.java:23:40: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
   15.13 +LambdaExpr10.java:24:46: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
   15.14 +LambdaExpr10.java:28:29: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
   15.15 +LambdaExpr10.java:29:33: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
   15.16  LambdaExpr10.java:33:35: compiler.err.prob.found.req: (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.inconvertible.types: java.lang.Object, void))
   15.17  LambdaExpr10.java:34:49: compiler.err.prob.found.req: (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.inconvertible.types: java.lang.Object, void))
   15.18  8 errors
    16.1 --- a/test/tools/javac/lambda/MethodReference04.out	Wed Jan 16 16:27:01 2013 +0000
    16.2 +++ b/test/tools/javac/lambda/MethodReference04.out	Wed Jan 16 16:30:11 2013 +0000
    16.3 @@ -1,2 +1,2 @@
    16.4 -MethodReference04.java:13:16: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
    16.5 +MethodReference04.java:13:16: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
    16.6  1 error
    17.1 --- a/test/tools/javac/lambda/TargetType17.out	Wed Jan 16 16:27:01 2013 +0000
    17.2 +++ b/test/tools/javac/lambda/TargetType17.out	Wed Jan 16 16:30:11 2013 +0000
    17.3 @@ -1,9 +1,9 @@
    17.4 -TargetType17.java:14:21: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
    17.5 -TargetType17.java:15:23: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
    17.6 -TargetType17.java:16:19: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
    17.7 -TargetType17.java:17:21: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
    17.8 -TargetType17.java:18:23: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
    17.9 -TargetType17.java:19:25: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
   17.10 -TargetType17.java:20:21: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
   17.11 -TargetType17.java:21:27: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
   17.12 +TargetType17.java:14:21: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: byte)
   17.13 +TargetType17.java:15:23: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: short)
   17.14 +TargetType17.java:16:19: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: int)
   17.15 +TargetType17.java:17:21: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: long)
   17.16 +TargetType17.java:18:23: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: float)
   17.17 +TargetType17.java:19:25: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: double)
   17.18 +TargetType17.java:20:21: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: char)
   17.19 +TargetType17.java:21:27: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: boolean)
   17.20  8 errors
    18.1 --- a/test/tools/javac/lambda/TargetType43.out	Wed Jan 16 16:27:01 2013 +0000
    18.2 +++ b/test/tools/javac/lambda/TargetType43.out	Wed Jan 16 16:30:11 2013 +0000
    18.3 @@ -1,5 +1,5 @@
    18.4 -TargetType43.java:13:20: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
    18.5 +TargetType43.java:13:20: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
    18.6  TargetType43.java:13:30: compiler.err.cant.resolve.location: kindname.class, NonExistentClass, , , (compiler.misc.location: kindname.class, TargetType43, null)
    18.7 -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))
    18.8 +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))
    18.9  TargetType43.java:14:21: compiler.err.cant.resolve.location: kindname.class, NonExistentClass, , , (compiler.misc.location: kindname.class, TargetType43, null)
   18.10  4 errors
    19.1 --- a/test/tools/javac/lambda/funcInterfaces/LambdaTest2_neg1.out	Wed Jan 16 16:27:01 2013 +0000
    19.2 +++ b/test/tools/javac/lambda/funcInterfaces/LambdaTest2_neg1.out	Wed Jan 16 16:30:11 2013 +0000
    19.3 @@ -1,2 +1,2 @@
    19.4 -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)))
    19.5 +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)))
    19.6  1 error
    20.1 --- a/test/tools/javac/lambda/funcInterfaces/NonSAM1.out	Wed Jan 16 16:27:01 2013 +0000
    20.2 +++ b/test/tools/javac/lambda/funcInterfaces/NonSAM1.out	Wed Jan 16 16:30:11 2013 +0000
    20.3 @@ -1,2 +1,2 @@
    20.4 -NonSAM1.java:11:20: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.no.abstracts: kindname.interface, Planet))
    20.5 +NonSAM1.java:11:20: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: Planet, (compiler.misc.no.abstracts: kindname.interface, Planet))
    20.6  1 error
    21.1 --- a/test/tools/javac/lambda/funcInterfaces/NonSAM3.out	Wed Jan 16 16:27:01 2013 +0000
    21.2 +++ b/test/tools/javac/lambda/funcInterfaces/NonSAM3.out	Wed Jan 16 16:30:11 2013 +0000
    21.3 @@ -1,9 +1,9 @@
    21.4 -NonSAM3.java:15:21: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, FooBar))
    21.5 -NonSAM3.java:16:22: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, FooBar))
    21.6 -NonSAM3.java:17:17: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, DE))
    21.7 -NonSAM3.java:18:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, DE))
    21.8 -NonSAM3.java:19:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, DE))
    21.9 -NonSAM3.java:20:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, DE))
   21.10 -NonSAM3.java:21:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, DE))
   21.11 -NonSAM3.java:22:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: (compiler.misc.incompatible.abstracts: kindname.interface, DE))
   21.12 +NonSAM3.java:15:21: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: FooBar, (compiler.misc.incompatible.abstracts: kindname.interface, FooBar))
   21.13 +NonSAM3.java:16:22: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: FooBar, (compiler.misc.incompatible.abstracts: kindname.interface, FooBar))
   21.14 +NonSAM3.java:17:17: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: DE, (compiler.misc.incompatible.abstracts: kindname.interface, DE))
   21.15 +NonSAM3.java:18:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: DE, (compiler.misc.incompatible.abstracts: kindname.interface, DE))
   21.16 +NonSAM3.java:19:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: DE, (compiler.misc.incompatible.abstracts: kindname.interface, DE))
   21.17 +NonSAM3.java:20:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: DE, (compiler.misc.incompatible.abstracts: kindname.interface, DE))
   21.18 +NonSAM3.java:21:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: DE, (compiler.misc.incompatible.abstracts: kindname.interface, DE))
   21.19 +NonSAM3.java:22:18: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: DE, (compiler.misc.incompatible.abstracts: kindname.interface, DE))
   21.20  8 errors
    22.1 --- a/test/tools/javac/lambda/lambdaExpression/AbstractClass_neg.out	Wed Jan 16 16:27:01 2013 +0000
    22.2 +++ b/test/tools/javac/lambda/lambdaExpression/AbstractClass_neg.out	Wed Jan 16 16:30:11 2013 +0000
    22.3 @@ -1,2 +1,2 @@
    22.4 -AbstractClass_neg.java:16:17: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
    22.5 +AbstractClass_neg.java:16:17: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: AbstractClass_neg.SAM)
    22.6  1 error
    23.1 --- a/test/tools/javac/lambda/lambdaExpression/InvalidExpression5.out	Wed Jan 16 16:27:01 2013 +0000
    23.2 +++ b/test/tools/javac/lambda/lambdaExpression/InvalidExpression5.out	Wed Jan 16 16:30:11 2013 +0000
    23.3 @@ -1,2 +1,2 @@
    23.4 -InvalidExpression5.java:12:20: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf)
    23.5 +InvalidExpression5.java:12:20: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
    23.6  1 error

mercurial