ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Magesh Umasankar" <umag...@apache.org>
Subject Re: Speaking of deprecation...
Date Tue, 12 Feb 2002 15:09:30 GMT
From: "Steve Loughran" <steve_l@iseran.com>

> > As I have modified the value of some public static finals,
> > viz. Project.DEBUG and Project.VERBOSE, mandatory
> > recompiling of all of Ant's source code is needed.
> > If you can suggest a cleaner way to do this and avoid
> > this penalty, I am all ears.
>
> This breaks every existing external task out there, right?

It just exposes the problem of having used
public static finals.  But short answer is, yes,
it would.  Maybe I can change the levels back
to what they were and assign a new value to
deprecated and build in logic to handle this.

> I am concerned with the risk it presents to
> all those external apps; it is one of those

Valid point.

>
> Here is some of what I think we could do
>
> 1. use a deprecated(text) method (preferably with a since flag),
implemented
> in Task
> This means that tasks themselves do not need to log at the deprecation
> level.
>
> 2. have that base implementation hand off to Project.deprecated()
>
> 3. Project.deprecated() can have its implementation changed over time. It
> could be set to throw an exception in the -strict mode I have just
invented;
> it could print warnings, it could be silent
>
> 4. If it needs to print warnings, then they do have to go through the
> listener chain, which means it needs a logging level. It could just go out
> as info, like this
>
> class Project
>
> public void deprecated(Task task, String text) {
>     if(deprecation_mode==DEPRECATION_FAIL) {
>         //TODO: get line number &c from task
>         throw new BuildException(text);
>     }
>     if(deprecation_mode==DEPRECATION_WARN) {
>         log(text,MSG_WARN);
>     }
>     deprecations++;
>   }
>

Wanna come up with the implementation? ;-)

Cheers,
Magesh

**********************************************
* Courage is acting as if your hands aren't  *
* trembling.                                 *
**********************************************



--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message