6949040: java.dyn package must be compiled with -target 7 or better
Summary: issue error (rather than warning) when @PolymorphicSignature is found and target < 7
Reviewed-by: jjg
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Fri Jan 14 09:45:52 2011 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Fri Jan 14 09:46:44 2011 +0000
@@ -781,8 +781,8 @@
types.isSameType(c.type, syms.polymorphicSignatureType)) {
if (!target.hasMethodHandles()) {
// Somebody is compiling JDK7 source code to a JDK6 target.
- // Make it a strict warning, since it is unlikely but important.
- log.strictWarning(env.tree.pos(),
+ // Make it an error, since it is unlikely but important.
+ log.error(env.tree.pos(),
"wrong.target.for.polymorphic.signature.definition",
target.name);
}
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties Fri Jan 14 09:45:52 2011 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties Fri Jan 14 09:46:44 2011 +0000
@@ -128,7 +128,7 @@
compiler.err.no.superclass=\
{0} has no superclass
-compiler.warn.wrong.target.for.polymorphic.signature.definition=\
+compiler.err.wrong.target.for.polymorphic.signature.definition=\
MethodHandle API building requires -target 7 runtimes or better; current is -target {0}
compiler.err.concrete.inheritance.conflict=\
--- a/langtools/test/tools/javac/diags/examples.not-yet.txt Fri Jan 14 09:45:52 2011 +0000
+++ b/langtools/test/tools/javac/diags/examples.not-yet.txt Fri Jan 14 09:46:44 2011 +0000
@@ -43,6 +43,7 @@
compiler.err.unexpected.type
compiler.err.unknown.enum.constant # in bad class file
compiler.err.unsupported.cross.fp.lit # Scanner: host system dependent
+compiler.err.wrong.target.for.polymorphic.signature.definition # Transitional 292
compiler.misc.assignment.from.super-bound
compiler.misc.assignment.to.extends-bound
compiler.misc.bad.class.file.header # bad class file
@@ -112,4 +113,3 @@
compiler.warn.unchecked.assign # DEAD, replaced by compiler.misc.unchecked.assign
compiler.warn.unchecked.cast.to.type # DEAD, replaced by compiler.misc.unchecked.cast.to.type
compiler.warn.unexpected.archive.file # Paths: zip file with unknown extn
-compiler.warn.wrong.target.for.polymorphic.signature.definition # Transitional 292