peterreilly 2003/11/27 02:29:35
Modified: src/main/org/apache/tools/ant/util Tag: ANT_16_BRANCH
ScriptRunner.java
Log:
Sync with head
Revision Changes Path
No revision
No revision
1.1.2.2 +9 -1 ant/src/main/org/apache/tools/ant/util/ScriptRunner.java
Index: ScriptRunner.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/ScriptRunner.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- ScriptRunner.java 22 Oct 2003 09:28:22 -0000 1.1.2.1
+++ ScriptRunner.java 27 Nov 2003 10:29:35 -0000 1.1.2.2
@@ -139,7 +139,15 @@
for (Iterator i = beans.keySet().iterator(); i.hasNext();) {
String key = (String) i.next();
Object value = beans.get(key);
- manager.declareBean(key, value, value.getClass());
+ if (value != null) {
+ manager.declareBean(key, value, value.getClass());
+ } else {
+ // BSF uses a hashtable to store values
+ // so cannot declareBean with a null value
+ // So need to remove any bean of this name as
+ // that bean should not be visible
+ manager.undeclareBean(key);
+ }
}
// execute the script
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]