ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 42277] New: - String resources can have properties double expanded
Date Fri, 27 Apr 2007 13:31:13 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42277>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42277

           Summary: String resources can have properties double expanded
           Product: Ant
           Version: 1.7Alpha (nightly)
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: stevel@apache.org


StringResource does a property expand on a getContent() operation:

    /**
     * Get the content of this StringResource.
     * @return a String; if the Project has been set properties
     *         replacement will be attempted.
     */
    protected synchronized String getContent() {
        if (isReference()) {
            return ((StringResource) getCheckedRef()).getContent();
        }
        String value = getValue();
        if (value == null) {
            return value;
        }
        return getProject() == null
            ? value : getProject().replaceProperties(value);
    }

but since the resource has its value set by the value attribute, that is, an
attribute setter, properties have already been expanded. 

This will double expand anything, such as $${ant.version}. 

I propose we conclude this is a real defect, and fix it, unless there is a good
explanation for double-expanding properties.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message