java-topology/test/langtools/tools/javac/T5003235/T5003235a.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
553 B
Java

/*
* @test /nodynamiccopyright/
* @bug 5003235
* @summary Private inner class accessible from subclasses
* @author Peter von der Ahé
* @compile/fail/ref=T5003235a.out -XDrawDiagnostics T5003235a.java
*/
class Super {
Inner i;
private class Inner {
void defaultM() {}
protected void protectedM() {}
public void publicM() {}
private void privateM() {}
}
}
class Sub extends Super {
void foo() {
i.defaultM();
i.protectedM();
i.publicM();
i.privateM();
}
}