langtools/test/tools/javac/meth/VarargsWarn.java
author hannesw
Tue, 22 Mar 2016 14:23:16 +0100
changeset 36690 06b714373aa4
parent 18917 33c954cf3825
permissions -rw-r--r--
8151810: for-in iteration does not provide per-iteration scope Reviewed-by: attila, lagergren
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18917
33c954cf3825 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
mcimadamore
parents:
diff changeset
     1
/*
33c954cf3825 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
mcimadamore
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
33c954cf3825 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
mcimadamore
parents:
diff changeset
     3
 * @bug 8019340
33c954cf3825 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
mcimadamore
parents:
diff changeset
     4
 * @summary varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
33c954cf3825 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
mcimadamore
parents:
diff changeset
     5
 *
33c954cf3825 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
mcimadamore
parents:
diff changeset
     6
 * @compile/fail/ref=VarargsWarn.out -XDrawDiagnostics -Werror VarargsWarn.java
33c954cf3825 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
mcimadamore
parents:
diff changeset
     7
 */
33c954cf3825 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
mcimadamore
parents:
diff changeset
     8
33c954cf3825 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
mcimadamore
parents:
diff changeset
     9
import java.lang.invoke.*;
33c954cf3825 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
mcimadamore
parents:
diff changeset
    10
33c954cf3825 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
mcimadamore
parents:
diff changeset
    11
class VarargsWarn {
33c954cf3825 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
mcimadamore
parents:
diff changeset
    12
    void test(MethodHandle mh) throws Throwable {
33c954cf3825 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
mcimadamore
parents:
diff changeset
    13
        mh.invokeExact((Integer[])null);
33c954cf3825 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
mcimadamore
parents:
diff changeset
    14
        mh.invoke((Integer[])null);
33c954cf3825 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
mcimadamore
parents:
diff changeset
    15
        mh.invokeWithArguments((Integer[])null); //not a sig poly method - warning here!
33c954cf3825 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
mcimadamore
parents:
diff changeset
    16
    }
33c954cf3825 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
mcimadamore
parents:
diff changeset
    17
}