Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Mar 2001 15:37:35 -0400
From:      "Jeroen C. van Gelderen" <jeroen@vangelderen.org>
To:        Todd Enersen <tee@fireclick.com>
Cc:        freebsd-java@freebsd.org
Subject:   Re: possible bug in port of javac
Message-ID:  <3ABBA5FF.A11E23EA@vangelderen.org>
References:  <3ABA5AC3.CA8F09DD@fireclick.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Todd,

Todd Enersen wrote:
> 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.

This can be caused by a number of problems and since you didn't
post the code in question it is hard to say what is at fault.

Try and isolate the fault by compiling with the Jikes compiler
or with the same version of javac on a different platform as
suggested by others in this thread.

If the problem doesn't manifest itself on the alternative compiler 
you have probably spotted a compiler bug. You will then have to
produce a small test case demonstrating the problem and submit it
to the compiler maintainers. 

It is not unlikely that your problem is caused by a compiler bug.
Most compiler bugs I have seen manifest themselves when you use 
inner classes or static{} initilizers but Javasoft doesn't really
have a track record of producing reliable code so I'd expect 
anything. (To be fair, Jikes 1.13 has some analysis bugs as well.)

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

That is to be expected.

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

That is rather ugly.

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

You will have to try and pinpoint the problem or provide source
code for us to analyze. Without more details we can only speculate.

Cheers,
Jeroen
-- 
Jeroen C. van Gelderen - jeroen@vangelderen.org

"A government that robs Peter to pay Paul can always depend
  upon the support of Paul."  --  George Bernard Shaw

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?3ABBA5FF.A11E23EA>