public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* java/1261: "protected" field access not restricted between packages
@ 2000-12-20 12:23 bryce
0 siblings, 0 replies; only message in thread
From: bryce @ 2000-12-20 12:23 UTC (permalink / raw)
To: java-gnats
>Number: 1261
>Category: java
>Synopsis: "protected" field access not restricted between packages
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: apbianco
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 20 12:18:25 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Bryce McKinlay
>Release: unknown-1.0
>Organization:
>Environment:
gcc version 2.96 20000525 (experimental)
>Description:
A "protected" field in anything other than "this" should
not be accessible to a class outside the current instance,
if it is declared in another package (even if the current
class is a subclass of the declaring class)
gcj incorrectly permits the following code:
// file: pkg1/A.java
package pkg1;
public class A
{
protected int i;
}
// file: pkg2/B.java
package pkg2;
public class B extends pkg1.A
{
public B(pkg1.A a)
{
int i = a.i;
}
}
Note that this code is still incorrectly accepted even if
the "extends pkg1.A" is removed.
>How-To-Repeat:
Compile the above test case.
>Fix:
>Release-Note:
>Audit-Trail:
Formerly PR gcj/243
>Unformatted:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-12-20 12:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-20 12:23 java/1261: "protected" field access not restricted between packages bryce
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).