langtools/test/tools/javac/meth/VarargsWarn.java
author sogoel
Fri, 29 Aug 2014 00:42:42 -0700
changeset 26274 02a5b23ee21c
parent 18917 33c954cf3825
permissions -rw-r--r--
8055074: Group 9a: golden files for tests in tools/javac dir Reviewed-by: jjg
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
}