java-topology/test/langtools/tools/javac/nested/5009484/X.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

29 lines
695 B
Java

/*
* @test /nodynamiccopyright/
* @bug 5009484
* @summary Compiler fails to resolve appropriate type for outer member
* @author Philippe P Mulet
* @compile/fail/ref=X.out -XDrawDiagnostics X.java
*/
public class X<T> {
private T t;
X(T t) {
this.t = t;
}
public static void meth() {
new X<String>("OUTER").bar();
}
void bar() {
new X<X>(this) { // #1
void run() {
new Object() { // #2
void run() {
X x = t; // #3 <--- which t is bound ?
System.out.println(x);
}
}.run();
}
}.run();
}
}