public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: sdlee@csis.hku.hk
To: gcc-gnats@gcc.gnu.org
Subject: java/2423: false reporting of "Final variable initialization error" in constructor
Date: Thu, 29 Mar 2001 19:45:00 -0000	[thread overview]
Message-ID: <20010330025807.5159.qmail@sourceware.cygnus.com> (raw)

>Number:         2423
>Category:       java
>Synopsis:       false reporting of "Final variable initialization error" in constructor
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 29 19:36:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     sdlee@csis.hku.hk
>Release:        gcc-20010320 snapshot
>Organization:
>Environment:
bash$ ~/y/bin/gcj -dumpmachine
i686-pc-linux-gnu
bash$ ~/y/bin/gcj -dumpversion
3.0
>Description:
Sun's javac (JDK version 1.3 for Linux/x86) and
IBM's jikes (Version 1.11, 10 Jan 2000)
both accept a constructor that contains
an execution path that does not initialize
all final variables, but exits by throwing an exception.
'gcj' does not accept it.  The behaviour is the same whether
the thrown exception is checked or unchecked (or is an Error
rather than an Exception).

Compiling such a class with jikes and javac and then
compiling the resulting .class file with gcj results
in a native binary executable that seems to work correctly,
though.
>How-To-Repeat:
public class A {
    public static void main(String[] a) {
	new A().go();
    }

    private final boolean b;

    private A() {
	//b = true; // without this line, GCJ chokes!
	throw new RuntimeException("Haha");
    }

    private void go() {
	System.out.println("Hello!");
    }
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2001-03-29 19:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-29 19:45 sdlee [this message]
2001-12-10 10:21 tromey
2001-12-10 10:26 tromey
2002-01-20 17:31 bryce

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=20010330025807.5159.qmail@sourceware.cygnus.com \
    --to=sdlee@csis.hku.hk \
    --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).