Name: laC46010 Date: 05/27/97
All compilers from JDK1.1 thru JDK1.1.2F fail to find an inner class, declared
within a method of another inner class.
In example "Test" below, JDK reports the following compile-time error:
Test.java:5: Class Test. 1$B not found in type declaration.
B b;
^
1 error
It seems the reason of the failure is that compiler transforms the name of
class B into "Test$1$B" rather than into "Test$A$1$B" as prescribed by the
"Inner Classes in Java 1.1" specification.
--------------------Test.java----------------------
public class Test {
class A {
void m() {
class B {}
B b;
}
}
}
---------------------------------------------------------
======================================================================
- duplicates
-
JDK-4052966 Block-local classes are not found in nested scopes
- Closed
- relates to
-
JDK-4059889 java.lang.NoClassDefFoundError (javac compilation error)
- Closed