-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.1.1
-
sparc
-
solaris_2.5.1
It is a compiler bug rejecting a correct program.
Block-local classes are not getting looked up properly
from within deeply nested scopes.
icho@villa127: cat T1.java
public class T1 {
T1() {
class T2 {
T2() {
class T3 {};
T3 t = new T3();
}
}
}
}
icho@villa126: javac T1.java
T1.java:6: Class T1. 1$T3 not found in type declaration.
T3 t = new T3();
^
T1.java:6: Class T1. 1$T3 not found in type declaration.
T3 t = new T3();
^
2 errors
------------------------
While the following program compiles;
public class T1 {
T1() {
class T2 {
class T3 {};
T2() {
T3 t = new T3();
}
}
}
}
Block-local classes are not getting looked up properly
from within deeply nested scopes.
icho@villa127: cat T1.java
public class T1 {
T1() {
class T2 {
T2() {
class T3 {};
T3 t = new T3();
}
}
}
}
icho@villa126: javac T1.java
T1.java:6: Class T1. 1$T3 not found in type declaration.
T3 t = new T3();
^
T1.java:6: Class T1. 1$T3 not found in type declaration.
T3 t = new T3();
^
2 errors
------------------------
While the following program compiles;
public class T1 {
T1() {
class T2 {
class T3 {};
T2() {
T3 t = new T3();
}
}
}
}
- duplicates
-
JDK-4052966 Block-local classes are not found in nested scopes
- Closed
- relates to
-
JDK-4034664 Innerclasses can access private fields of enclosing instance, but not private me
- Closed
-
JDK-4035182 Innerclass access to enclosing class private member inconsistency
- Closed