changeset 73:1b67f18d903f

meth, indy: coordinate with upcoming changes from tl/langtools
author jrose
date Tue, 07 Sep 2010 17:04:30 -0700
parents 1568fda1153b
children ffe8e725a387
files indy-bsm-6964498.patch meth-cast-6979683.patch meth-edrfix-6979327.patch meth-edrfix-mlvm-only.patch series
diffstat 5 files changed, 835 insertions(+), 877 deletions(-) [+]
line wrap: on
line diff
--- a/indy-bsm-6964498.patch	Thu Aug 26 15:35:54 2010 -0700
+++ b/indy-bsm-6964498.patch	Tue Sep 07 17:04:30 2010 -0700
@@ -302,7 +302,7 @@
 diff --git a/src/share/classes/com/sun/tools/javac/code/Symbol.java b/src/share/classes/com/sun/tools/javac/code/Symbol.java
 --- a/src/share/classes/com/sun/tools/javac/code/Symbol.java
 +++ b/src/share/classes/com/sun/tools/javac/code/Symbol.java
-@@ -1318,6 +1318,43 @@
+@@ -1323,6 +1323,43 @@
          }
      }
  
@@ -361,7 +361,7 @@
      public final Type throwableType;
      public final Type errorType;
      public final Type illegalArgumentExceptionType;
-@@ -408,9 +410,11 @@
+@@ -412,9 +414,11 @@
          cloneableType = enterClass("java.lang.Cloneable");
          throwableType = enterClass("java.lang.Throwable");
          serializableType = enterClass("java.io.Serializable");
@@ -373,7 +373,7 @@
          errorType = enterClass("java.lang.Error");
          illegalArgumentExceptionType = enterClass("java.lang.IllegalArgumentException");
          exceptionType = enterClass("java.lang.Exception");
-@@ -448,6 +452,7 @@
+@@ -458,6 +462,7 @@
          synthesizeEmptyInterfaceIfMissing(cloneableType);
          synthesizeEmptyInterfaceIfMissing(serializableType);
          synthesizeEmptyInterfaceIfMissing(polymorphicSignatureType);
@@ -384,7 +384,7 @@
 diff --git a/src/share/classes/com/sun/tools/javac/comp/Attr.java b/src/share/classes/com/sun/tools/javac/comp/Attr.java
 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java
 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java
-@@ -1380,6 +1380,23 @@
+@@ -1421,6 +1421,23 @@
              }
  
              // Special case logic for JSR 292 types.
@@ -408,7 +408,7 @@
              if (rs.allowTransitionalJSR292 && tree.meth.getTag() == JCTree.SELECT && !typeargtypes.isEmpty()) {
                  JCFieldAccess mfield = (JCFieldAccess) tree.meth;
                  // MethodHandle.<T>invoke(abc) and InvokeDynamic.<T>foo(abc)
-@@ -1430,6 +1447,121 @@
+@@ -1471,6 +1488,121 @@
              return (typeargtypes == null) ? mt : (Type)new ForAll(typeargtypes, mt);
          }
  
@@ -530,7 +530,7 @@
      public void visitNewClass(JCNewClass tree) {
          Type owntype = types.createErrorType(tree.type);
  
-@@ -1975,14 +2107,24 @@
+@@ -2019,14 +2151,24 @@
              if (meth.getTag() == JCTree.SELECT) {
                  JCFieldAccess methsel = (JCFieldAccess)meth;
                  if (rs.isPolymorphicSignatureInstance(methsel.sym)) {
@@ -545,7 +545,7 @@
 +                        sym = (MethodSymbol)methsel.sym;
                      MethodType oldType = sym.type.asMethodType();
                      Symbol newSym = rs.findPolymorphicSignatureInstance(sym.owner.type, sym.name, sym,
-                                                                         targetType,
+                                                                         returnType,
                                                                          oldType.argtypes);
                      if (!rs.isPolymorphicSignatureInstance(newSym))
                          throw new AssertionError("can't split poly sym: "+sym);
@@ -554,7 +554,7 @@
 +                        methsel.sym = indysym.changeCallMethod((MethodSymbol) newSym);
 +                    else
 +                        methsel.sym = (MethodSymbol) newSym;
-                     expr.type = targetType;
+                     expr.type = returnType;
                  }
              }
 diff --git a/src/share/classes/com/sun/tools/javac/jvm/ClassFile.java b/src/share/classes/com/sun/tools/javac/jvm/ClassFile.java
@@ -979,7 +979,7 @@
 diff --git a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java
 --- a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java
 +++ b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java
-@@ -1177,8 +1177,7 @@
+@@ -1186,8 +1186,7 @@
                      return illegal(pos);
                  }
              } else {
@@ -992,7 +992,7 @@
 diff --git a/src/share/classes/com/sun/tools/javac/resources/compiler.properties b/src/share/classes/com/sun/tools/javac/resources/compiler.properties
 --- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties
 +++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties
-@@ -131,6 +131,11 @@
+@@ -133,6 +133,11 @@
  compiler.warn.wrong.target.for.polymorphic.signature.definition=\
      MethodHandle API building requires -target 7 runtimes or better; current is -target {0}
  
@@ -1007,7 +1007,7 @@
 diff --git a/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java b/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java
 --- a/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java
 +++ b/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java
-@@ -744,6 +744,27 @@
+@@ -751,6 +751,27 @@
          return result;
      }
  
@@ -1038,7 +1038,7 @@
 diff --git a/src/share/classes/com/sun/tools/javac/util/Names.java b/src/share/classes/com/sun/tools/javac/util/Names.java
 --- a/src/share/classes/com/sun/tools/javac/util/Names.java
 +++ b/src/share/classes/com/sun/tools/javac/util/Names.java
-@@ -117,6 +117,7 @@
+@@ -116,6 +116,7 @@
      public final Name getMessage;
      public final Name getClass;
      public final Name invoke;  //allowTransitionalJSR292 only
--- a/meth-cast-6979683.patch	Thu Aug 26 15:35:54 2010 -0700
+++ b/meth-cast-6979683.patch	Tue Sep 07 17:04:30 2010 -0700
@@ -1,8 +1,6 @@
 6979683: inconsistent interaction of reference cast with box/unbox conversions leaves out a useful case
 Summary: Allow casts which narrow and then unbox.
-Reviewed-by: ?
-
-Note:  The only significant test source file is TestCast6979683.java.  All the negative tests are trivially transformed copies of TestCast6979683.java.  The transformation was done by the script MakeNegTests.sh.
+Reviewed-by: mcimadamore
 
 diff --git a/src/share/classes/com/sun/tools/javac/code/Types.java b/src/share/classes/com/sun/tools/javac/code/Types.java
 --- a/src/share/classes/com/sun/tools/javac/code/Types.java
