java-topology/test/langtools/tools/javac/meth/VarargsWarn.java
russell@unturf.com 0a580b313d undefect. CWE-407 — 63 sites patched across 27 ecosystems
Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com

Patches, unit tests, benchmarks, whitepaper, and outreach briefs.
Public domain — no copyright claimed. Use freely.
2026-03-26 17:11:57 -04:00

17 lines
528 B
Java

/*
* @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!
}
}