From owner-freebsd-java Thu Mar 22 12:26:32 2001 Delivered-To: freebsd-java@freebsd.org Received: from exch01.projectseneca.com (w186.z208036141.was-dc.dsl.cnc.net [208.36.141.186]) by hub.freebsd.org (Postfix) with ESMTP id 4AE9737B71B for ; Thu, 22 Mar 2001 12:26:29 -0800 (PST) (envelope-from brian@parabon.com) Received: from parabon.com (limestone.projectseneca.com [192.168.0.105]) by exch01.projectseneca.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id G4CCTNWH; Thu, 22 Mar 2001 15:26:26 -0500 Message-ID: <3ABA5FF3.2E2063AF@parabon.com> Date: Thu, 22 Mar 2001 15:26:28 -0500 From: "Brian J. Sletten" Organization: Parabon Computation, Inc. X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: Todd Enersen Cc: freebsd-java@freebsd.org Subject: Re: possible bug in port of javac References: <3ABA5AC3.CA8F09DD@fireclick.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > I'm trying to port one of our software packages to the FreeBSD platform. It currently works > on Win32, Solaris and Linux, and we have customer who'd like to see it run on FreeBSD. Are you using the same version of the JDK on every platform? I'm using the Linux version of JDK1.3 under FreeBSD and it complains the same way. I'd say it is more likely to do with some versions of Java allowing it and some not, rather than something FreeBSD-specific. > > Blank final variable 'm_maxValuesPerName' may not have been initialized. It must be > > assigned a value in an initializer, or in every constructor. > Even though the constructor assigns a value to the final variable. > > I've tried adding a default constructor but that didn't fix the problem. I assume you mean "I've tried adding a default constructor and assigned the value in it". I did the same thing and the aforementioned error went away. > The only solution so far has been to remove the "final" keyword from the declaration. I'm assuming that you are trying to assign this value from a property or something. Do you need it as a final instance variable? If the same value is going to be valid for every class, try something like: public class A { private static final int m_maxValuesPerName; static { m_maxValuesPerName = Integer.getInteger( "foo.maxValuesPerName", 5 ).intValue(); } } Or even the more succinct: public class A { private static final int m_maxValuesPerName = Integer.getInteger( "foo.maxValuesPerName", 5 ).intValue(); } -- Where you stand depends on where you sit. -- Anonymous To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message