diff --git a/src/share/classes/com/sun/tools/javac/code/Symtab.java b/src/share/classes/com/sun/tools/javac/code/Symtab.java index 17535be20539308954b6beb4bfd41798dbb62f94..2ec60dbf4328b266ea6e956703eb747334fdec2e 100644 --- a/src/share/classes/com/sun/tools/javac/code/Symtab.java +++ b/src/share/classes/com/sun/tools/javac/code/Symtab.java @@ -164,6 +164,7 @@ public class Symtab { 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 @@ public class Symtab { 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); diff --git a/src/share/classes/com/sun/tools/javac/code/Types.java b/src/share/classes/com/sun/tools/javac/code/Types.java index a7378f8acfe926ee2c19fc21c8ac6b840ff61f4b..2a3946716d4615c6a2efe0e58d7e350d80d9683a 100644 --- a/src/share/classes/com/sun/tools/javac/code/Types.java +++ b/src/share/classes/com/sun/tools/javac/code/Types.java @@ -392,9 +392,9 @@ public class Types { * 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 abstracts = ListBuffer.lb(); @@ -406,13 +406,13 @@ public class Types { 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()); diff --git a/src/share/classes/com/sun/tools/javac/comp/Check.java b/src/share/classes/com/sun/tools/javac/comp/Check.java index 16bf5e43cfa3130ca83e31f0ecec2865d911eab0..0ad9c099199017fe2e33768614d5db8e0225006c 100644 --- a/src/share/classes/com/sun/tools/javac/comp/Check.java +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java @@ -2601,6 +2601,18 @@ public class Check { 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()); + } + } + } } /** diff --git a/src/share/classes/com/sun/tools/javac/resources/compiler.properties b/src/share/classes/com/sun/tools/javac/resources/compiler.properties index 41c89491c638bd076daf2dad488ca99492ce2e1f..f04abc7c42acfb70a046811ce39f4287e7c2d954 100644 --- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties +++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties @@ -178,14 +178,23 @@ compiler.misc.no.abstracts=\ 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.misc.not.a.functional.intf.1=\ - the target type must be a functional interface\n\ +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=\ + {0} is not a functional interface\n\ + {1} + # 0: symbol, 1: symbol kind, 2: symbol compiler.misc.invalid.generic.lambda.target=\ invalid functional descriptor for lambda expression\n\ diff --git a/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java b/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java index 46867d5fa7527451032dd6e8e4bd3efea9e7a320..7c5849d275875ea70114b774e7531f7077665cbc 100644 --- a/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java +++ b/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java @@ -288,7 +288,7 @@ public class RichDiagnosticFormatter extends public String simplify(Symbol s) { String name = s.getQualifiedName().toString(); - if (!s.type.isCompound()) { + if (!s.type.isCompound() && !s.type.isPrimitive()) { List conflicts = nameClashes.get(s.getSimpleName()); if (conflicts == null || (conflicts.size() == 1 && diff --git a/test/tools/javac/diags/examples.not-yet.txt b/test/tools/javac/diags/examples.not-yet.txt index ef2b5c84e5af9844d053cb7661486c971684b14f..1cc337e69fa6e86e0e904bc0006dabe6dab67e7c 100644 --- a/test/tools/javac/diags/examples.not-yet.txt +++ b/test/tools/javac/diags/examples.not-yet.txt @@ -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 diff --git a/test/tools/javac/diags/examples/BadFunctionalIntfAnno.java b/test/tools/javac/diags/examples/BadFunctionalIntfAnno.java new file mode 100644 index 0000000000000000000000000000000000000000..87090505bd262cfe2236df7254ab3d950417ec70 --- /dev/null +++ b/test/tools/javac/diags/examples/BadFunctionalIntfAnno.java @@ -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 { } diff --git a/test/tools/javac/lambda/BadConv03.out b/test/tools/javac/lambda/BadConv03.out index 078f304f41377f0584f7be77eed864059d2dd905..210148069a8fdd5fcdc1853bf21d8ad9d0c64dd4 100644 --- a/test/tools/javac/lambda/BadConv03.out +++ b/test/tools/javac/lambda/BadConv03.out @@ -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 diff --git a/test/tools/javac/lambda/BadLambdaPos.out b/test/tools/javac/lambda/BadLambdaPos.out index b2436d9ca1af1bd92188186b25d904e07c567115..d192495c9c68a7ff80059238ace9370f8a2be48c 100644 --- a/test/tools/javac/lambda/BadLambdaPos.out +++ b/test/tools/javac/lambda/BadLambdaPos.out @@ -4,6 +4,6 @@ BadLambdaPos.java:19:14: compiler.err.unexpected.lambda 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 diff --git a/test/tools/javac/lambda/BadTargetType.out b/test/tools/javac/lambda/BadTargetType.out index 8979631251ba35b93656dfc256db9063f2a09492..122b4c833e4391eee4147e5c06b79dd78a24c95b 100644 --- a/test/tools/javac/lambda/BadTargetType.out +++ b/test/tools/javac/lambda/BadTargetType.out @@ -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 diff --git a/test/tools/javac/lambda/FunctionalInterfaceAnno.java b/test/tools/javac/lambda/FunctionalInterfaceAnno.java new file mode 100644 index 0000000000000000000000000000000000000000..49248a0e378fc8d67927f7d256c62d6b9494ada6 --- /dev/null +++ b/test/tools/javac/lambda/FunctionalInterfaceAnno.java @@ -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 +} diff --git a/test/tools/javac/lambda/FunctionalInterfaceAnno.out b/test/tools/javac/lambda/FunctionalInterfaceAnno.out new file mode 100644 index 0000000000000000000000000000000000000000..d6b8c398bc61eecc42c759569de6dea2aa231f15 --- /dev/null +++ b/test/tools/javac/lambda/FunctionalInterfaceAnno.out @@ -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 diff --git a/test/tools/javac/lambda/Intersection01.out b/test/tools/javac/lambda/Intersection01.out index 122935b09135497543de5733a047cbf56be5b91b..75debb49693321441641c4d29f7a8138ebca636e 100644 --- a/test/tools/javac/lambda/Intersection01.out +++ b/test/tools/javac/lambda/Intersection01.out @@ -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 diff --git a/test/tools/javac/lambda/LambdaConv09.out b/test/tools/javac/lambda/LambdaConv09.out index 1f99986794ce39af578e01476e8d16ea91b9d865..5265879d8812ed4e2fedd2bbfb3b26b3a86a4353 100644 --- a/test/tools/javac/lambda/LambdaConv09.out +++ b/test/tools/javac/lambda/LambdaConv09.out @@ -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 diff --git a/test/tools/javac/lambda/LambdaExpr10.out b/test/tools/javac/lambda/LambdaExpr10.out index adcba0ad43ef35c40b911da60725f44d5d13cbef..9270b1446713092c14f20b3bea080c7f74435c5c 100644 --- a/test/tools/javac/lambda/LambdaExpr10.out +++ b/test/tools/javac/lambda/LambdaExpr10.out @@ -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 diff --git a/test/tools/javac/lambda/MethodReference04.out b/test/tools/javac/lambda/MethodReference04.out index 789804b78d5cf07dba5ec2bc9829749b4feb809d..46c933a12c23073ff17dd246f2c3c4a9ca04fa5c 100644 --- a/test/tools/javac/lambda/MethodReference04.out +++ b/test/tools/javac/lambda/MethodReference04.out @@ -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 diff --git a/test/tools/javac/lambda/TargetType17.out b/test/tools/javac/lambda/TargetType17.out index 0bb985f699bc1f24c8b624509d88b1e770d29813..2bdf33ce2669907b1ef0594d120fb764590c30bd 100644 --- a/test/tools/javac/lambda/TargetType17.out +++ b/test/tools/javac/lambda/TargetType17.out @@ -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 diff --git a/test/tools/javac/lambda/TargetType43.out b/test/tools/javac/lambda/TargetType43.out index b7b8766c51681a5d260c1409a008f77066dae06a..7d50949d9a05f7c7e3867d91066c861cf5a289c2 100644 --- a/test/tools/javac/lambda/TargetType43.out +++ b/test/tools/javac/lambda/TargetType43.out @@ -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 diff --git a/test/tools/javac/lambda/funcInterfaces/LambdaTest2_neg1.out b/test/tools/javac/lambda/funcInterfaces/LambdaTest2_neg1.out index 4780e80fec604d643acc87950eadd8b008c7bd48..0a96b7ded8d31e4dcbe728bfae0866be796cffcf 100644 --- a/test/tools/javac/lambda/funcInterfaces/LambdaTest2_neg1.out +++ b/test/tools/javac/lambda/funcInterfaces/LambdaTest2_neg1.out @@ -1,2 +1,2 @@ -LambdaTest2_neg1.java:15:13: compiler.err.cant.apply.symbol: kindname.method, methodQooRoo, QooRoo, @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, @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 diff --git a/test/tools/javac/lambda/funcInterfaces/NonSAM1.out b/test/tools/javac/lambda/funcInterfaces/NonSAM1.out index c2472263c0a79a4cbe242e107bd6cdc7bf417868..abfaf967caa0fe2f859c1403efe6ec115b0ac1ed 100644 --- a/test/tools/javac/lambda/funcInterfaces/NonSAM1.out +++ b/test/tools/javac/lambda/funcInterfaces/NonSAM1.out @@ -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 diff --git a/test/tools/javac/lambda/funcInterfaces/NonSAM3.out b/test/tools/javac/lambda/funcInterfaces/NonSAM3.out index 8c9ff08b5ae7f48f7ed3fa675487232d0db62589..9f52ba5f767ec23703c794cbcbd4bc975316736f 100644 --- a/test/tools/javac/lambda/funcInterfaces/NonSAM3.out +++ b/test/tools/javac/lambda/funcInterfaces/NonSAM3.out @@ -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 diff --git a/test/tools/javac/lambda/lambdaExpression/AbstractClass_neg.out b/test/tools/javac/lambda/lambdaExpression/AbstractClass_neg.out index 2fc5555b1e6573239b514748b963b0e35a720d3b..cfe6838393799a5f152d7f15b82f3605f44ee412 100644 --- a/test/tools/javac/lambda/lambdaExpression/AbstractClass_neg.out +++ b/test/tools/javac/lambda/lambdaExpression/AbstractClass_neg.out @@ -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 diff --git a/test/tools/javac/lambda/lambdaExpression/InvalidExpression5.out b/test/tools/javac/lambda/lambdaExpression/InvalidExpression5.out index 251425e667588bf0e7ba61ebce8d29141d9f25a3..f9c70cddcb887aaa3a8697f84318efeb83022bd6 100644 --- a/test/tools/javac/lambda/lambdaExpression/InvalidExpression5.out +++ b/test/tools/javac/lambda/lambdaExpression/InvalidExpression5.out @@ -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