Browse Source

fix NPE when running inside a container that puts non-String values inside the system properties

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@671018 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 17 years ago
parent
commit
983f0dbc16
2 changed files with 7 additions and 1 deletions
  1. +3
    -0
      WHATSNEW
  2. +4
    -1
      src/main/org/apache/tools/ant/types/CommandlineJava.java

+ 3
- 0
WHATSNEW View File

@@ -73,6 +73,9 @@ Fixed bugs:
within messageLogged while a different thread also accessed one.
Bugzilla report 45194

* Handle null result of system getProperty() in CommandlineJava.
Similar to Bugzilla report 42334.

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



+ 4
- 1
src/main/org/apache/tools/ant/types/CommandlineJava.java View File

@@ -140,7 +140,10 @@ public class CommandlineJava implements Cloneable {
Properties p = new Properties();
for (Enumeration e = sys.propertyNames(); e.hasMoreElements();) {
String name = (String) e.nextElement();
p.put(name, sys.getProperty(name));
String value = sys.getProperty(name);
if (name != null && value != null) {
p.put(name, value);
}
}
p.putAll(mergePropertySets());
for (Enumeration e = variables.elements(); e.hasMoreElements();) {


Loading…
Cancel
Save