ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <>
Subject Re: assertion changes
Date Thu, 22 Nov 2001 10:16:17 GMT
Something I do not understand on the escenario below: 
Can you have assertion statements on a file to be compiled
by JDK 1.3 or before? I thought you would get compilation

So, under the assumption that people only will use this flag if
they actually use assertions in their java files (nothing else makes sense), 
that means they can only compile such files with a JDK that recognizes asserts,
independently of whether the flag is present or not.
Which is the same problem as using a JDK1.2 feature and try to compile
on a JDK1.1 compiler.

The only thing that would make sense to me here is to be able to require
a minimum version for a JVM or compiler in general:

    <javac requires="1.4" />
    <java requires="1.2" />

the default being requires="1.1" meaning should work on any VM. (1.0 being way too old anyway).


Jose Alberto
----- Original Message ----- 
From: "Steve Loughran" <>
To: "Ant Developers List" <>
Sent: Thursday, November 22, 2001 6:49 AM
Subject: Re: assertion changes

> There is a 'use case' where things break
> 1. You enable assertions in some library, such as the java runtime
> 2. someone tries to run your build file on a pre 1.4 system with an old
> version of the library
> I was about to say on a pre 1.4 system if fork =false then you know the
> target JVM version, and so can ignore the settings, but of course you cant
> turn asserts on that late into the game.
> What you can do on a pre 1.4 box is warn the user that bad things are going
> to happen.
> We could also have another option flag or specify what to do with asserts.
> <assert use="ifcurrentJVM" > ... or "true", "false" . That way you could set
> a property to turn asserts on or off on a per user basis, but still leave
> assert statements in the <java> call.
> What do people think?
> -Steve
> NB, I have 1.4b on a system now, so can play with these assert flags.
> ----- Original Message -----
> From: "Jeff Brown" <>
> To: "Ant Developers List" <>
> Sent: Wednesday, November 21, 2001 5:50 PM
> Subject: Re: assertion changes
> For clarification, I want to add some comments about the version
> compatibility issue with the proposed assertion enabling features.
> None of the Ant code proposed here requires 1.4.  All of this will compile
> and execute fine with 1.1.
> Using the new features would require 1.4.  The new features include passing
> "-da" and "-ea" to the interpreter via new optional attributes and elements
> in the java target, which are not valid options pre 1.4.  This would be a
> problem if someone tried to use this feature, but they were using a pre 1.4
> vm.  Why would that ever happen?  It wouldn't.  The only reason to ever add
> these new options to your build file would be to enable or disable
> assertions.  You would not do that unless your code had assertions in it to
> begin with.  If your code has assertions in it, you are already imposing on
> the user that they must have 1.4.  Code with assertions that was compiled
> under 1.4 will run just fine on pre 1.4 vms, but will not compile with a pre
> 1.4 compiler.  If someone is accessing your source code and you have
> assertions in your source code, they will need 1.4 to build, regardless of
> wether these new features are added to Ant.
> I hope that all makes sense.  I have been taking advantage of these features
> for several weeks now and I think others would also.
> Please let me know if I can answer any questions about this.
> Thanks.
> --
> To unsubscribe, e-mail:   <>
> For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message