----- Original Message -----
From: "Laurie Harper" <[EMAIL PROTECTED]>
To: "Ant Developers List" <[EMAIL PROTECTED]>
Sent: Tuesday, September 10, 2002 5:11 PM
Subject: Re: preprocessing java source


> On 9/9/02 1:04 PM, "Steve Loughran" <[EMAIL PROTECTED]> wrote:
> > but assert ; is a special case....it's nice to have them, yet the moment
you
> > use them you are bound to 1.4. Jon Skeet was bouncing round the idea of
> > doing jar fixup though...
>
> Yep, but you can use something like Junit to get most of the benefits JDK
> 1.4's assertion keyword gives you.

but not in running code. If I use assert I can assert invariant pre- and
post- conditions about core data structures in my code, ones that get
checked on any production build. Junit is good for unit tests, assert lets
you verify that invariants hold in a running system. I admit I may be odd
here, having a background in formal methods, and not being above proving
concurrency relationships hold in class that I then opt not to synchronize
blindly on the basis that a proof is adequate (yes, that is a maintenance
nightmare, but it boosts performance).

There is an <icontract> preprocessor for ant to go from @pre and @post
javadoc conditions to code, and of course add 'design by contract' is a
popular java RFE, so maybe i am not alone. I'd like it if icontract
generated assert statements...

-steve


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to