From owner-freebsd-java Fri Mar 23 11:49:27 2001 Delivered-To: freebsd-java@freebsd.org Received: from fritz.cc.gt.atl.ga.us (fritz.cc.gt.atl.ga.us [199.77.128.120]) by hub.freebsd.org (Postfix) with ESMTP id B160237B71B for ; Fri, 23 Mar 2001 11:49:23 -0800 (PST) (envelope-from dagon@fritz.cc.gt.atl.ga.us) Received: (from dagon@localhost) by fritz.cc.gt.atl.ga.us (8.9.3/8.9.3) id PAA50156; Fri, 23 Mar 2001 15:15:56 -0500 (EST) (envelope-from dagon) Date: Fri, 23 Mar 2001 15:15:56 -0500 From: David Dagon To: "Thomas T. Veldhouse" Cc: Todd Enersen , freebsd-java@FreeBSD.ORG Subject: Re: possible bug in port of javac Message-ID: <20010323151555.B49813@fritz.cc.gt.atl.ga.us> References: <3ABA5AC3.CA8F09DD@fireclick.com> <005d01c0b341$5cedac20$1d750140@cascade> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i In-Reply-To: <005d01c0b341$5cedac20$1d750140@cascade>; from veldy@veldy.net on Thu, Mar 22, 2001 at 08:31:27PM -0600 X-Echelon: RSA Crypto C4 Mossad CIA BXA Export Control Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Thu, Mar 22, 2001 at 08:31:27PM -0600, Thomas T. Veldhouse wrote: > When you declare something final, aren't you supposed to supply an > initializer? Java requires a value at the declaration. For so-called "blank final" variables, JLS s. 4.5.4, assignment comes in the instance call--the constructor. In the old days, JDK 1.1 had a bug where you could later change a final value. (This was fixed for Java2 generation compilers, IIRC, and was probably patched to JDK 1.1 generation compilers as well.) Since the observed behavior seems to interact with constructors, a small piece of demonstration code would be useful. > I believe this is analgous to const int m_maxValuesPerName = 10 in C++. I think so. Of course, differences arise when using references and not primitives. (Java acts as if every field in a const object reference were declared 'mutable', while C++ is the opposite, and requires const object fields to be declared mutable.) Anyone have a demonstration snippet involving constructor assignment of a blank final variable? -- David Dagon /"\ "When cryptography dagon@cc.gatech.edu \ / ASCII RIBBON CAMPAIGN is outlawed, bayl Collage(sic) o' Computing X AGAINST HTML MAIL bhgynjf jvyy unir Georgia Inst. o' Tech. / \ cevinpl." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message