Name: skT88420 Date: 06/04/99
Run javac 1.2 on the following 2 files at once:
---- cut here for T.java ----
package a;
public class T {
protected T() {}
}
---- cut here for U.java ----
class U {
Object x = new a.T() { void foo(); };
}
---- end U.java ----
You will get no errors in spite of the fact that the T()
constructor is not accessible in class U. If you remove the
"{ void foo(); }" part, an error will be reported.
Some files in JDK 1.2 (javax/swing/plag/basic/BasicOptionPaneUI.java
and javax/swing/ImageIcon.java) should not typecheck correctly
but pass javac 1.2 anyways because of this bug.
(Review ID: 83958)
======================================================================
- duplicates
-
JDK-4320824 JLS 2e 6.6.2.2 check not performed for anonymous class instantiation
- Closed