-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
5.0
-
generic
-
generic
This is a javac bug. A type variable should not "inherit" any private members. This follows from 4.4 and 4.9.
-Neal
On 1/11/07, ... wrote:
Section 4.4 describes the members of type variables and the access to
them, including an example on page 50. Based on that description, I
would expect an access error on the reference to E.i, but this is
accepted by javac.
Did I overlook something in the JLS? If not, is this a JLS error or
a javac bug?
class X<E extends X<E>> {
private static int i;
int f() {
return E.i;
}
}
-Neal
On 1/11/07, ... wrote:
Section 4.4 describes the members of type variables and the access to
them, including an example on page 50. Based on that description, I
would expect an access error on the reference to E.i, but this is
accepted by javac.
Did I overlook something in the JLS? If not, is this a JLS error or
a javac bug?
class X<E extends X<E>> {
private static int i;
int f() {
return E.i;
}
}
- relates to
-
JDK-6904536 Generics support broken in Java 7-b40
- Closed
-
JDK-6711619 javac doesn't allow access to protected members in intersection types
- Closed