Date: Thu, 27 May 1999 11:02:28 +0100
From: Roly Perera <###@###.###>
To: William Maddox <###@###.###>
Subject: RE: JSL 6.6.2 not implemented
The problem only occurs accessing a static protected field via a type qualifier. According to JLS 6.6.2, both uses of
"i" in class B are illegal, but javac-ea only rejects the second use (access of a static protected field via an
expression qualifier).
After reading some of the javac bug reports relating to this it appears there has been some discussion about relaxing
the 6.6.2 rules specifically for static fields, but either way there appears to be an inconsistency here.
- Roly
package othello;
public class F
{
protected static int i;
}
package desdemona;
import othello.F;
class B extends F
{
{
F.i = 5; // OK
new F().i = 5; // complains
}
}
From: Roly Perera <###@###.###>
To: William Maddox <###@###.###>
Subject: RE: JSL 6.6.2 not implemented
The problem only occurs accessing a static protected field via a type qualifier. According to JLS 6.6.2, both uses of
"i" in class B are illegal, but javac-ea only rejects the second use (access of a static protected field via an
expression qualifier).
After reading some of the javac bug reports relating to this it appears there has been some discussion about relaxing
the 6.6.2 rules specifically for static fields, but either way there appears to be an inconsistency here.
- Roly
package othello;
public class F
{
protected static int i;
}
package desdemona;
import othello.F;
class B extends F
{
{
F.i = 5; // OK
new F().i = 5; // complains
}
}
- duplicates
-
JDK-4033907 protected access not implemented correctly for static protected fields/methods
- Closed