java-topology/test/langtools/tools/javac/T8171325/NPEClearingLocalClassNameIndexesTest.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

21 lines
658 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8171325
* @summary NPE in Check.clearLocalClassNameIndexes
* @compile/fail/ref=NPEClearingLocalClassNameIndexesTest.out -XDrawDiagnostics NPEClearingLocalClassNameIndexesTest.java
*/
import java.util.List;
import java.util.function.Function;
import java.util.function.Supplier;
public class NPEClearingLocalClassNameIndexesTest {
<A> void f(List<A> t) {}
<B, C> C g(C u, Function<B, C> v) { return null; }
<D> D g(Supplier<D> w) { return null; }
public void test() {
f(g((String) null, task -> g(new NoSuch() {})));
f(g((String) null, task -> g(new NoSuch<int>() {})));
}
}