From mboxrd@z Thu Jan 1 00:00:00 1970 From: sdlee@csis.hku.hk To: gcc-gnats@gcc.gnu.org Subject: java/2424: gjc thinks a final variable is reassigned when it is not Date: Thu, 29 Mar 2001 19:45:00 -0000 Message-id: <20010330031243.12058.qmail@sourceware.cygnus.com> X-SW-Source: 2001-03/msg00346.html List-Id: >Number: 2424 >Category: java >Synopsis: gjc thinks a final variable is reassigned when it is not >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Thu Mar 29 19:36:04 PST 2001 >Closed-Date: >Last-Modified: >Originator: sdlee@csis.hku.hk >Release: gcc-20010320 snapshot >Organization: >Environment: bash$ gcj -dumpversion 3.0 bash$ gcj -dumpmachine i686-pc-linux-gnu >Description: When a final variable is assigned (in a constructor) via different execution paths, gcj thinks it is being reassigned. This behaviour is different from javac and jikes. >How-To-Repeat: public class A { public static void main(String[] a) { new A(0).go(); new A(1).go(); } private final boolean b; private A(int i) { if (i==0) b = false; else b = true; } private void go() { System.out.println("Hello " + b); } } >Fix: >Release-Note: >Audit-Trail: >Unformatted: