提交 7c86c5ec 编写于 作者: M mcimadamore

8005299: Add FunctionalInterface checking to javac

Summary: Javac should check that types annotated with @FunctionalInterface are indeed functional interfaces
Reviewed-by: jjg
上级 d561b0cc
...@@ -164,6 +164,7 @@ public class Symtab { ...@@ -164,6 +164,7 @@ public class Symtab {
public final Type repeatableType; public final Type repeatableType;
public final Type documentedType; public final Type documentedType;
public final Type elementTypeType; public final Type elementTypeType;
public final Type functionalInterfaceType;
/** The symbol representing the length field of an array. /** The symbol representing the length field of an array.
*/ */
...@@ -507,6 +508,7 @@ public class Symtab { ...@@ -507,6 +508,7 @@ public class Symtab {
nativeHeaderType = enterClass("java.lang.annotation.Native"); nativeHeaderType = enterClass("java.lang.annotation.Native");
nativeHeaderType_old = enterClass("javax.tools.annotation.GenerateNativeHeader"); nativeHeaderType_old = enterClass("javax.tools.annotation.GenerateNativeHeader");
lambdaMetafactory = enterClass("java.lang.invoke.LambdaMetafactory"); lambdaMetafactory = enterClass("java.lang.invoke.LambdaMetafactory");
functionalInterfaceType = enterClass("java.lang.FunctionalInterface");
synthesizeEmptyInterfaceIfMissing(autoCloseableType); synthesizeEmptyInterfaceIfMissing(autoCloseableType);
synthesizeEmptyInterfaceIfMissing(cloneableType); synthesizeEmptyInterfaceIfMissing(cloneableType);
......
...@@ -392,9 +392,9 @@ public class Types { ...@@ -392,9 +392,9 @@ public class Types {
* Compute the function descriptor associated with a given functional interface * Compute the function descriptor associated with a given functional interface
*/ */
public FunctionDescriptor findDescriptorInternal(TypeSymbol origin, CompoundScope membersCache) throws FunctionDescriptorLookupError { public FunctionDescriptor findDescriptorInternal(TypeSymbol origin, CompoundScope membersCache) throws FunctionDescriptorLookupError {
if (!origin.isInterface()) { if (!origin.isInterface() || (origin.flags() & ANNOTATION) != 0) {
//t must be an interface //t must be an interface
throw failure("not.a.functional.intf"); throw failure("not.a.functional.intf", origin);
} }
final ListBuffer<Symbol> abstracts = ListBuffer.lb(); final ListBuffer<Symbol> abstracts = ListBuffer.lb();
...@@ -406,13 +406,13 @@ public class Types { ...@@ -406,13 +406,13 @@ public class Types {
abstracts.append(sym); abstracts.append(sym);
} else { } else {
//the target method(s) should be the only abstract members of t //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)); diags.fragment("incompatible.abstracts", Kinds.kindName(origin), origin));
} }
} }
if (abstracts.isEmpty()) { if (abstracts.isEmpty()) {
//t must define a suitable non-generic method //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)); diags.fragment("no.abstracts", Kinds.kindName(origin), origin));
} else if (abstracts.size() == 1) { } else if (abstracts.size() == 1) {
return new FunctionDescriptor(abstracts.first()); return new FunctionDescriptor(abstracts.first());
......
...@@ -2601,6 +2601,18 @@ public class Check { ...@@ -2601,6 +2601,18 @@ public class Check {
if (!isOverrider(s)) if (!isOverrider(s))
log.error(a.pos(), "method.does.not.override.superclass"); 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());
}
}
}
} }
/** /**
......
...@@ -178,14 +178,23 @@ compiler.misc.no.abstracts=\ ...@@ -178,14 +178,23 @@ compiler.misc.no.abstracts=\
compiler.misc.incompatible.abstracts=\ compiler.misc.incompatible.abstracts=\
multiple non-overriding abstract methods found in {0} {1} multiple non-overriding abstract methods found in {0} {1}
compiler.misc.not.a.functional.intf=\ compiler.err.bad.functional.intf.anno=\
the target type must be a functional interface Unexpected @FunctionalInterface annotation
# 0: message segment # 0: message segment
compiler.misc.not.a.functional.intf.1=\ compiler.err.bad.functional.intf.anno.1=\
the target type must be a functional interface\n\ Unexpected @FunctionalInterface annotation\n\
{0} {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 # 0: symbol, 1: symbol kind, 2: symbol
compiler.misc.invalid.generic.lambda.target=\ compiler.misc.invalid.generic.lambda.target=\
invalid functional descriptor for lambda expression\n\ invalid functional descriptor for lambda expression\n\
......
...@@ -288,7 +288,7 @@ public class RichDiagnosticFormatter extends ...@@ -288,7 +288,7 @@ public class RichDiagnosticFormatter extends
public String simplify(Symbol s) { public String simplify(Symbol s) {
String name = s.getQualifiedName().toString(); String name = s.getQualifiedName().toString();
if (!s.type.isCompound()) { if (!s.type.isCompound() && !s.type.isPrimitive()) {
List<Symbol> conflicts = nameClashes.get(s.getSimpleName()); List<Symbol> conflicts = nameClashes.get(s.getSimpleName());
if (conflicts == null || if (conflicts == null ||
(conflicts.size() == 1 && (conflicts.size() == 1 &&
......
compiler.err.already.annotated # internal compiler error? compiler.err.already.annotated # internal compiler error?
compiler.err.already.defined.this.unit # seems to be masked by compiler.err.duplicate.class 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.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.read.file # (apt.JavaCompiler?)
compiler.err.cant.select.static.class.from.param.type compiler.err.cant.select.static.class.from.param.type
compiler.err.dc.unterminated.string # cannot happen compiler.err.dc.unterminated.string # cannot happen
......
/*
* 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 { }
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 1 error
...@@ -4,6 +4,6 @@ BadLambdaPos.java:19:14: compiler.err.unexpected.lambda ...@@ -4,6 +4,6 @@ BadLambdaPos.java:19:14: compiler.err.unexpected.lambda
BadLambdaPos.java:23:18: compiler.err.unexpected.lambda BadLambdaPos.java:23:18: compiler.err.unexpected.lambda
BadLambdaPos.java:23:34: compiler.err.unexpected.lambda BadLambdaPos.java:23:34: compiler.err.unexpected.lambda
BadLambdaPos.java:24:21: 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: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) BadLambdaPos.java:29:28: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: java.lang.Object)
8 errors 8 errors
BadTargetType.java:16:24: compiler.err.prob.found.req: (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) 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)) 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)) 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 4 errors
/*
* @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
}
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
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: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: (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 2 errors
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: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: (compiler.misc.no.abstracts: kindname.interface, LambdaConv09.Foo2)) 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: (compiler.misc.no.abstracts: kindname.interface, LambdaConv09.Foo3)) 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: (compiler.misc.no.abstracts: kindname.interface, LambdaConv09.Foo5)) 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 4 errors
LambdaExpr10.java:18:28: 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) 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) 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) 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) 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) 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: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)) 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 8 errors
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 1 error
TargetType17.java:14:21: 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) 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) 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) 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) 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) 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) 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) TargetType17.java:21:27: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf: boolean)
8 errors 8 errors
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: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) TargetType43.java:14:21: compiler.err.cant.resolve.location: kindname.class, NonExistentClass, , , (compiler.misc.location: kindname.class, TargetType43, null)
4 errors 4 errors
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 1 error
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 1 error
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: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: (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: (compiler.misc.incompatible.abstracts: kindname.interface, DE)) 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: (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: (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: (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: (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: (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 8 errors
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 1 error
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 1 error
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册