From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1426 invoked by alias); 9 Mar 2005 18:22:21 -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 1368 invoked by uid 48); 9 Mar 2005 18:22:20 -0000 Date: Wed, 09 Mar 2005 18:57:00 -0000 Message-ID: <20050309182220.1365.qmail@sourceware.org> From: "mckinlay at redhat dot com" To: java-prs@gcc.gnu.org In-Reply-To: <20050210002019.19870.mark@gcc.gnu.org> References: <20050210002019.19870.mark@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug java/19870] gcj -C doesn't generate accessors for private members in inner class X-Bugzilla-Reason: CC X-SW-Source: 2005-q1/txt/msg00675.txt.bz2 List-Id: ------- Additional Comments From mckinlay at redhat dot com 2005-03-09 18:22 ------- gcj is generating code which references private members across class boundaries, which isn't legal at the class/VM level. To fix this, we need to generate package-private accessor methods when a private member is referenced from an enclosed or enclosing class. eg: jikes generates: Method name:"main" public static Signature: (java.lang.String[])void Attribute "Code", length:38, max_stack:2, max_locals:1, code_length:10 0: getstatic 3: invokestatic 6: invokevirtual 9: return Attribute "LineNumberTable", length:10, count: 2 line: 10 at pc: 0 line: 11 at pc: 9 Method name:"access$0" static Signature: ()int Attribute "Synthetic", length:0 Attribute "Code", length:28, max_stack:1, max_locals:0, code_length:4 0: getstatic 3: ireturn Attribute "LineNumberTable", length:6, count: 1 line: 3 at pc: 0 -- What |Removed |Added ---------------------------------------------------------------------------- Summary|gcj -C compiled code |gcj -C doesn't generate |accessing private fields of |accessors for private |inner classes from outer |members in inner class |class give | |IllegalAccessError | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19870