-
Bug
-
Resolution: Fixed
-
P2
-
1.1, 1.1.1, 1.1.4
-
1.2beta
-
generic, sparc
-
generic, solaris_2.5.1
-
Not verified
/* A block scoped class isn't seen by a reference from a
* nested block. The example below doesn't compile unless
* the braces marked "XXX" are removed.
mushmouth% javac BlockScopedClassBug1.java
BlockScopedClassBug1.java:9: Class bar not found in type declaration.
return new bar().getX();
^
1 error
*/
public class BlockScopedClassBug1
{
protected int foo(final int x)
{
final class bar { int getX() {return x;} }
{ // XXX
return new bar().getX();
} // XXX
}
}
- duplicates
-
JDK-4058859 inner classes not seen in nested blocks
- Closed
-
JDK-4094628 Instantiation of local, inner class fails because of scoping problem.
- Closed