7010194: several langtools regression failures after JSR 292 changes (b123)

Wed, 05 Jan 2011 09:59:01 +0000

author
mcimadamore
date
Wed, 05 Jan 2011 09:59:01 +0000
changeset 810
15484cb7e5ae
parent 809
e63b1f8341ce
child 811
20fec1b88bc1
child 815
d17f37522154

7010194: several langtools regression failures after JSR 292 changes (b123)
Summary: Some regression tests rely on unsupported JSR 292 features
Reviewed-by: jjg

test/tools/javac/diags/examples/TypeParameterOnPolymorphicSignature.java file | annotate | diff | comparison | revisions
test/tools/javac/meth/InvokeDyn.java file | annotate | diff | comparison | revisions
test/tools/javac/meth/InvokeDynTrans.java file | annotate | diff | comparison | revisions
test/tools/javac/meth/XlintWarn.java file | annotate | diff | comparison | revisions
     1.1 --- a/test/tools/javac/diags/examples/TypeParameterOnPolymorphicSignature.java	Tue Jan 04 17:10:35 2011 -0800
     1.2 +++ b/test/tools/javac/diags/examples/TypeParameterOnPolymorphicSignature.java	Wed Jan 05 09:59:01 2011 +0000
     1.3 @@ -24,8 +24,10 @@
     1.4  // key: compiler.warn.type.parameter.on.polymorphic.signature
     1.5  // key: compiler.err.unreported.exception.need.to.catch.or.throw
     1.6  
     1.7 -import java.dyn.InvokeDynamic;
     1.8 +import java.dyn.MethodHandle;
     1.9  
    1.10  class TypeParameterOnPolymorphicSignature {
    1.11 -    { InvokeDynamic.<void>call("",123); }
    1.12 +    void test(MethodHandle mh) {
    1.13 +        mh.<void>invokeExact("",123);
    1.14 +    }
    1.15  }
     2.1 --- a/test/tools/javac/meth/InvokeDyn.java	Tue Jan 04 17:10:35 2011 -0800
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,64 +0,0 @@
     2.4 -/*
     2.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
     2.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.7 - *
     2.8 - * This code is free software; you can redistribute it and/or modify it
     2.9 - * under the terms of the GNU General Public License version 2 only, as
    2.10 - * published by the Free Software Foundation.
    2.11 - *
    2.12 - * This code is distributed in the hope that it will be useful, but WITHOUT
    2.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    2.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    2.15 - * version 2 for more details (a copy is included in the LICENSE file that
    2.16 - * accompanied this code).
    2.17 - *
    2.18 - * You should have received a copy of the GNU General Public License version
    2.19 - * 2 along with this work; if not, write to the Free Software Foundation,
    2.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    2.21 - *
    2.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    2.23 - * or visit www.oracle.com if you need additional information or have any
    2.24 - * questions.
    2.25 - */
    2.26 -
    2.27 -/*
    2.28 - * @test
    2.29 - * @bug 6754038 6979327
    2.30 - * @summary Generate call sites for method handle
    2.31 - * @author jrose
    2.32 - *
    2.33 - * @library ..
    2.34 - * @compile -source 7 -target 7 -XDinvokedynamic -XDallowTransitionalJSR292=no InvokeDyn.java
    2.35 - */
    2.36 -//No: @run main/othervm -XX:+EnableInvokeDynamic meth.InvokeDyn
    2.37 -
    2.38 -/*
    2.39 - * Standalone testing:
    2.40 - * <code>
    2.41 - * $ cd $MY_REPO_DIR/langtools
    2.42 - * $ (cd make; make)
    2.43 - * $ ./dist/bootstrap/bin/javac -d dist test/tools/javac/meth/InvokeDyn.java
    2.44 - * $ javap -c -classpath dist meth.InvokeDyn
    2.45 - * </code>
    2.46 - */
    2.47 -
    2.48 -package meth;
    2.49 -
    2.50 -import java.dyn.*;
    2.51 -
    2.52 -public class InvokeDyn {
    2.53 -    class CS extends CallSite {
    2.54 -        CS(Object x, Object y, Object z) { throw new RuntimeException(); }
    2.55 -    }
    2.56 -    //@BootstrapMethod(CS.class)  //note: requires 6964498
    2.57 -    void test() throws Throwable {
    2.58 -        Object x = "hello";
    2.59 -        Object ojunk; int ijunk;
    2.60 -        ojunk = InvokeDynamic.greet(x, "world", 123);
    2.61 -        ojunk = InvokeDynamic.greet(x, "mundus", 456);
    2.62 -        ojunk = InvokeDynamic.greet(x, "kosmos", 789);
    2.63 -        ojunk = (String) InvokeDynamic.cogitate(10.11121, 3.14);
    2.64 -        //InvokeDynamic.#"yow: what I mean to say is, please treat this one specially"(null);
    2.65 -        ijunk = (int) InvokeDynamic.invoke("goodbye");
    2.66 -    }
    2.67 -}
     3.1 --- a/test/tools/javac/meth/InvokeDynTrans.java	Tue Jan 04 17:10:35 2011 -0800
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,59 +0,0 @@
     3.4 -/*
     3.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
     3.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.7 - *
     3.8 - * This code is free software; you can redistribute it and/or modify it
     3.9 - * under the terms of the GNU General Public License version 2 only, as
    3.10 - * published by the Free Software Foundation.
    3.11 - *
    3.12 - * This code is distributed in the hope that it will be useful, but WITHOUT
    3.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    3.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    3.15 - * version 2 for more details (a copy is included in the LICENSE file that
    3.16 - * accompanied this code).
    3.17 - *
    3.18 - * You should have received a copy of the GNU General Public License version
    3.19 - * 2 along with this work; if not, write to the Free Software Foundation,
    3.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    3.21 - *
    3.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    3.23 - * or visit www.oracle.com if you need additional information or have any
    3.24 - * questions.
    3.25 - */
    3.26 -
    3.27 -/*
    3.28 - * @test
    3.29 - * @bug 6754038 6979327
    3.30 - * @summary Generate call sites for method handle
    3.31 - * @author jrose
    3.32 - *
    3.33 - * @library ..
    3.34 - * @compile/fail/ref=InvokeDynTrans.out -Werror -XDrawDiagnostics -source 7 -target 7 InvokeDynTrans.java
    3.35 - */
    3.36 -//No: @run main/othervm -XX:+EnableInvokeDynamic meth.InvokeDyn
    3.37 -
    3.38 -/*
    3.39 - * Standalone testing:
    3.40 - * <code>
    3.41 - * $ cd $MY_REPO_DIR/langtools
    3.42 - * $ (cd make; make)
    3.43 - * $ ./dist/bootstrap/bin/javac -d dist test/tools/javac/meth/InvokeDyn.java
    3.44 - * $ javap -c -classpath dist meth.InvokeDyn
    3.45 - * </code>
    3.46 - */
    3.47 -
    3.48 -package meth;
    3.49 -
    3.50 -import java.dyn.InvokeDynamic;
    3.51 -
    3.52 -public class InvokeDynTrans {
    3.53 -    void test() throws Throwable {
    3.54 -        Object x = "hello";
    3.55 -        InvokeDynamic.greet(x, "world", 123);
    3.56 -        InvokeDynamic.greet(x, "mundus", 456);
    3.57 -        InvokeDynamic.greet(x, "kosmos", 789);
    3.58 -        InvokeDynamic.<String>cogitate(10.11121, 3.14);
    3.59 -        //InvokeDynamic.<void>#"yow: what I mean to say is, please treat this one specially"(null);
    3.60 -        InvokeDynamic.<int>invoke("goodbye");
    3.61 -    }
    3.62 -}
     4.1 --- a/test/tools/javac/meth/XlintWarn.java	Tue Jan 04 17:10:35 2011 -0800
     4.2 +++ b/test/tools/javac/meth/XlintWarn.java	Wed Jan 05 09:59:01 2011 +0000
     4.3 @@ -23,7 +23,7 @@
     4.4  
     4.5  /*
     4.6   * @test
     4.7 - * @bug 6999067
     4.8 + * @bug 6999067 7010194
     4.9   * @summary cast for invokeExact call gets redundant cast to <type> warnings
    4.10   * @author mcimadamore
    4.11   *
    4.12 @@ -34,9 +34,7 @@
    4.13  
    4.14  class XlintWarn {
    4.15      void test(MethodHandle mh) throws Throwable {
    4.16 -        int i1 = (int)mh.invoke();
    4.17 -        int i2 = (int)mh.invokeExact();
    4.18 -        int i3 = (int)mh.invokeVarargs();
    4.19 -        int i4 = (int)InvokeDynamic.test();
    4.20 +        int i1 = (int)mh.invokeExact();
    4.21 +        int i2 = (int)mh.invokeVarargs();
    4.22      }
    4.23  }

mercurial