langtools/test/tools/javac/meth/VarargsWarn.java
author sogoel
Thu, 05 Jun 2014 10:57:10 -0700
changeset 24797 850ebd4d80a7
parent 18917 33c954cf3825
permissions -rw-r--r--
8044072: Group 2: create .out files for OverrideChecks tests in tools/javac dir Reviewed-by: jjg

/*
 * @test /nodynamiccopyright/
 * @bug 8019340
 * @summary varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
 *
 * @compile/fail/ref=VarargsWarn.out -XDrawDiagnostics -Werror VarargsWarn.java
 */

import java.lang.invoke.*;

class VarargsWarn {
    void test(MethodHandle mh) throws Throwable {
        mh.invokeExact((Integer[])null);
        mh.invoke((Integer[])null);
        mh.invokeWithArguments((Integer[])null); //not a sig poly method - warning here!
    }
}