Skip site navigation (1)Skip section navigation (2)
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

[-- Attachment #1 --]
When you declare something final, aren't you supposed to supply an initializer? I believe this is analgous to const int m_maxValuesPerName = 10 in C++.

private final int m_maxValuesPerName = 10; 

I believe this is analgous to const int m_maxValuesPerName = 10; in C++.

Tom Veldhouse
veldy@veldy.net
  ----- Original Message ----- 
  From: Todd Enersen 
  To: freebsd-java@freebsd.org 
  Sent: Thursday, March 22, 2001 2:04 PM
  Subject: possible bug in port of javac


  Hello, 
  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. 

  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 

  private final int m_maxValuesPerName; 

  The compiler is complaining about: 

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. 

  The only solution so far has been to remove the "final" keyword from the declaration. 

  Have you heard of this issue?  Is there a solution? 

  Todd Enersen 
    
    


[-- Attachment #2 --]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4522.1800" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>When you declare something final, aren't you 
supposed to supply an initializer? I believe this is analgous to const int 
m_maxValuesPerName = 10 in C++.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><STRONG>private final int m_maxValuesPerName = 10;</STRONG> </DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I believe this is analgous to <STRONG>const int 
m_maxValuesPerName = 10;</STRONG> in C++.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Tom Veldhouse</FONT></DIV>
<DIV><FONT face=Arial size=2><A 
href="mailto:veldy@veldy.net">veldy@veldy.net</A></FONT></DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=tee@fireclick.com href="mailto:tee@fireclick.com">Todd Enersen</A> 
  </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=freebsd-java@freebsd.org 
  href="mailto:freebsd-java@freebsd.org">freebsd-java@freebsd.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, March 22, 2001 2:04 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> possible bug in port of 
  javac</DIV>
  <DIV><BR></DIV>Hello, 
  <P>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. 
  <P>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".&nbsp; 
  However the java compiler is choking on the following code segment 
  <P><B>private final int m_maxValuesPerName;</B> 
  <P>The compiler is complaining about: 
  <BLOCKQUOTE TYPE="CITE"><PRE>Blank final variable 'm_maxValuesPerName' may not have been initialized. It must&nbsp; 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. 
  <P>I've tried adding a default constructor but that didn't fix the problem. 
  <P>The only solution so far has been to remove the "final" keyword from the 
  declaration. 
  <P>Have you heard of this issue?&nbsp; Is there a solution? 
  <P>Todd Enersen <BR>&nbsp; <BR>&nbsp; </P></BLOCKQUOTE></BODY></HTML>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?005d01c0b341$5cedac20$1d750140>