Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Mar 2001 12:46:13 -0800
From:      "Todd Enersen" <tee@fireclick.com>
To:        "Jeroen C. van Gelderen" <jeroen@vangelderen.org>
Cc:        <freebsd-java@freebsd.org>
Subject:   RE: possible bug in port of javac
Message-ID:  <NCBBJIIIPMCOEALNBNBCGEOFCAAA.tee@fireclick.com>
In-Reply-To: <3ABBA5FF.A11E23EA@vangelderen.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Jeroen (and company):

Thanks for all of your suggestions.

The code segment in question compiles under other Jdk 1.2 plaforms,
including Solaris (jdk 1.2.2_05), Win32, and Linux. It compiles with javac
or jikes under all of these platforms.

When I was porting to the FreeBSD platform, I originally tried using the
jikes (version 1.12 that came as part of my 4.2 distribution).
Unfortunately, it immediately threw up some errors which I later solved. As
it turns out, this version of jikes doesn't like relative pathnames when
given a explicit classpath. Fortunately, after reworking the classpath on
the compiler invocation, our software now compiles with jikes under the
FreeBSD platform.

However the source still fails to compile with the javac that I have built.
I'm working on developing a small test code segment. The ones I have built
so far all compile smoothly, so I know it has to be some set of complex
conditions, or perhaps the size of the class, that is causing the compiler
to fail.  I'll continue to try and get this issue resolved.

There have been many questions as to why we use the private static final
<type> invocation. Infact, we use it over 100 places in our code mainly to
introduce static final class specific constants that may need to change with
different constructors.  For example, in this instance we want to assign an
integer a constant, but have that constant vary on a class instance basis,
based on which constructor was called.

I want to give thanks to all those who have written me back. This level of
support was unexpected and very appreciated.

Regards,

Todd Enersen
Fireclick





-----Original Message-----
From: gelderen@cypherpunks.ai [mailto:gelderen@cypherpunks.ai]On Behalf
Of Jeroen C. van Gelderen
Sent: Friday, March 23, 2001 11:38 AM
To: Todd Enersen
Cc: freebsd-java@freebsd.org
Subject: Re: possible bug in port of javac


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?NCBBJIIIPMCOEALNBNBCGEOFCAAA.tee>