6949040: java.dyn package must be compiled with -target 7 or better
authormcimadamore
Fri, 14 Jan 2011 09:46:44 +0000
changeset 8038 4a2973290d71
parent 8037 b3f278fe95d6
child 8039 c18afa526531
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
langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java
langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties
langtools/test/tools/javac/diags/examples.not-yet.txt
--- 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