public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/15073] Illegal access to package-private class is allowed
  2004-04-22 14:00 [Bug java/15073] New: Illegal access to package-private class is allowed rmathew at gcc dot gnu dot org
@ 2004-04-22 14:00 ` rmathew at gcc dot gnu dot org
  2004-04-27  9:04 ` rmathew at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rmathew at gcc dot gnu dot org @ 2004-04-22 14:00 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-04-22 14:00:58
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15073


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug java/15073] New: Illegal access to package-private class is allowed
@ 2004-04-22 14:00 rmathew at gcc dot gnu dot org
  2004-04-22 14:00 ` [Bug java/15073] " rmathew at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rmathew at gcc dot gnu dot org @ 2004-04-22 14:00 UTC (permalink / raw)
  To: java-prs

GCJ silently compiles an illegal access to a package-private
class in another package.

Here's the testcase:

------------------ Snafu.java -------------------------------
public class Snafu {
  public static void main( String[] args) {
    foo.Bar.hello( );
  }
}
-------------------------------------------------------------

------------------ foo/Bar.java -----------------------------
package foo;

class Bar {
  public static void hello( ) { System.out.println( "Hello!"); }
}
-------------------------------------------------------------


Here's what JDK 1.4.2.03 on Linux says for this:
-------------------------------------------------------------
Snafu.java:3: foo.Bar is not public in foo; cannot be accessed from outside pack
age
    foo.Bar.hello( );
       ^
Snafu.java:3: hello() in foo.Bar is not defined in a public class or interface;
cannot be accessed from outside package
    foo.Bar.hello( );
           ^
2 errors
-------------------------------------------------------------

-- 
           Summary: Illegal access to package-private class is allowed
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rmathew at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15073


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug java/15073] Illegal access to package-private class is allowed
  2004-04-22 14:00 [Bug java/15073] New: Illegal access to package-private class is allowed rmathew at gcc dot gnu dot org
  2004-04-22 14:00 ` [Bug java/15073] " rmathew at gcc dot gnu dot org
@ 2004-04-27  9:04 ` rmathew at gcc dot gnu dot org
  2004-05-06 17:43 ` cvs-commit at gcc dot gnu dot org
  2004-05-06 17:57 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: rmathew at gcc dot gnu dot org @ 2004-04-27  9:04 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From rmathew at gcc dot gnu dot org  2004-04-27 09:04 -------
Patch awaiting review:
  http://gcc.gnu.org/ml/java-patches/2004-q2/msg00230.html

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15073


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug java/15073] Illegal access to package-private class is allowed
  2004-04-22 14:00 [Bug java/15073] New: Illegal access to package-private class is allowed rmathew at gcc dot gnu dot org
  2004-04-22 14:00 ` [Bug java/15073] " rmathew at gcc dot gnu dot org
  2004-04-27  9:04 ` rmathew at gcc dot gnu dot org
@ 2004-05-06 17:43 ` cvs-commit at gcc dot gnu dot org
  2004-05-06 17:57 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-05-06 17:43 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-05-06 17:43 -------
Subject: Bug 15073

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rmathew@gcc.gnu.org	2004-05-06 17:43:48

Modified files:
	gcc/java       : ChangeLog parse.y 

Log message:
	Fixes PR java/9685, PR java/15073
	* parse.y (accessibility_string): New method.
	(not_accessible_field_error): Use accessibility_string()
	instead of java_accstring_lookup().
	(resolve_qualified_expression_name): Check with
	check_pkg_class_access() before allowing access using
	qualified names.
	Fix comment typo.
	Use check_pkg_class_access() instead of not_accessible_p()
	for unqualified types.
	(not_accessible_p): Use DECL_CONTEXT (member) instead of
	REFERENCE for package-private access checking.
	(patch_method_invocation): Use accessibility_string() instead
	of java_accstring_lookup().

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1359&r2=1.1360
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.y.diff?cvsroot=gcc&r1=1.475&r2=1.476



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15073


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug java/15073] Illegal access to package-private class is allowed
  2004-04-22 14:00 [Bug java/15073] New: Illegal access to package-private class is allowed rmathew at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-05-06 17:43 ` cvs-commit at gcc dot gnu dot org
@ 2004-05-06 17:57 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-06 17:57 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-06 17:57 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15073


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-05-06 17:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-22 14:00 [Bug java/15073] New: Illegal access to package-private class is allowed rmathew at gcc dot gnu dot org
2004-04-22 14:00 ` [Bug java/15073] " rmathew at gcc dot gnu dot org
2004-04-27  9:04 ` rmathew at gcc dot gnu dot org
2004-05-06 17:43 ` cvs-commit at gcc dot gnu dot org
2004-05-06 17:57 ` pinskia at gcc dot gnu dot org

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).