From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6722 invoked by alias); 22 Apr 2004 14:00:24 -0000 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org Received: (qmail 6703 invoked by uid 48); 22 Apr 2004 14:00:23 -0000 Date: Thu, 22 Apr 2004 14:00:00 -0000 From: "rmathew at gcc dot gnu dot org" To: java-prs@gcc.gnu.org Message-ID: <20040422140018.15073.rmathew@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug java/15073] New: Illegal access to package-private class is allowed X-Bugzilla-Reason: CC X-SW-Source: 2004-q2/txt/msg00035.txt.bz2 List-Id: 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