You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by tim <ti...@komi.mts.ru> on 2002/04/01 15:07:55 UTC

[PATCH] Method ProjectHelper.replaceProperties "eating" sign '$' if next sign is not '{' (attempt 2)

Bug number 7221.

Than longer the mistake will not be corrected by that it will be more
difficult than it to correct.

I offer the following circuit:

1. Overload method parsePropertyString with new implementation
   private static void parsePropertyString(String value, Vector fragments,
        Vector propertyRefs, boolean fix_bug_7221) throws BuildException

   The source of this method is the same as in the method
   parsePropertyString(String, Vector, Vector)
   but depending on parameter fix_bug_7221 it can parse property
   string without or with bug 7221
2. Method parsePropertyString(String, Vector, Vector) will execute
   parsePropertyString(String, Vector, Vector, boolean) with the last
   parameter equals to true.
3. Correct method replaceProperties(Project, String, Hashtable).
   the line
            parsePropertyString(value, fragments, propertyRefs);
   will look in the following way
        if (project.getProperties().containsKey("ant.fix_bug_7221"))
            parsePropertyString(value, fragments, propertyRefs);
        else
            parsePropertyString(value, fragments, propertyRefs, false);

What problems can arise?
1. in existing projects
   (from the point of view of existing build files)

   No problems. Existing build files will execute with not
   fixed bug 7221 by default.

2. in existing projects
   (from the point of view of existing task)

   Some problems.
   if existing task using method parsePropertyString(String, Vector, Vector)
   it will be equivalent to that property "ant.fix_bug_7221" is
   established.
   
3. in new project
   (from the point of view of existing build files)

   Property "ant.fix_bug_7221" must be defined in build file to fix
   bug 7221.

4. in new project
   (from the point of view of existing task)

   See point 2.

In future versions.
When people will get used to that that the mistake is corrected then:
1. method replaceProperties bring back to reset state
2. delete the method parsePropertyString(String, Vector, Vector, boolean)
3. create method parsePropertyString(String, Vector, Vector) that
   not contain bug 7221.

I'm sorry for my english.