ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <j_a_fernan...@yahoo.com>
Subject Re: Immutability improvement patch
Date Sat, 01 Dec 2001 13:25:46 GMT
From: "Erik Hatcher" <jakarta-ant@ehatchersolutions.com>

> How about calls like this:
> 
>     ProjectHelper.replaceProperties(project, msg, project.getProperties());
> (from Echo.java)
> 
> although in this case is there a reason why this substitution isn't done
> before calling addText?  Its done automatically on calls to setXXX methods.
> Do we not always want property expansion in element text?  I guess <script>
> wouldn't be too happy with that, huh?!  :)
> 
Saw your changes, do you really think it is necessary to require people to use
ProjectHelper? That class seem to me should be considered an internal API.
If it wasn't for deprecation I would suggest make it package scope.

What I would suggest is adding a proper entry point to Project:

    public String Project.replaceProperties(String s);

which is what it is really needed.

And in case you keep your changes as you have, would you be willing to deprecate:
    String ProjectHelper.replaceProperties(Project, String, Hashtable)
now that you added:
    public String ProjectHelper.replaceProperties(Project, String)

What I was thinking was renaming the former into something like:
    private static String ProjectHelper.replacePropertiesFromHash(Project, String, Hashtable)
which will be called by the 2 arg replaceProperties() and  then redefine
the old 3 args as follows (just for deprecation).

    /**
     * @deprecated Use the new blah blah blah instead
     */
    public static String ProjectHelper.replaceProperties(Project p , String s, Hashtable h)
    {
        return replacePropertiesFromHash(Project p, String s, Hashtable h);
    }

The point is that when people compile their own tasks, they get warned they are
using the wrong thing.

If instead, you agree that adding the method to Project is best, then making
replacePropertiesFromHash package wide would probably do, and would 
allow for deprecation of the old entry point.

Hope no one thinks these suggestions are controversial,

Jose Alberto



--
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