-
Bug
-
Resolution: Fixed
-
P3
-
7
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.
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.
- relates to
-
JDK-5060485 The scope of a class type parameter is too wide
- Closed
-
JDK-5070354 (diag) Add -Xlint:hiding option to javac
- Open