Hi,
recently, we have recieved a report about an incorrectly compiled class (http://netbeans.org/bugzilla/show_bug.cgi?id=187452). Consider the following code:
---------------------------------------------------------
public class p1 {
public static void resolve() {
class b {
int x = 1;
}
class c extends b {}
System.out.println(new c().x);
}
static class b {}
}
---------------------------------------------------------
Using a recent JDK7 javac, there is a compilation error that "x" cannot be resolved on the line with "new c().x". This compilation error does not seem correct to me. JDK6 javac accepts that code. I tried to find out the cause, and it seems that this was introduced by a fix for bug 5060485.