public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* java/10334: Runtime error when trying to access an initialized static member.
@ 2003-04-07 11:56 marcel.offermans
0 siblings, 0 replies; only message in thread
From: marcel.offermans @ 2003-04-07 11:56 UTC (permalink / raw)
To: gcc-gnats
>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:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-04-07 11:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-07 11:56 java/10334: Runtime error when trying to access an initialized static member marcel.offermans
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).