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

27 lines
460 B
Java

/*
* @test /nodynamiccopyright/
* @bug 5017254
* @summary compiler fails to shadow inapplicable method with static import
* @author gafter
*
* @compile/fail/ref=Shadow.out -XDrawDiagnostics Shadow.java
*/
package shadow;
import static shadow.T1.*;
import static shadow.T2.m1;
class T1 {
public static void m1() {}
}
class T2 {
public static void m1(int i) {}
}
class Test {
void foo() {
m1(); // <-- is this an error?
}
}