Browse Source

Throw a BuildException when an attempt is made to use a property which has

not been set. Any build files which rely on non-set properties being passed
through untranslated will now break.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268322 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 24 years ago
parent
commit
5ccd2bcf73
2 changed files with 10 additions and 2 deletions
  1. +4
    -0
      WHATSNEW
  2. +6
    -2
      src/main/org/apache/tools/ant/ProjectHelper.java

+ 4
- 0
WHATSNEW View File

@@ -9,6 +9,10 @@ Changes that could break older environments:

* <perforce> has been replaced by a number of new tasks.

* Ant now throws a BuildException when an attempt is made to use a property which has
not been set. Any build files which rely on non-set properties being passed
through untranslated will now break.

Other changes:
--------------



+ 6
- 2
src/main/org/apache/tools/ant/ProjectHelper.java View File

@@ -634,8 +634,12 @@ public class ProjectHelper {
value );
}
String n=value.substring( pos+2, endName );
String v= (keys.containsKey(n)) ? (String) keys.get( n )
: "${"+n+"}";
if (!keys.containsKey(n)) {
throw new BuildException("Property ${" + n + "} has not been set");
}
String v = (String) keys.get(n);
//System.out.println("N: " + n + " " + " V:" + v);
sb.append( v );
prev=endName+1;


Loading…
Cancel
Save