ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r671018 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/types/CommandlineJava.java
Date Tue, 24 Jun 2008 04:29:40 GMT
Author: bodewig
Date: Mon Jun 23 21:29:40 2008
New Revision: 671018

URL: http://svn.apache.org/viewvc?rev=671018&view=rev
Log:
fix NPE when running inside a container that puts non-String values inside the system properties

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/types/CommandlineJava.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=671018&r1=671017&r2=671018&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Mon Jun 23 21:29:40 2008
@@ -73,6 +73,9 @@
    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:
 --------------
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/CommandlineJava.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/CommandlineJava.java?rev=671018&r1=671017&r2=671018&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/CommandlineJava.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/CommandlineJava.java Mon Jun 23 21:29:40
2008
@@ -140,7 +140,10 @@
                 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();) {



Mime
View raw message