@@ -39,114 +37,11 @@
          make_at(tree.pos());
          Symbol valueSym = lookupMethod(tree.pos(),
                                         unboxedType.tsym.name.append(names.Value), // x.intValue()
-diff --git a/test/tools/javac/6979683/MakeNegTests.sh b/test/tools/javac/6979683/MakeNegTests.sh
+diff --git a/test/tools/javac/6979683/TestCast6979683_BAD34.java b/test/tools/javac/6979683/TestCast6979683_BAD34.java
 new file mode 100644
 --- /dev/null
-+++ b/test/tools/javac/6979683/MakeNegTests.sh
-@@ -0,0 +1,98 @@
-+#!/bin/sh
-+
-+#
-+# Copyright (c) 2010, 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.
-+#
-+
-+## summary Verify correct rejection of erroneous casts that narrow and unbox at the same time
-+## run shell MakeNegTests.sh
-+
-+default_template=TestCast6979683.java
-+javacflags=''
-+javac=${1-''}
-+# the rest of this file is a generic "//BAD"-line tester
-+
-+: ${TESTSRC=.} ${TESTCLASSES=.}
-+: ${javac:="${TESTJAVA+${TESTJAVA}/bin/}javac"}
-+
-+verbose=false quiet=false
-+
-+main() {
-+  case "${@-}" in
-+  *.java*)
-+    for template in "$@"; do
-+      expand_and_test "$template"
-+    done;;
-+  *) expand_and_test "${TESTSRC}/$default_template";;
-+  esac
-+}
-+
-+expand_and_test() {
-+  template=$1
-+  expand "$@"
-+  testneg "$@"
-+}
-+
-+expand() {
-+  template=$1
-+  badlines=` grep -n < "$template" '//BAD' `
-+  badcount=` echo "$badlines" | wc -l `
-+  [ $badcount -gt 0 ] || { echo "No negative test cases in $template"; exit 1; }
-+  $quiet || echo "Expanding $badcount negative test cases from $template:"
-+  $quiet || echo "$badlines"
-+  badnums=` echo "$badlines" | sed 's/:.*//' `
-+  casestem=` getcasestem "$template" `
-+  tclassname=` basename "$template" .java `
-+  rm -f "$casestem"*.java
-+  for badnum in $badnums; do
-+    casefile="$casestem"${badnum}.java
-+    cclassname=` basename "$casefile" .java `
-+    sed < "$template" > "$casefile" "
-+      s|@compile|@compile/fail|
-+      s|@run.*||
-+      #/ @[a-z]/s|@|##|
-+      ${badnum}s:^ *[/*]*:    :
-+      s/${tclassname}/${cclassname}/g
-+    "
-+    $verbose && diff -u "$template" "$casefile"
-+  done
-+}
-+
-+getcasestem() {
-+  echo `basename $1` | sed 's/\.java$//;s/_BAD[0-9]*$//;s/$/_BAD/'
-+}
-+
-+testneg() {
-+  template=$1
-+  for casefile in ` getcasestem "$template" `*.java; do
-+    $quiet || echo -------- $javac $javacflags "$casefile"
-+    $javac $javacflags "$casefile" > "$casefile".errlog 2>&1 && {
-+      echo "*** Compilation unexpectedly succeeded:  $casefile"
-+      exit 1
-+    }
-+    $quiet || echo "Compilation failed as expected"
-+    $quiet || head ` $verbose || echo -3 ` < "$casefile".errlog
-+    rm "$casefile".errlog
-+  done
-+}
-+
-+main "$@"
-diff --git a/test/tools/javac/6979683/TestCast6979683.java b/test/tools/javac/6979683/TestCast6979683.java
-new file mode 100644
---- /dev/null
-+++ b/test/tools/javac/6979683/TestCast6979683.java
-@@ -0,0 +1,117 @@
++++ b/test/tools/javac/6979683/TestCast6979683_BAD34.java
+@@ -0,0 +1,40 @@
 +/*
 + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -176,11 +71,323 @@
 + * @summary Verify that casts can narrow and unbox at the same time
 + * @author jrose
 + *
-+ * @compile TestCast6979683.java
-+ * @run main TestCast6979683
++ * @compile/fail/ref=TestCast6979683_BAD34.java.errlog -XDrawDiagnostics TestCast6979683_BAD34.java
 + */
 +
-+public class TestCast6979683 {
++public class TestCast6979683_BAD34 {
++    static boolean zconvBAD1(Number o) { return o; } //BAD
++    //...
++    //...
++    //...
++    //...
++    //...
++}
+diff --git a/test/tools/javac/6979683/TestCast6979683_BAD34.java.errlog b/test/tools/javac/6979683/TestCast6979683_BAD34.java.errlog
+new file mode 100644
+--- /dev/null
++++ b/test/tools/javac/6979683/TestCast6979683_BAD34.java.errlog
+@@ -0,0 +1,2 @@
++TestCast6979683_BAD34.java:34:49: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.Number, boolean
++1 error
+diff --git a/test/tools/javac/6979683/TestCast6979683_BAD35.java b/test/tools/javac/6979683/TestCast6979683_BAD35.java
+new file mode 100644
+--- /dev/null
++++ b/test/tools/javac/6979683/TestCast6979683_BAD35.java
+@@ -0,0 +1,40 @@
++/*
++ * Copyright (c) 2010, 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.
++ */
++
++/*
++ * @test
++ * @bug 6979683
++ * @summary Verify that casts can narrow and unbox at the same time
++ * @author jrose
++ *
++ * @compile/fail/ref=TestCast6979683_BAD35.java.errlog -XDrawDiagnostics TestCast6979683_BAD35.java
++ */
++
++public class TestCast6979683_BAD35 {
++    //...
++    static int iconvBAD1(Number o) { return o; } //BAD: cast needed
++    //...
++    //...
++    //...
++    //...
++}
+diff --git a/test/tools/javac/6979683/TestCast6979683_BAD35.java.errlog b/test/tools/javac/6979683/TestCast6979683_BAD35.java.errlog
+new file mode 100644
+--- /dev/null
++++ b/test/tools/javac/6979683/TestCast6979683_BAD35.java.errlog
+@@ -0,0 +1,2 @@
++TestCast6979683_BAD35.java:35:45: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.Number, int
++1 error
+diff --git a/test/tools/javac/6979683/TestCast6979683_BAD36.java b/test/tools/javac/6979683/TestCast6979683_BAD36.java
+new file mode 100644
+--- /dev/null
++++ b/test/tools/javac/6979683/TestCast6979683_BAD36.java
+@@ -0,0 +1,40 @@
++/*
++ * Copyright (c) 2010, 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.
++ */
++
++/*
++ * @test
++ * @bug 6979683
++ * @summary Verify that casts can narrow and unbox at the same time
++ * @author jrose
++ *
++ * @compile/fail/ref=TestCast6979683_BAD36.java.errlog -XDrawDiagnostics TestCast6979683_BAD36.java
++ */
++
++public class TestCast6979683_BAD36 {
++    //...
++    //...
++    static int iconvBAD2(Comparable<Integer> o) { return o; } //BAD: cast needed
++    //...
++    //...
++    //...
++}
+diff --git a/test/tools/javac/6979683/TestCast6979683_BAD36.java.errlog b/test/tools/javac/6979683/TestCast6979683_BAD36.java.errlog
+new file mode 100644
+--- /dev/null
++++ b/test/tools/javac/6979683/TestCast6979683_BAD36.java.errlog
+@@ -0,0 +1,2 @@
++TestCast6979683_BAD36.java:36:58: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.Comparable<java.lang.Integer>, int
++1 error
+diff --git a/test/tools/javac/6979683/TestCast6979683_BAD37.java b/test/tools/javac/6979683/TestCast6979683_BAD37.java
+new file mode 100644
+--- /dev/null
++++ b/test/tools/javac/6979683/TestCast6979683_BAD37.java
+@@ -0,0 +1,40 @@
++/*
++ * Copyright (c) 2010, 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.
++ */
++
++/*
++ * @test
++ * @bug 6979683
++ * @summary Verify that casts can narrow and unbox at the same time
++ * @author jrose
++ *
++ * @compile/fail/ref=TestCast6979683_BAD37.java.errlog -XDrawDiagnostics TestCast6979683_BAD37.java
++ */
++
++public class TestCast6979683_BAD37 {
++    //...
++    //...
++    //...
++    static int iconvBAD3(Comparable<Short> o) { return (int)o; } //BAD: wrong instance
++    //...
++    //...
++}
+diff --git a/test/tools/javac/6979683/TestCast6979683_BAD37.java.errlog b/test/tools/javac/6979683/TestCast6979683_BAD37.java.errlog
+new file mode 100644
+--- /dev/null
++++ b/test/tools/javac/6979683/TestCast6979683_BAD37.java.errlog
+@@ -0,0 +1,2 @@
++TestCast6979683_BAD37.java:37:61: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), java.lang.Comparable<java.lang.Short>, int
++1 error
+diff --git a/test/tools/javac/6979683/TestCast6979683_BAD38.java b/test/tools/javac/6979683/TestCast6979683_BAD38.java
+new file mode 100644
+--- /dev/null
++++ b/test/tools/javac/6979683/TestCast6979683_BAD38.java
+@@ -0,0 +1,40 @@
++/*
++ * Copyright (c) 2010, 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.
++ */
++
++/*
++ * @test
++ * @bug 6979683
++ * @summary Verify that casts can narrow and unbox at the same time
++ * @author jrose
++ *
++ * @compile/fail/ref=TestCast6979683_BAD38.java.errlog -XDrawDiagnostics TestCast6979683_BAD38.java
++ */
++
++public class TestCast6979683_BAD38 {
++    //...
++    //...
++    //...
++    //...
++    static float cconvBAD1(Comparable<Character> o) { return o; } //BAD
++    //...
++}
+diff --git a/test/tools/javac/6979683/TestCast6979683_BAD38.java.errlog b/test/tools/javac/6979683/TestCast6979683_BAD38.java.errlog
+new file mode 100644
+--- /dev/null
++++ b/test/tools/javac/6979683/TestCast6979683_BAD38.java.errlog
+@@ -0,0 +1,2 @@
++TestCast6979683_BAD38.java:38:62: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.Comparable<java.lang.Character>, float
++1 error
+diff --git a/test/tools/javac/6979683/TestCast6979683_BAD39.java b/test/tools/javac/6979683/TestCast6979683_BAD39.java
+new file mode 100644
+--- /dev/null
++++ b/test/tools/javac/6979683/TestCast6979683_BAD39.java
+@@ -0,0 +1,40 @@
++/*
++ * Copyright (c) 2010, 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.
++ */
++
++/*
++ * @test
++ * @bug 6979683
++ * @summary Verify that casts can narrow and unbox at the same time
++ * @author jrose
++ *
++ * @compile/fail/ref=TestCast6979683_BAD39.java.errlog -XDrawDiagnostics TestCast6979683_BAD39.java
++ */
++
++public class TestCast6979683_BAD39 {
++    //...
++    //...
++    //...
++    //...
++    //...
++    static float cconvBAD2(Number o) { return (char)o; } //BAD
++}
+diff --git a/test/tools/javac/6979683/TestCast6979683_BAD39.java.errlog b/test/tools/javac/6979683/TestCast6979683_BAD39.java.errlog
+new file mode 100644
+--- /dev/null
++++ b/test/tools/javac/6979683/TestCast6979683_BAD39.java.errlog
+@@ -0,0 +1,2 @@
++TestCast6979683_BAD39.java:39:53: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), java.lang.Number, char
++1 error
+diff --git a/test/tools/javac/6979683/TestCast6979683_GOOD.java b/test/tools/javac/6979683/TestCast6979683_GOOD.java
+new file mode 100644
+--- /dev/null
++++ b/test/tools/javac/6979683/TestCast6979683_GOOD.java
+@@ -0,0 +1,111 @@
++/*
++ * Copyright (c) 2010, 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.
++ */
++
++/*
++ * @test
++ * @bug 6979683
++ * @summary Verify that casts can narrow and unbox at the same time
++ * @author jrose
++ *
++ * @compile TestCast6979683_GOOD.java
++ * @run main TestCast6979683_GOOD
++ */
++
++public class TestCast6979683_GOOD {
 +    public static void main(String... av) {
 +        bugReportExample();
 +        for (int x = -1; x <= 2; x++) {
@@ -210,7 +417,6 @@
 +    static boolean zconv1(Boolean o) { return o; }
 +    static boolean zconv2(Object o) { return (boolean)o; }
 +    static boolean zconv3(Comparable<Boolean> o) { return (boolean)o; }
-+    //static boolean zconvBAD1(Number o) { return o; } //BAD
 +
 +    static void zconvTests(boolean x) {
 +        assertEquals(x, zconv1(x));
@@ -223,9 +429,6 @@
 +    static int iconv3(java.io.Serializable o) { return (int)o; }
 +    static int iconv4(Number o) { return (int)o; }
 +    static int iconv5(Comparable<Integer> o) { return (int)o; }
-+    //static int iconvBAD1(Number o) { return o; } //BAD: cast needed
-+    //static int iconvBAD2(Comparable<Integer> o) { return o; } //BAD: cast needed
-+    //static int iconvBAD3(Comparable<Short> o) { return (int)o; } //BAD: wrong instance
 +
 +    static void iconvTests(int x) {
 +        assertEquals(x, iconv1(x));
@@ -252,8 +455,6 @@
 +    static float cconv2(Object o) { return (char)o; }
 +    static float cconv3(java.io.Serializable o) { return (char)o; }
 +    static float cconv4(Comparable<Character> o) { return (char)o; }
-+    //static float cconvBAD1(Comparable<Character> o) { return o; } //BAD
-+    //static float cconvBAD2(Number o) { return (char)o; } //BAD
 +
 +    static void cconvTests(char x) {
 +        float xf = x;
@@ -264,735 +465,3 @@
 +    }
 +
 +}
-diff --git a/test/tools/javac/6979683/TestCast6979683_BAD106.java b/test/tools/javac/6979683/TestCast6979683_BAD106.java
-new file mode 100644
---- /dev/null
-+++ b/test/tools/javac/6979683/TestCast6979683_BAD106.java
-@@ -0,0 +1,117 @@
-+/*
-+ * Copyright (c) 2010, 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.
-+ */
-+
-+/*
-+ * @test
-+ * @bug 6979683
-+ * @summary Verify that casts can narrow and unbox at the same time
-+ * @author jrose
-+ *
-+ * @compile/fail TestCast6979683_BAD106.java
-+ * 
-+ */
-+
-+public class TestCast6979683_BAD106 {
-+    public static void main(String... av) {
-+        bugReportExample();
-+        for (int x = -1; x <= 2; x++) {
-+            zconvTests(x != 0);
-+            iconvTests(x);
-+            bconvTests((byte)x);
-+            cconvTests((char)x);
-+        }
-+        System.out.println("Successfully ran "+tests+" tests.");
-+    }
-+
-+    static int tests;
-+    static void assertEquals(Object x, Object y) {
-+        if (!x.equals(y)) {
-+            throw new RuntimeException("assertEquals: "+x+" != "+y);
-+        }
-+        ++tests;
-+    }
-+
-+    static void bugReportExample() {
-+  {} // example in bug report:
-+  Object x = (Object)1;
-+  int y = (int)x;
-+  {} // end example
-+    }
-+
-+    static boolean zconv1(Boolean o) { return o; }
-+    static boolean zconv2(Object o) { return (boolean)o; }
-+    static boolean zconv3(Comparable<Boolean> o) { return (boolean)o; }
-+    //static boolean zconvBAD1(Number o) { return o; } //BAD
-+
-+    static void zconvTests(boolean x) {
-+        assertEquals(x, zconv1(x));
-+        assertEquals(x, zconv2(x));
-+        assertEquals(x, zconv3(x));
-+    }
-+
-+    static int iconv1(Integer o) { return o; }
-+    static int iconv2(Object o) { return (int)o; }
-+    static int iconv3(java.io.Serializable o) { return (int)o; }
-+    static int iconv4(Number o) { return (int)o; }
-+    static int iconv5(Comparable<Integer> o) { return (int)o; }
-+    //static int iconvBAD1(Number o) { return o; } //BAD: cast needed
-+    //static int iconvBAD2(Comparable<Integer> o) { return o; } //BAD: cast needed
-+    //static int iconvBAD3(Comparable<Short> o) { return (int)o; } //BAD: wrong instance
-+
-+    static void iconvTests(int x) {
-+        assertEquals(x, iconv1(x));
-+        assertEquals(x, iconv2(x));
-+        assertEquals(x, iconv3(x));
-+        assertEquals(x, iconv4(x));
-+        assertEquals(x, iconv5(x));
-+    }
-+
-+    static float bconv1(Byte o) { return o; }  // note type "float"
-+    static float bconv2(Object o) { return (byte)o; }
-+    static float bconv3(java.io.Serializable o) { return (byte)o; }
-+    static float bconv4(Number o) { return (byte)o; }
-+
-+    static void bconvTests(byte x) {
-+        float xf = x;
-+        assertEquals(xf, bconv1(x));
-+        assertEquals(xf, bconv2(x));
-+        assertEquals(xf, bconv3(x));
-+        assertEquals(xf, bconv4(x));
-+    }
-+
-+    static float cconv1(Character o) { return o; }  // note type "float"
-+    static float cconv2(Object o) { return (char)o; }
-+    static float cconv3(java.io.Serializable o) { return (char)o; }
-+    static float cconv4(Comparable<Character> o) { return (char)o; }
-+    static float cconvBAD1(Comparable<Character> o) { return o; } //BAD
-+    //static float cconvBAD2(Number o) { return (char)o; } //BAD
-+
-+    static void cconvTests(char x) {
-+        float xf = x;
-+        assertEquals(xf, cconv1(x));
-+        assertEquals(xf, cconv2(x));
-+        assertEquals(xf, cconv3(x));
-+        assertEquals(xf, cconv4(x));
-+    }
-+
-+}
-diff --git a/test/tools/javac/6979683/TestCast6979683_BAD107.java b/test/tools/javac/6979683/TestCast6979683_BAD107.java
-new file mode 100644
---- /dev/null
-+++ b/test/tools/javac/6979683/TestCast6979683_BAD107.java
-@@ -0,0 +1,117 @@
-+/*
-+ * Copyright (c) 2010, 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.
-+ */
-+
-+/*
-+ * @test
-+ * @bug 6979683
-+ * @summary Verify that casts can narrow and unbox at the same time
-+ * @author jrose
-+ *
-+ * @compile/fail TestCast6979683_BAD107.java
-+ * 
-+ */
-+
-+public class TestCast6979683_BAD107 {
-+    public static void main(String... av) {
-+        bugReportExample();
-+        for (int x = -1; x <= 2; x++) {
-+            zconvTests(x != 0);
-+            iconvTests(x);
-+            bconvTests((byte)x);
-+            cconvTests((char)x);
-+        }
-+        System.out.println("Successfully ran "+tests+" tests.");
-+    }
-+
-+    static int tests;
-+    static void assertEquals(Object x, Object y) {
-+        if (!x.equals(y)) {
-+            throw new RuntimeException("assertEquals: "+x+" != "+y);
-+        }
-+        ++tests;
-+    }
-+
-+    static void bugReportExample() {
-+  {} // example in bug report:
-+  Object x = (Object)1;
-+  int y = (int)x;
-+  {} // end example
-+    }
-+
-+    static boolean zconv1(Boolean o) { return o; }
-+    static boolean zconv2(Object o) { return (boolean)o; }
-+    static boolean zconv3(Comparable<Boolean> o) { return (boolean)o; }
-+    //static boolean zconvBAD1(Number o) { return o; } //BAD
-+
-+    static void zconvTests(boolean x) {
-+        assertEquals(x, zconv1(x));
-+        assertEquals(x, zconv2(x));
-+        assertEquals(x, zconv3(x));
-+    }
-+
-+    static int iconv1(Integer o) { return o; }
-+    static int iconv2(Object o) { return (int)o; }
-+    static int iconv3(java.io.Serializable o) { return (int)o; }
-+    static int iconv4(Number o) { return (int)o; }
-+    static int iconv5(Comparable<Integer> o) { return (int)o; }
-+    //static int iconvBAD1(Number o) { return o; } //BAD: cast needed
-+    //static int iconvBAD2(Comparable<Integer> o) { return o; } //BAD: cast needed
-+    //static int iconvBAD3(Comparable<Short> o) { return (int)o; } //BAD: wrong instance
-+
-+    static void iconvTests(int x) {
-+        assertEquals(x, iconv1(x));
-+        assertEquals(x, iconv2(x));
-+        assertEquals(x, iconv3(x));
-+        assertEquals(x, iconv4(x));
-+        assertEquals(x, iconv5(x));
-+    }
-+
-+    static float bconv1(Byte o) { return o; }  // note type "float"
-+    static float bconv2(Object o) { return (byte)o; }
-+    static float bconv3(java.io.Serializable o) { return (byte)o; }
-+    static float bconv4(Number o) { return (byte)o; }
-+
-+    static void bconvTests(byte x) {
-+        float xf = x;
-+        assertEquals(xf, bconv1(x));
-+        assertEquals(xf, bconv2(x));
-+        assertEquals(xf, bconv3(x));
-+        assertEquals(xf, bconv4(x));
-+    }
-+
-+    static float cconv1(Character o) { return o; }  // note type "float"
-+    static float cconv2(Object o) { return (char)o; }
-+    static float cconv3(java.io.Serializable o) { return (char)o; }
-+    static float cconv4(Comparable<Character> o) { return (char)o; }
-+    //static float cconvBAD1(Comparable<Character> o) { return o; } //BAD
-+    static float cconvBAD2(Number o) { return (char)o; } //BAD
-+
-+    static void cconvTests(char x) {
-+        float xf = x;
-+        assertEquals(xf, cconv1(x));
-+        assertEquals(xf, cconv2(x));
-+        assertEquals(xf, cconv3(x));
-+        assertEquals(xf, cconv4(x));
-+    }
-+
-+}
-diff --git a/test/tools/javac/6979683/TestCast6979683_BAD64.java b/test/tools/javac/6979683/TestCast6979683_BAD64.java
-new file mode 100644
---- /dev/null
-+++ b/test/tools/javac/6979683/TestCast6979683_BAD64.java
-@@ -0,0 +1,117 @@
-+/*
-+ * Copyright (c) 2010, 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.
-+ */
-+
-+/*
-+ * @test
-+ * @bug 6979683
-+ * @summary Verify that casts can narrow and unbox at the same time
-+ * @author jrose
-+ *
-+ * @compile/fail TestCast6979683_BAD64.java
-+ * 
-+ */
-+
-+public class TestCast6979683_BAD64 {
-+    public static void main(String... av) {
-+        bugReportExample();
-+        for (int x = -1; x <= 2; x++) {
-+            zconvTests(x != 0);
-+            iconvTests(x);
-+            bconvTests((byte)x);
-+            cconvTests((char)x);
-+        }
-+        System.out.println("Successfully ran "+tests+" tests.");
-+    }
-+
-+    static int tests;
-+    static void assertEquals(Object x, Object y) {
-+        if (!x.equals(y)) {
-+            throw new RuntimeException("assertEquals: "+x+" != "+y);
-+        }
-+        ++tests;
-+    }
-+
-+    static void bugReportExample() {
-+  {} // example in bug report:
-+  Object x = (Object)1;
-+  int y = (int)x;
-+  {} // end example
-+    }
-+
-+    static boolean zconv1(Boolean o) { return o; }
-+    static boolean zconv2(Object o) { return (boolean)o; }
-+    static boolean zconv3(Comparable<Boolean> o) { return (boolean)o; }
-+    static boolean zconvBAD1(Number o) { return o; } //BAD
-+
-+    static void zconvTests(boolean x) {
-+        assertEquals(x, zconv1(x));
-+        assertEquals(x, zconv2(x));
-+        assertEquals(x, zconv3(x));
-+    }
-+
-+    static int iconv1(Integer o) { return o; }
-+    static int iconv2(Object o) { return (int)o; }
-+    static int iconv3(java.io.Serializable o) { return (int)o; }
-+    static int iconv4(Number o) { return (int)o; }
-+    static int iconv5(Comparable<Integer> o) { return (int)o; }
-+    //static int iconvBAD1(Number o) { return o; } //BAD: cast needed
-+    //static int iconvBAD2(Comparable<Integer> o) { return o; } //BAD: cast needed
-+    //static int iconvBAD3(Comparable<Short> o) { return (int)o; } //BAD: wrong instance
-+
-+    static void iconvTests(int x) {
-+        assertEquals(x, iconv1(x));
-+        assertEquals(x, iconv2(x));
-+        assertEquals(x, iconv3(x));
-+        assertEquals(x, iconv4(x));
-+        assertEquals(x, iconv5(x));
-+    }
-+
-+    static float bconv1(Byte o) { return o; }  // note type "float"
-+    static float bconv2(Object o) { return (byte)o; }
-+    static float bconv3(java.io.Serializable o) { return (byte)o; }
-+    static float bconv4(Number o) { return (byte)o; }
-+
-+    static void bconvTests(byte x) {
-+        float xf = x;
-+        assertEquals(xf, bconv1(x));
-+        assertEquals(xf, bconv2(x));
-+        assertEquals(xf, bconv3(x));
-+        assertEquals(xf, bconv4(x));
-+    }
-+
-+    static float cconv1(Character o) { return o; }  // note type "float"
-+    static float cconv2(Object o) { return (char)o; }
-+    static float cconv3(java.io.Serializable o) { return (char)o; }
-+    static float cconv4(Comparable<Character> o) { return (char)o; }
-+    //static float cconvBAD1(Comparable<Character> o) { return o; } //BAD
-+    //static float cconvBAD2(Number o) { return (char)o; } //BAD
-+
-+    static void cconvTests(char x) {
-+        float xf = x;
-+        assertEquals(xf, cconv1(x));
-+        assertEquals(xf, cconv2(x));
-+        assertEquals(xf, cconv3(x));
-+        assertEquals(xf, cconv4(x));
-+    }
-+
-+}
-diff --git a/test/tools/javac/6979683/TestCast6979683_BAD77.java b/test/tools/javac/6979683/TestCast6979683_BAD77.java
-new file mode 100644
---- /dev/null
-+++ b/test/tools/javac/6979683/TestCast6979683_BAD77.java
-@@ -0,0 +1,117 @@
-+/*
-+ * Copyright (c) 2010, 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.
-+ */
-+
-+/*
-+ * @test
-+ * @bug 6979683
-+ * @summary Verify that casts can narrow and unbox at the same time
-+ * @author jrose
-+ *
-+ * @compile/fail TestCast6979683_BAD77.java
-+ * 
-+ */
-+
-+public class TestCast6979683_BAD77 {
-+    public static void main(String... av) {
-+        bugReportExample();
-+        for (int x = -1; x <= 2; x++) {
-+            zconvTests(x != 0);
-+            iconvTests(x);
-+            bconvTests((byte)x);
-+            cconvTests((char)x);
-+        }
-+        System.out.println("Successfully ran "+tests+" tests.");
-+    }
-+
-+    static int tests;
-+    static void assertEquals(Object x, Object y) {
-+        if (!x.equals(y)) {
-+            throw new RuntimeException("assertEquals: "+x+" != "+y);
-+        }
-+        ++tests;
-+    }
-+
-+    static void bugReportExample() {
-+  {} // example in bug report:
-+  Object x = (Object)1;
-+  int y = (int)x;
-+  {} // end example
-+    }
-+
-+    static boolean zconv1(Boolean o) { return o; }
-+    static boolean zconv2(Object o) { return (boolean)o; }
-+    static boolean zconv3(Comparable<Boolean> o) { return (boolean)o; }
-+    //static boolean zconvBAD1(Number o) { return o; } //BAD
-+
-+    static void zconvTests(boolean x) {
-+        assertEquals(x, zconv1(x));
-+        assertEquals(x, zconv2(x));
-+        assertEquals(x, zconv3(x));
-+    }
-+
-+    static int iconv1(Integer o) { return o; }
-+    static int iconv2(Object o) { return (int)o; }
-+    static int iconv3(java.io.Serializable o) { return (int)o; }
-+    static int iconv4(Number o) { return (int)o; }
-+    static int iconv5(Comparable<Integer> o) { return (int)o; }
-+    static int iconvBAD1(Number o) { return o; } //BAD: cast needed
-+    //static int iconvBAD2(Comparable<Integer> o) { return o; } //BAD: cast needed
-+    //static int iconvBAD3(Comparable<Short> o) { return (int)o; } //BAD: wrong instance
-+
-+    static void iconvTests(int x) {
-+        assertEquals(x, iconv1(x));
-+        assertEquals(x, iconv2(x));
-+        assertEquals(x, iconv3(x));
-+        assertEquals(x, iconv4(x));
-+        assertEquals(x, iconv5(x));
-+    }
-+
-+    static float bconv1(Byte o) { return o; }  // note type "float"
-+    static float bconv2(Object o) { return (byte)o; }
-+    static float bconv3(java.io.Serializable o) { return (byte)o; }
-+    static float bconv4(Number o) { return (byte)o; }
-+
-+    static void bconvTests(byte x) {
-+        float xf = x;
-+        assertEquals(xf, bconv1(x));
-+        assertEquals(xf, bconv2(x));
-+        assertEquals(xf, bconv3(x));
-+        assertEquals(xf, bconv4(x));
-+    }
-+
-+    static float cconv1(Character o) { return o; }  // note type "float"
-+    static float cconv2(Object o) { return (char)o; }
-+    static float cconv3(java.io.Serializable o) { return (char)o; }
-+    static float cconv4(Comparable<Character> o) { return (char)o; }
-+    //static float cconvBAD1(Comparable<Character> o) { return o; } //BAD
-+    //static float cconvBAD2(Number o) { return (char)o; } //BAD
-+
-+    static void cconvTests(char x) {
-+        float xf = x;
-+        assertEquals(xf, cconv1(x));
-+        assertEquals(xf, cconv2(x));
-+        assertEquals(xf, cconv3(x));
-+        assertEquals(xf, cconv4(x));
-+    }
-+
-+}
-diff --git a/test/tools/javac/6979683/TestCast6979683_BAD78.java b/test/tools/javac/6979683/TestCast6979683_BAD78.java
-new file mode 100644
---- /dev/null
-+++ b/test/tools/javac/6979683/TestCast6979683_BAD78.java
-@@ -0,0 +1,117 @@
-+/*
-+ * Copyright (c) 2010, 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.
-+ */
-+
-+/*
-+ * @test
-+ * @bug 6979683
-+ * @summary Verify that casts can narrow and unbox at the same time
-+ * @author jrose
-+ *
-+ * @compile/fail TestCast6979683_BAD78.java
-+ * 
-+ */
-+
-+public class TestCast6979683_BAD78 {
-+    public static void main(String... av) {
-+        bugReportExample();
-+        for (int x = -1; x <= 2; x++) {
-+            zconvTests(x != 0);
-+            iconvTests(x);
-+            bconvTests((byte)x);
-+            cconvTests((char)x);
-+        }
-+        System.out.println("Successfully ran "+tests+" tests.");
-+    }
-+
-+    static int tests;
-+    static void assertEquals(Object x, Object y) {
-+        if (!x.equals(y)) {
-+            throw new RuntimeException("assertEquals: "+x+" != "+y);
-+        }
-+        ++tests;
-+    }
-+
-+    static void bugReportExample() {
-+  {} // example in bug report:
-+  Object x = (Object)1;
-+  int y = (int)x;
-+  {} // end example
-+    }
-+
-+    static boolean zconv1(Boolean o) { return o; }
-+    static boolean zconv2(Object o) { return (boolean)o; }
-+    static boolean zconv3(Comparable<Boolean> o) { return (boolean)o; }
-+    //static boolean zconvBAD1(Number o) { return o; } //BAD
-+
-+    static void zconvTests(boolean x) {
-+        assertEquals(x, zconv1(x));
-+        assertEquals(x, zconv2(x));
-+        assertEquals(x, zconv3(x));
-+    }
-+
-+    static int iconv1(Integer o) { return o; }
-+    static int iconv2(Object o) { return (int)o; }
-+    static int iconv3(java.io.Serializable o) { return (int)o; }
-+    static int iconv4(Number o) { return (int)o; }
-+    static int iconv5(Comparable<Integer> o) { return (int)o; }
-+    //static int iconvBAD1(Number o) { return o; } //BAD: cast needed
-+    static int iconvBAD2(Comparable<Integer> o) { return o; } //BAD: cast needed
-+    //static int iconvBAD3(Comparable<Short> o) { return (int)o; } //BAD: wrong instance
-+
-+    static void iconvTests(int x) {
-+        assertEquals(x, iconv1(x));
-+        assertEquals(x, iconv2(x));
-+        assertEquals(x, iconv3(x));
-+        assertEquals(x, iconv4(x));
-+        assertEquals(x, iconv5(x));
-+    }
-+
-+    static float bconv1(Byte o) { return o; }  // note type "float"
-+    static float bconv2(Object o) { return (byte)o; }
-+    static float bconv3(java.io.Serializable o) { return (byte)o; }
-+    static float bconv4(Number o) { return (byte)o; }
-+
-+    static void bconvTests(byte x) {
-+        float xf = x;
-+        assertEquals(xf, bconv1(x));
-+        assertEquals(xf, bconv2(x));
-+        assertEquals(xf, bconv3(x));
-+        assertEquals(xf, bconv4(x));
-+    }
-+
-+    static float cconv1(Character o) { return o; }  // note type "float"
-+    static float cconv2(Object o) { return (char)o; }
-+    static float cconv3(java.io.Serializable o) { return (char)o; }
-+    static float cconv4(Comparable<Character> o) { return (char)o; }
-+    //static float cconvBAD1(Comparable<Character> o) { return o; } //BAD
-+    //static float cconvBAD2(Number o) { return (char)o; } //BAD
-+
-+    static void cconvTests(char x) {
-+        float xf = x;
-+        assertEquals(xf, cconv1(x));
-+        assertEquals(xf, cconv2(x));
-+        assertEquals(xf, cconv3(x));
-+        assertEquals(xf, cconv4(x));
-+    }
-+
-+}
-diff --git a/test/tools/javac/6979683/TestCast6979683_BAD79.java b/test/tools/javac/6979683/TestCast6979683_BAD79.java
-new file mode 100644
---- /dev/null
-+++ b/test/tools/javac/6979683/TestCast6979683_BAD79.java
-@@ -0,0 +1,117 @@
-+/*
-+ * Copyright (c) 2010, 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.
-+ */
-+
-+/*
-+ * @test
-+ * @bug 6979683
-+ * @summary Verify that casts can narrow and unbox at the same time
-+ * @author jrose
-+ *
-+ * @compile/fail TestCast6979683_BAD79.java
-+ * 
-+ */
-+
-+public class TestCast6979683_BAD79 {
-+    public static void main(String... av) {
-+        bugReportExample();
-+        for (int x = -1; x <= 2; x++) {
-+            zconvTests(x != 0);
-+            iconvTests(x);
-+            bconvTests((byte)x);
-+            cconvTests((char)x);
-+        }
-+        System.out.println("Successfully ran "+tests+" tests.");
-+    }
-+
-+    static int tests;
-+    static void assertEquals(Object x, Object y) {
-+        if (!x.equals(y)) {
-+            throw new RuntimeException("assertEquals: "+x+" != "+y);
-+        }
-+        ++tests;
-+    }
-+
-+    static void bugReportExample() {
-+  {} // example in bug report:
-+  Object x = (Object)1;
-+  int y = (int)x;
-+  {} // end example
-+    }
-+
-+    static boolean zconv1(Boolean o) { return o; }
-+    static boolean zconv2(Object o) { return (boolean)o; }
-+    static boolean zconv3(Comparable<Boolean> o) { return (boolean)o; }
-+    //static boolean zconvBAD1(Number o) { return o; } //BAD
-+
-+    static void zconvTests(boolean x) {
-+        assertEquals(x, zconv1(x));
-+        assertEquals(x, zconv2(x));
-+        assertEquals(x, zconv3(x));
-+    }
-+
-+    static int iconv1(Integer o) { return o; }
-+    static int iconv2(Object o) { return (int)o; }
-+    static int iconv3(java.io.Serializable o) { return (int)o; }
-+    static int iconv4(Number o) { return (int)o; }
-+    static int iconv5(Comparable<Integer> o) { return (int)o; }
-+    //static int iconvBAD1(Number o) { return o; } //BAD: cast needed
-+    //static int iconvBAD2(Comparable<Integer> o) { return o; } //BAD: cast needed
-+    static int iconvBAD3(Comparable<Short> o) { return (int)o; } //BAD: wrong instance
-+
-+    static void iconvTests(int x) {
-+        assertEquals(x, iconv1(x));
-+        assertEquals(x, iconv2(x));
-+        assertEquals(x, iconv3(x));
-+        assertEquals(x, iconv4(x));
-+        assertEquals(x, iconv5(x));
-+    }
-+
-+    static float bconv1(Byte o) { return o; }  // note type "float"
-+    static float bconv2(Object o) { return (byte)o; }
-+    static float bconv3(java.io.Serializable o) { return (byte)o; }
-+    static float bconv4(Number o) { return (byte)o; }
-+
-+    static void bconvTests(byte x) {
-+        float xf = x;
-+        assertEquals(xf, bconv1(x));
-+        assertEquals(xf, bconv2(x));
-+        assertEquals(xf, bconv3(x));
-+        assertEquals(xf, bconv4(x));
-+    }
-+
-+    static float cconv1(Character o) { return o; }  // note type "float"
-+    static float cconv2(Object o) { return (char)o; }
-+    static float cconv3(java.io.Serializable o) { return (char)o; }
-+    static float cconv4(Comparable<Character> o) { return (char)o; }
-+    //static float cconvBAD1(Comparable<Character> o) { return o; } //BAD
-+    //static float cconvBAD2(Number o) { return (char)o; } //BAD
-+
-+    static void cconvTests(char x) {
-+        float xf = x;
-+        assertEquals(xf, cconv1(x));
-+        assertEquals(xf, cconv2(x));
-+        assertEquals(xf, cconv3(x));
-+        assertEquals(xf, cconv4(x));
-+    }
-+
-+}
--- a/meth-edrfix-6979327.patch	Thu Aug 26 15:35:54 2010 -0700
+++ b/meth-edrfix-6979327.patch	Tue Sep 07 17:04:30 2010 -0700
@@ -1,6 +1,6 @@
 6979327: method handle invocation should use casts instead of type parameters to specify return type
 Summary: Use cast-based target typing instead of type parameter syntax to specify types of method handle calls.
-Reviewed-by: ?
+Reviewed-by: mcimadamore
 
 Allow new versions of javac to compile old versions of JSR 292 code.
 Allow new versions of the JSR 292 code to omit type parameters from polymorphic signatures.
@@ -14,17 +14,20 @@
 diff --git a/src/share/classes/com/sun/tools/javac/code/Source.java b/src/share/classes/com/sun/tools/javac/code/Source.java
 --- a/src/share/classes/com/sun/tools/javac/code/Source.java
 +++ b/src/share/classes/com/sun/tools/javac/code/Source.java
-@@ -174,10 +174,6 @@
-     public boolean allowStringsInSwitch() {
+@@ -171,11 +171,10 @@
+     public boolean allowUnderscoresInLiterals() {
+         return compareTo(JDK1_7) >= 0;
+     }
+-    public boolean allowStringsInSwitch() {
++    public boolean allowExoticIdentifiers() {
          return compareTo(JDK1_7) >= 0;
      }
 -    // JSR 292: recognize @PolymorphicSignature on java/dyn names
 -    public boolean allowPolymorphicSignature() {
--        return compareTo(JDK1_7) >= 0;
--    }
++    public boolean allowStringsInSwitch() {
+         return compareTo(JDK1_7) >= 0;
+     }
      public static SourceVersion toSourceVersion(Source source) {
-         switch(source) {
-         case JDK1_2:
 diff --git a/src/share/classes/com/sun/tools/javac/comp/Attr.java b/src/share/classes/com/sun/tools/javac/comp/Attr.java
 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java
 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java
@@ -32,7 +35,7 @@
  
      public void visitExec(JCExpressionStatement tree) {
          attribExpr(tree.expr, env);
-+        tree.expr = pushTargetType(syms.voidType, tree.expr);
++        tree.expr = pushSignaturePolymorphicReturnType(syms.voidType, tree.expr);
          result = null;
      }
  
@@ -78,7 +81,7 @@
          Type clazztype = attribType(tree.clazz, env);
          chk.validate(tree.clazz, env);
          Type exprtype = attribExpr(tree.expr, env, Infer.anyPoly);
-+        tree.expr = pushTargetType(clazztype, tree.expr);
++        tree.expr = pushSignaturePolymorphicReturnType(clazztype, tree.expr);
          Type owntype = chk.checkCastable(tree.expr.pos(), exprtype, clazztype);
          if (exprtype.constValue() != null)
              owntype = cfolder.coerce(exprtype, owntype);
@@ -86,7 +89,7 @@
      }
  
 +    // A cast or occurrence as an expression statement can affect the linkage of some method calls.
-+    JCExpression pushTargetType(Type targetType, JCExpression expr) {
++    JCExpression pushSignaturePolymorphicReturnType(Type returnType, JCExpression expr) {
 +        // JSR 292:  Link some calls according to return type as indicated by a cast.
 +        if (expr.getTag() == JCTree.APPLY) {
 +            JCExpression meth = ((JCMethodInvocation)expr).meth;
@@ -96,12 +99,12 @@
 +                    MethodSymbol sym = (MethodSymbol) methsel.sym;
 +                    MethodType oldType = sym.type.asMethodType();
 +                    Symbol newSym = rs.findPolymorphicSignatureInstance(sym.owner.type, sym.name, sym,
-+                                                                        targetType,
++                                                                        returnType,
 +                                                                        oldType.argtypes);
 +                    if (!rs.isPolymorphicSignatureInstance(newSym))
 +                        throw new AssertionError("can't split poly sym: "+sym);
 +                    methsel.sym = newSym;
-+                    expr.type = targetType;
++                    expr.type = returnType;
 +                }
 +            }
 +        }
@@ -289,7 +292,7 @@
 +    }
 +
 +    /** Compute a provisional return type for a polymorphic signature call.
-+     *  This is just Object.  It might be retroactively changed by Attr.pushTargetType.
++     *  This is just Object.  It might be retroactively changed by Attr.pushSignaturePolymorphicReturnType.
 +     *  Decode <T> in foo.<T>invoke(bar), for JSR 292 EDR only.
 +     */
 +    Type initialPolymorphicSignatureResultType(Env<AttrContext> env, List<Type> typeargtypes) {
@@ -411,6 +414,39 @@
          // handle this here so it works even if no other options given
          String showClass = options.get("showClass");
          if (showClass != null) {
+diff --git a/src/share/classes/com/sun/tools/javac/parser/Scanner.java b/src/share/classes/com/sun/tools/javac/parser/Scanner.java
+--- a/src/share/classes/com/sun/tools/javac/parser/Scanner.java
++++ b/src/share/classes/com/sun/tools/javac/parser/Scanner.java
+@@ -108,6 +108,10 @@
+      */
+     private boolean allowUnderscoresInLiterals;
+ 
++    /** Allow exotic identifiers.
++     */
++    private boolean allowExoticIdentifiers;
++
+     /** The source language setting.
+      */
+     private Source source;
+@@ -181,6 +185,7 @@
+         allowBinaryLiterals = source.allowBinaryLiterals();
+         allowHexFloats = source.allowHexFloats();
+         allowUnderscoresInLiterals = source.allowBinaryLiterals();
++        allowExoticIdentifiers = source.allowExoticIdentifiers();  // for invokedynamic
+     }
+ 
+     private static final boolean hexFloatsWork = hexFloatsWork();
+@@ -1010,6 +1015,10 @@
+                 case '#':
+                     scanChar();
+                     if (ch == '\"') {
++                        if (!allowExoticIdentifiers) {
++                            lexError("unsupported.exotic.id", source.name);
++                            allowExoticIdentifiers = true;
++                        }
+                         scanChar();
+                         if (ch == '\"')
+                             lexError(pos, "empty.bytecode.ident");
 diff --git a/src/share/classes/com/sun/tools/javac/resources/compiler.properties b/src/share/classes/com/sun/tools/javac/resources/compiler.properties
 --- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties
 +++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties
@@ -428,6 +464,17 @@
  compiler.err.concrete.inheritance.conflict=\
      methods {0} from {1} and {2} from {3} are inherited with the same signature
  
+@@ -1238,6 +1245,10 @@
+     underscores in literals are not supported in -source {0}\n\
+ (use -source 7 or higher to enable underscores in literals)
+ 
++compiler.err.unsupported.exotic.id=\
++    exotic identifiers #"___" are not supported in -source {0}\n\
++(use -source 7 or higher to enable exotic identifiers)
++
+ compiler.err.automatic.resource.management.not.supported.in.source=\
+     automatic resource management is not supported in -source {0}\n\
+ (use -source 7 or higher to enable automatic resource management)
 diff --git a/src/share/classes/com/sun/tools/javac/util/Names.java b/src/share/classes/com/sun/tools/javac/util/Names.java
 --- a/src/share/classes/com/sun/tools/javac/util/Names.java
 +++ b/src/share/classes/com/sun/tools/javac/util/Names.java
@@ -463,3 +510,388 @@
  
          TYPE = fromString("TYPE");
          TYPE_USE = fromString("TYPE_USE");
+diff --git a/test/tools/javac/meth/InvokeDyn.java b/test/tools/javac/meth/InvokeDyn.java
+--- a/test/tools/javac/meth/InvokeDyn.java
++++ b/test/tools/javac/meth/InvokeDyn.java
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2008, 2010, 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
+@@ -28,7 +28,7 @@
+  * @author jrose
+  *
+  * @library ..
+- * @compile -source 7 -target 7 InvokeDyn.java
++ * @compile -source 7 -target 7 -XDinvokedynamic -XDallowTransitionalJSR292=no InvokeDyn.java
+  */
+ //No: @run main/othervm -XX:+EnableInvokeDynamic meth.InvokeDyn
+ 
+@@ -44,16 +44,21 @@
+ 
+ package meth;
+ 
+-import java.dyn.InvokeDynamic;
++import java.dyn.*;
+ 
+ public class InvokeDyn {
++    class CS extends CallSite {
++        CS(Object x, Object y, Object z) { throw new RuntimeException(); }
++    }
++    @BootstrapMethod(CS.class)  //note: requires 6964498
+     void test() throws Throwable {
+         Object x = "hello";
+-        InvokeDynamic.greet(x, "world", 123);
+-        InvokeDynamic.greet(x, "mundus", 456);
+-        InvokeDynamic.greet(x, "kosmos", 789);
+-        InvokeDynamic.<String>cogitate(10.11121, 3.14);
+-        InvokeDynamic.<void>#"yow: what I mean to say is, please treat this one specially"(null);
+-        InvokeDynamic.<int>invoke("goodbye");
++        Object ojunk; int ijunk;
++        ojunk = InvokeDynamic.greet(x, "world", 123);
++        ojunk = InvokeDynamic.greet(x, "mundus", 456);
++        ojunk = InvokeDynamic.greet(x, "kosmos", 789);
++        ojunk = (String) InvokeDynamic.cogitate(10.11121, 3.14);
++        InvokeDynamic.#"yow: what I mean to say is, please treat this one specially"(null);
++        ijunk = (int) InvokeDynamic.invoke("goodbye");
+     }
+ }
+diff --git a/test/tools/javac/meth/InvokeMH.java b/test/tools/javac/meth/InvokeMH.java
+--- a/test/tools/javac/meth/InvokeMH.java
++++ b/test/tools/javac/meth/InvokeMH.java
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2008, 2010, 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
+@@ -27,7 +27,7 @@
+  * @summary Generate call sites for method handle
+  * @author jrose
+  *
+- * @compile -source 7 -target 7 InvokeMH.java
++ * @compile -source 7 -target 7 -XDallowTransitionalJSR292=no InvokeMH.java
+  */
+ 
+ /*
+@@ -57,20 +57,17 @@
+         Object k = "kosmos";
+         mh_SiO.invokeExact((String)k, 789);
+         o = mh_SiO.invokeExact((String)null, 000);
+-        o = mh_SiO.<Object>invokeExact("arda", -123);
++        o = (Object) mh_SiO.invokeExact("arda", -123);
+ 
+         // sig = ()String
+-        s = mh_vS.<String>invokeExact();
++        s = (String) mh_vS.invokeExact();
+ 
+         // sig = ()int
+-        i = mh_vi.<int>invokeExact();
+-        o = mh_vi.<int>invokeExact();
+-        //s = mh_vi.<int>invokeExact(); //BAD
+-        mh_vi.<int>invokeExact();
++        i = (int) mh_vi.invokeExact();
++        o = (int) mh_vi.invokeExact();
+ 
+         // sig = ()void
+-        //o = mh_vv.<void>invokeExact(); //BAD
+-        mh_vv.<void>invokeExact();
++        mh_vv.invokeExact();
+     }
+ 
+     void testGen(MethodHandle mh_SiO,
+@@ -80,24 +77,23 @@
+         Object o; String s; int i;  // for return type testing
+ 
+         // next five must have sig = (*,*)*
+-        mh_SiO.invokeGeneric((Object)"world", (Object)123);
+-        mh_SiO.<void>invokeGeneric((Object)"mundus", (Object)456);
++        o = mh_SiO.invokeGeneric((Object)"world", (Object)123);
++        mh_SiO.invokeGeneric((Object)"mundus", (Object)456);
+         Object k = "kosmos";
+-        mh_SiO.invokeGeneric(k, 789);
++        o = mh_SiO.invokeGeneric(k, 789);
+         o = mh_SiO.invokeGeneric(null, 000);
+-        o = mh_SiO.<Object>invokeGeneric("arda", -123);
++        o = mh_SiO.invokeGeneric("arda", -123);
+ 
+         // sig = ()String
+         o = mh_vS.invokeGeneric();
+ 
+         // sig = ()int
+-        i = mh_vi.<int>invokeGeneric();
+-        o = mh_vi.invokeGeneric();
+-        //s = mh_vi.<int>invokeGeneric(); //BAD
+-        mh_vi.<void>invokeGeneric();
++        i = (int) mh_vi.invokeGeneric();
++        o = (int) mh_vi.invokeGeneric();
++        mh_vi.invokeGeneric();
+ 
+         // sig = ()void
+-        //o = mh_vv.<void>invokeGeneric(); //BAD
++        mh_vv.invokeGeneric();
+         o = mh_vv.invokeGeneric();
+     }
+ }
+diff --git a/test/tools/javac/meth/MakeNegTests.sh b/test/tools/javac/meth/MakeNegTests.sh
+deleted file mode 100644
+--- a/test/tools/javac/meth/MakeNegTests.sh
++++ /dev/null
+@@ -1,98 +0,0 @@
+-#!/bin/sh
+-
+-#
+-# Copyright (c) 2008, 2009, 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.
+-#
+-
+-# @test
+-# @bug 6754038
+-# @summary Verify correct rejection of strongly typed return values
+-# @run shell MakeNegTests.sh
+-
+-default_template=InvokeMH.java
+-javacflags='-source 7 -target 7'
+-# the rest of this file is a generic "//BAD"-line tester
+-
+-: ${TESTSRC=.} ${TESTCLASSES=.}
+-javac="${TESTJAVA+${TESTJAVA}/bin/}javac"
+-
+-verbose=false quiet=false
+-
+-main() {
+-  case "${@-}" in
+-  *.java*)
+-    for template in "$@"; do
+-      expand_and_test "$template"
+-    done;;
+-  *) expand_and_test "${TESTSRC}/$default_template";;
+-  esac
+-}
+-
+-expand_and_test() {
+-  template=$1
+-  expand "$@"
+-  testneg "$@"
+-}
+-
+-expand() {
+-  template=$1
+-  badlines=` grep -n < "$template" '//BAD' `
+-  badcount=` echo "$badlines" | wc -l `
+-  [ $badcount -gt 0 ] || { echo "No negative test cases in $template"; exit 1; }
+-  $quiet || echo "Expanding $badcount negative test cases from $template:"
+-  $quiet || echo "$badlines"
+-  badnums=` echo "$badlines" | sed 's/:.*//' `
+-  casestem=` getcasestem "$template" `
+-  tclassname=` basename "$template" .java `
+-  rm -f "$casestem"*.java
+-  for badnum in $badnums; do
+-    casefile="$casestem"${badnum}.java
+-    cclassname=` basename "$casefile" .java `
+-    sed < "$template" > "$casefile" "
+-      s|@compile|@compile/fail|
+-      / @[a-z]/s|@|##|
+-      ${badnum}s:^ *[/*]*:    :
+-      s/${tclassname}/${cclassname}/g
+-    "
+-    $verbose && diff -u "$template" "$casefile"
+-  done
+-}
+-
+-getcasestem() {
+-  echo `basename $1` | sed 's/\.java$//;s/_BAD[0-9]*$//;s/$/_BAD/'
+-}
+-
+-testneg() {
+-  template=$1
+-  for casefile in ` getcasestem "$template" `*.java; do
+-    $quiet || echo -------- $javac $javacflags "$casefile"
+-    $javac $javacflags "$casefile" > "$casefile".errlog 2>&1 && {
+-      echo "*** Compilation unexpectedly succeeded:  $casefile"
+-      exit 1
+-    }
+-    $quiet || echo "Compilation failed as expected"
+-    $quiet || head ` $verbose || echo -3 ` < "$casefile".errlog
+-    rm "$casefile".errlog
+-  done
+-}
+-
+-main "$@"
+diff --git a/test/tools/javac/quid/MakeNegTests.sh b/test/tools/javac/quid/MakeNegTests.sh
+deleted file mode 100644
+--- a/test/tools/javac/quid/MakeNegTests.sh
++++ /dev/null
+@@ -1,97 +0,0 @@
+-#!/bin/sh
+-
+-#
+-# Copyright (c) 2008, 2009, 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.
+-#
+-
+-# @test
+-# @bug 6746458
+-# @summary Verify correct rejection of illegal quoted identifiers.
+-# @run shell MakeNegTests.sh
+-
+-default_template=QuotedIdent.java
+-# the rest of this file is a generic "//BAD"-line tester
+-
+-: ${TESTSRC=.} ${TESTCLASSES=.}
+-javac="${TESTJAVA+${TESTJAVA}/bin/}javac"
+-
+-verbose=false quiet=false
+-
+-main() {
+-  case "${@-}" in
+-  *.java*)
+-    for template in "$@"; do
+-      expand_and_test "$template"
+-    done;;
+-  *) expand_and_test "${TESTSRC}/$default_template";;
+-  esac
+-}
+-
+-expand_and_test() {
+-  template=$1
+-  expand "$@"
+-  testneg "$@"
+-}
+-
+-expand() {
+-  template=$1
+-  badlines=` grep -n < "$template" '//BAD' `
+-  badcount=` echo "$badlines" | wc -l `
+-  [ $badcount -gt 0 ] || { echo "No negative test cases in $template"; exit 1; }
+-  $quiet || echo "Expanding $badcount negative test cases from $template:"
+-  $quiet || echo "$badlines"
+-  badnums=` echo "$badlines" | sed 's/:.*//' `
+-  casestem=` getcasestem "$template" `
+-  tclassname=` basename "$template" .java `
+-  rm "$casestem"*.java
+-  for badnum in $badnums; do
+-    casefile="$casestem"${badnum}.java
+-    cclassname=` basename "$casefile" .java `
+-    sed < "$template" > "$casefile" "
+-      s|@compile|@compile/fail|
+-      / @[a-z]/s|@|##|
+-      ${badnum}s:^ *[/*]*:    :
+-      s/${tclassname}/${cclassname}/g
+-    "
+-    $verbose && diff -u "$template" "$casefile"
+-  done
+-}
+-
+-getcasestem() {
+-  echo `basename $1` | sed 's/.*\///;s/\.java$//;s/_BAD[0-9]*$//;s/$/_BAD/'
+-}
+-
+-testneg() {
+-  template=$1
+-  for casefile in ` getcasestem "$template" `*.java; do
+-    $quiet || echo -------- $javac "$casefile"
+-    $javac "$casefile" > "$casefile".errlog 2>&1 && {
+-      echo "*** Compilation unexpectedly succeeded:  $casefile"
+-      exit 1
+-    }
+-    $quiet || echo "Compilation failed as expected"
+-    $quiet || head ` $verbose || echo -3 ` < "$casefile".errlog
+-    rm "$casefile".errlog
+-  done
+-}
+-
+-main "$@"
+diff --git a/test/tools/javac/quid/QuotedIdent.java b/test/tools/javac/quid/QuotedIdent.java
+--- a/test/tools/javac/quid/QuotedIdent.java
++++ b/test/tools/javac/quid/QuotedIdent.java
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2008, 2010, 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
+@@ -31,6 +31,7 @@
+  *      (The filename, directory name, or volume label syntax is incorrect)
+  *
+  * @library ..
++ * @compile -source 7 -target 7 -XDinvokedynamic QuotedIdent.java
+  * @run main quid.QuotedIdent
+  */
+ 
+@@ -119,7 +120,7 @@
+         s = #"int".class.getName();
+         check(31, s, QuotedIdent.class.getName()+"$int");
+ 
+-        Class x86 = Class.forName(QuotedIdent.class.getName()+"$*86");
++        Class<?> x86 = Class.forName(QuotedIdent.class.getName()+"$*86");
+         if (x86 != #"*86".class)
+             check(32, "reflected "+x86, "static "+#"*86".class);
+ 
+diff --git a/test/tools/javac/quid/QuotedIdent2.java b/test/tools/javac/quid/QuotedIdent2.java
+--- a/test/tools/javac/quid/QuotedIdent2.java
++++ b/test/tools/javac/quid/QuotedIdent2.java
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2008, 2010, 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
+@@ -31,6 +31,7 @@
+  *      (The filename, directory name, or volume label syntax is incorrect)
+  *
+  * @library ..
++ * @compile -source 7 -target 7 -XDinvokedynamic QuotedIdent.java
+  * @run main quid.QuotedIdent2
+  */
+ /*
+@@ -72,7 +73,7 @@
+         s = QuotedIdent.#"int".class.getName();
+         check(31, s, QuotedIdent.class.getName()+"$int");
+ 
+-        Class x86 = Class.forName(QuotedIdent.class.getName()+"$*86");
++        Class<?> x86 = Class.forName(QuotedIdent.class.getName()+"$*86");
+         if (x86 != #"*86".class)
+             check(32, "reflected "+x86, "static "+#"*86".class);
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/meth-edrfix-mlvm-only.patch	Tue Sep 07 17:04:30 2010 -0700
@@ -0,0 +1,56 @@
+For mlvm repository only:  javac -XDallowTransitionalJSR292=only accepts only the syntax mh.<T>invokeExact().
+This helps check invocations which have changed from my.<T>invokeExact() to (T) my.<T>invokeExact().
+Then, when builds can access the mode -XDallowTransitionalJSR292=no, we change to (T) my.invokeExact().
+This fancy dance seems necessary in order to let the javac tool be released asynchronously to the JDK code.
+
+diff --git a/src/share/classes/com/sun/tools/javac/comp/Attr.java b/src/share/classes/com/sun/tools/javac/comp/Attr.java
+--- a/src/share/classes/com/sun/tools/javac/comp/Attr.java
++++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java
+@@ -2160,6 +2160,8 @@
+                     else
+                         sym = (MethodSymbol)methsel.sym;
+                     MethodType oldType = sym.type.asMethodType();
++                    if (rs.requireTransitionalJSR292 && returnType.tsym != oldType.getReturnType().tsym)
++                        log.error(expr.pos(), "suspicious.cast.on.method.handle", returnType);
+                     Symbol newSym = rs.findPolymorphicSignatureInstance(sym.owner.type, sym.name, sym,
+                                                                         returnType,
+                                                                         oldType.argtypes);
+diff --git a/src/share/classes/com/sun/tools/javac/comp/Resolve.java b/src/share/classes/com/sun/tools/javac/comp/Resolve.java
+--- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java
++++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java
+@@ -70,6 +70,7 @@
+     public final boolean recognizeMethodHandles;
+     public final boolean recognizeInvokeDynamic;
+     public final boolean allowTransitionalJSR292;
++    public final boolean requireTransitionalJSR292;  // mlvm only: do not commit this line to OpenJDK
+     private final boolean debugResolve;
+ 
+     public static Resolve instance(Context context) {
+@@ -108,6 +109,7 @@
+         Options options = Options.instance(context);
+         debugResolve = options.get("debugresolve") != null;
+         allowTransitionalJSR292 = options.get("allowTransitionalJSR292") != null;
++        requireTransitionalJSR292 = "only".equals(options.get("allowTransitionalJSR292"));  // mlvm only: do not commit this line to OpenJDK
+         Target target = Target.instance(context);
+         recognizeMethodHandles = allowTransitionalJSR292 || target.hasMethodHandles();
+         recognizeInvokeDynamic = allowTransitionalJSR292 || target.hasInvokedynamic() && options.get("invokedynamic") != null;
+@@ -1004,6 +1006,7 @@
+      */
+     Type initialPolymorphicSignatureResultType(Env<AttrContext> env, List<Type> typeargtypes) {
+         if (!typeargtypes.isEmpty()) {
++            if (requireTransitionalJSR292)  return typeargtypes.head;  // mlvm only; skip warning
+             log.warning(env.tree.pos, "type.parameter.on.polymorphic.signature");
+             if (allowTransitionalJSR292) {
+                 return typeargtypes.head;
+diff --git a/src/share/classes/com/sun/tools/javac/resources/compiler.properties b/src/share/classes/com/sun/tools/javac/resources/compiler.properties
+--- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties
++++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties
+@@ -132,6 +132,8 @@
+     MethodHandle invocations require -target 7 runtimes or better
+ compiler.warn.wrong.target.for.polymorphic.signature.definition=\
+     MethodHandle API building requires -target 7 runtimes or better; current is -target {0}
++compiler.err.suspicious.cast.on.method.handle=\
++    on method handle invocation, suspicious cast to {0}
+ 
+ compiler.err.invokedynamic.must.have.bootstrap.method=\
+     InvokeDynamic calls must be in scope of a @BootstrapMethod annotation
--- a/series	Thu Aug 26 15:35:54 2010 -0700
+++ b/series	Tue Sep 07 17:04:30 2010 -0700
@@ -5,12 +5,13 @@
 dump-stack-on-error.patch       #+dump-stack-on-error
 
 # pushed to jdk7/hotspot-comp; will be deleted when they get to bsd-port:
+meth-cast-6979683.patch         #-/meth #+d3564f381c7c
+meth-edrfix-6979327.patch       #-/meth #+d3564f381c7c
 
 # non-pushed files are under review or development, or merely experimental:
 meth.patch                      #-/meth #+d3564f381c7c
-meth-cast-6979683.patch         #-/meth #+d3564f381c7c
-meth-edrfix-6979327.patch       #-/meth #+d3564f381c7c
 indy-bsm-6964498.patch          #-/meth #+d3564f381c7c
+meth-edrfix-mlvm-only.patch     #-/meth #+d3564f381c7c
 meth-ldc-6939203.patch          #-/meth #+d3564f381c7c #-/experimental #-testable
 meth-ver-6949040.patch          #-/meth #+d3564f381c7c #-testable
 meth-anno.patch                 #-/meth #+d3564f381c7c #-/experimental #-testable