public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: marcel.offermans@luminis.nl
To: gcc-gnats@gcc.gnu.org
Subject: java/10334: Runtime error when trying to access an initialized static member.
Date: Mon, 07 Apr 2003 11:56:00 -0000	[thread overview]
Message-ID: <20030407115518.22538.qmail@sources.redhat.com> (raw)


>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:


                 reply	other threads:[~2003-04-07 11:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030407115518.22538.qmail@sources.redhat.com \
    --to=marcel.offermans@luminis.nl \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).