From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22888 invoked by alias); 7 Apr 2003 11:56:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 22814 invoked by uid 71); 7 Apr 2003 11:56:01 -0000 Resent-Date: 7 Apr 2003 11:56:01 -0000 Resent-Message-ID: <20030407115601.22810.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, java-prs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, marcel.offermans@luminis.nl Received: (qmail 22539 invoked by uid 48); 7 Apr 2003 11:55:18 -0000 Message-Id: <20030407115518.22538.qmail@sources.redhat.com> Date: Mon, 07 Apr 2003 11:56:00 -0000 From: marcel.offermans@luminis.nl Reply-To: marcel.offermans@luminis.nl To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: java/10334: Runtime error when trying to access an initialized static member. X-SW-Source: 2003-04/txt/msg00250.txt.bz2 List-Id: >Number: 10334 >Category: java >Synopsis: Runtime error when trying to access an initialized static member. >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Mon Apr 07 11:56:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: marcel.offermans@luminis.nl >Release: gcc-3.2.2 >Organization: >Environment: RedHat Linux 7.3 >Description: Compile the class below like this: gcj --main=A A.java And it will give you a NPE when you run it. Uncomment the System.out.println statement which accesses B.a prior to assigning anything to B.a.a and everything works fine. public class A { public static void main(String[] args) { //System.out.println("" + B.a); B.a.a = "test"; } } class B { public static class C { public String a; } public static C a = new C(); } >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: