java-topology/test/langtools/tools/javac/defaultMethods/static/Static02.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

19 lines
449 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8005166
* @summary Add support for static interface methods
* smoke test for static interface methods
* @compile/fail/ref=Static02.out -XDrawDiagnostics -XDallowStaticInterfaceMethods Static02.java
*/
class Static02 {
interface I {
public static void test() { }
}
public static void meth() {
I.test(); //ok
I i = new I() {};
i.test(); //no!
}
}