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 11585] New: - The Replace Task ignores properties with multiline replacements
Date Fri, 09 Aug 2002 09:47:42 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11585>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11585

The Replace Task ignores properties with multiline replacements

           Summary: The Replace Task ignores properties with multiline
                    replacements
           Product: Ant
           Version: 1.5
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: andre.anneck@spmtechnologies.com
                CC: andre.anneck@spmtechnologies.com


If you are using the mulitline replacement like:

<replace 
  file="${workdir}/ejb-basis/conf/default/jboss.jcml" summary="true">
  <replacetoken><![CDATA[<!-- BINDADDRESS -->]]></replacetoken>
  <replacevalue><![CDATA[<attribute
name="BindAddress">${jbossHostname}</attribute>]]></replacevalue>
</replace>

The property jbossHostname is ignored.

When you look at Replace.java you can see why in line 123-127:

        public void addText(String val) {
           buf.append(val);
        }

it should be replace with:
        public void addText(String val) {
           buf.append( project.replaceProperties( val ) );
        }

And usage of final would hurt here:
        public void addText( final String val ) {
           buf.append( project.replaceProperties( val ) );
        }

After this change the replace-multiline works as expected (at least as I
exepected) ;).

Take care,

Andre

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