Date: Thu, 22 Mar 2001 20:31:27 -0600 From: "Thomas T. Veldhouse" <veldy@veldy.net> To: "Todd Enersen" <tee@fireclick.com> Cc: <freebsd-java@freebsd.org> Subject: Re: possible bug in port of javac Message-ID: <005d01c0b341$5cedac20$1d750140@cascade> References: <3ABA5AC3.CA8F09DD@fireclick.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. ------=_NextPart_000_005A_01C0B30F.12363E40 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable When you declare something final, aren't you supposed to supply an = initializer? I believe this is analgous to const int m_maxValuesPerName = =3D 10 in C++. private final int m_maxValuesPerName =3D 10;=20 I believe this is analgous to const int m_maxValuesPerName =3D 10; in = C++. Tom Veldhouse veldy@veldy.net ----- Original Message -----=20 From: Todd Enersen=20 To: freebsd-java@freebsd.org=20 Sent: Thursday, March 22, 2001 2:04 PM Subject: possible bug in port of javac Hello,=20 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.=20 So, I've downloaded an built a version of the jdk from your = installation instructions. I believe that I have followed the = instructions to a "t". However the java compiler is choking on the = following code segment=20 private final int m_maxValuesPerName;=20 The compiler is complaining about:=20 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.=20 I've tried adding a default constructor but that didn't fix the = problem.=20 The only solution so far has been to remove the "final" keyword from = the declaration.=20 Have you heard of this issue? Is there a solution?=20 Todd Enersen=20 =20 =20 ------=_NextPart_000_005A_01C0B30F.12363E40 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>When you declare something final, = aren't you=20 supposed to supply an initializer? I believe this is analgous to const = int=20 m_maxValuesPerName =3D 10 in C++.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><STRONG>private final int m_maxValuesPerName =3D 10;</STRONG> = </DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>I believe this is analgous to = <STRONG>const int=20 m_maxValuesPerName =3D 10;</STRONG> in C++.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Tom Veldhouse</FONT></DIV> <DIV><FONT face=3DArial size=3D2><A=20 href=3D"mailto:veldy@veldy.net">veldy@veldy.net</A></FONT></DIV> <BLOCKQUOTE dir=3Dltr=20 style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; = BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV> <DIV=20 style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: = black"><B>From:</B>=20 <A title=3Dtee@fireclick.com href=3D"mailto:tee@fireclick.com">Todd = Enersen</A>=20 </DIV> <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A = title=3Dfreebsd-java@freebsd.org=20 href=3D"mailto:freebsd-java@freebsd.org">freebsd-java@freebsd.org</A> = </DIV> <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Thursday, March 22, 2001 = 2:04=20 PM</DIV> <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> possible bug in port = of=20 javac</DIV> <DIV><BR></DIV>Hello,=20 <P>I'm trying to port one of our software packages to the FreeBSD = platform. It=20 currently works on Win32, Solaris and Linux, and we have customer = who'd like=20 to see it run on FreeBSD.=20 <P>So, I've downloaded an built a version of the jdk from your = installation=20 instructions. I believe that I have followed the instructions to a = "t". =20 However the java compiler is choking on the following code segment=20 <P><B>private final int m_maxValuesPerName;</B>=20 <P>The compiler is complaining about:=20 <BLOCKQUOTE TYPE=3D"CITE"><PRE>Blank final variable = 'm_maxValuesPerName' may not have been initialized. It must be = assigned a value in an initializer, or in every = constructor.</PRE></BLOCKQUOTE> <P><BR>Even though the constructor assigns a value to the final = variable.=20 <P>I've tried adding a default constructor but that didn't fix the = problem.=20 <P>The only solution so far has been to remove the "final" keyword = from the=20 declaration.=20 <P>Have you heard of this issue? Is there a solution?=20 <P>Todd Enersen <BR> <BR> </P></BLOCKQUOTE></BODY></HTML> ------=_NextPart_000_005A_01C0B30F.12363E40-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?005d01c0b341$5cedac20$1d750140>