ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hardy Henneberg <hhe...@post7.tele.dk>
Subject Re: confused over failure
Date Tue, 13 Feb 2001 19:08:25 GMT
Hi,
I'm not 100% sure if it is so in java, but in C++, what you do is not
inialization but assignment to an already existing variable.
Initialization is done so:
public final int ord = 10;

kind regards Hardy

Diane Holt wrote:

> The <javac> task now has a "failonerror" attribute -- set it to "no" to
> keep going after a compiler error.
>
> Diane
>
> --- Phillip Lord <p.lord@hgmp.mrc.ac.uk> wrote:
> >
> >
> >
> >        I've just started using ant, and I have a small question.
> > I am a little confused about how ant copes with failures of
> > processes.
> >
> >        To give a little background....
> >
> >        I have a file with the following construction in it
> >
> >
> > public final int ord;
> >
> > protected Constructor()
> > {
> >
> >     ord = 10;
> > }
> >
> >      which is perfectly legal java. Sadly due to a bug in Javac
> > is will not compile, instead telling me that I have to initialise
> > finals in the constructor (even though I have).
> >
> >        Now this code compiles fine with jikes. My code will of course
> > also work without the variable being final, but this opens the
> > possibility of modifying the variable, in which case lots of my code
> > will crash (which is why its final!).
> >
> >        What I want to do therefore during the build is the following.
> >
> >        1) Compile the file with javac.
> >        2) If this fails then I am falling foul of the bug
> >        3) So therefore trying compiling it with jikes if is
> >           available
> >        4) If neither of these two work, then I want to patch
> >           the file to change the variable to a non final one.
> >        5) And finally run javac.
> >
> >
> >        But to do all of this I need to have compilation fail in
> > a non fatal way, but act upon this failure.
> >
> >        Can anyone help?
> >
> >        Phil
> >
>
> =====
> (holtdl@yahoo.com)
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail - only $35
> a year!  http://personal.mail.yahoo.com/


Mime
View raw message