ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Hardege <stefan.hard...@spmtechnologies.com>
Subject userProperty flag in Property-Task
Date Thu, 11 Oct 2001 14:46:52 GMT
hi,

just wonder about the userProperty-flag in
org.apache.tools.ant.taskdefs.Prooperty:

    ...
    protected boolean userProperty=false; // set read-only properties
    ...

but the only position in the code where
this flag is checked is the following method:

    ...
    protected void addProperty(String n, String v) {
        if( userProperty ) {
            if (project.getUserProperty(n) == null) {
                project.setUserProperty(n, v);
            } else {
                log("Override ignored for " + n, Project.MSG_VERBOSE);
            } 
        } else {
            if (project.getProperty(n) == null) {
                project.setProperty(n, v);
            } else {
                log("Override ignored for " + n, Project.MSG_VERBOSE);
            }
        }
    }
    ...


...and i just cant figure out why the _if_ and the _else_ blocks are
absolutly identic. is it a strange coding-style or a bug? if i have
a look at the comment of the _userProperty_-flag it looks like this
flag should indicate whether a property can be changed or is read-only
but its just ignored ...



stefan

Mime
View raw message