java-topology/test/langtools/tools/javac/varargs/6313164/T6313164.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

26 lines
836 B
Java

/*
* @test /nodynamiccopyright/
* @bug 6313164 8036953
* @author mcimadamore
* @summary javac generates code that fails byte code verification for the varargs feature
*
* @compile/fail/ref=T6313164Source8AndHigher.out -XDrawDiagnostics T6313164.java
*/
import p1.*;
class T6313164 {
{
B b = new B();
b.foo1(new B(), new B()); //error - A not accessible
/* 7 : ok - A not accessible, but foo2(Object...) applicable
* 8+ : error - A not accessible
*/
b.foo2(new B(), new B());
b.foo3(null, null); //error - A (inferred) not accessible
b.foo4(null, null); //error - A not accesible
/* 7 : ok - A not accessible, but foo4(Object...) applicable
* 8+ : error - A not accessible
*/
b.foo4(new B(), new C());
}
}