Browse Source

Properties.propertyNames() should be used instead of .keys().

PR: 27261
Obtained from: Mike Murray


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276969 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 20 years ago
parent
commit
7e145de4f1
4 changed files with 6 additions and 3 deletions
  1. +3
    -0
      WHATSNEW
  2. +1
    -1
      src/main/org/apache/tools/ant/Diagnostics.java
  3. +1
    -1
      src/main/org/apache/tools/ant/Project.java
  4. +1
    -1
      src/main/org/apache/tools/ant/types/CommandlineJava.java

+ 3
- 0
WHATSNEW View File

@@ -135,6 +135,9 @@ Fixed bugs:
* NPE using XmlLogger and antlib. * NPE using XmlLogger and antlib.
Bugzilla report 31840. Bugzilla report 31840.


* Properties.propertyNames() should be used instead of .keys().
Bugzilla report 27261.

Changes from Ant 1.6.1 to Ant 1.6.2 Changes from Ant 1.6.1 to Ant 1.6.2
=================================== ===================================




+ 1
- 1
src/main/org/apache/tools/ant/Diagnostics.java View File

@@ -266,7 +266,7 @@ public final class Diagnostics {
* @param out the stream to print the properties to. * @param out the stream to print the properties to.
*/ */
private static void doReportSystemProperties(PrintStream out) { private static void doReportSystemProperties(PrintStream out) {
for (Enumeration keys = System.getProperties().keys();
for (Enumeration keys = System.getProperties().propertyNames();
keys.hasMoreElements();) { keys.hasMoreElements();) {
String key = (String) keys.nextElement(); String key = (String) keys.nextElement();
out.println(key + " : " + System.getProperty(key)); out.println(key + " : " + System.getProperty(key));


+ 1
- 1
src/main/org/apache/tools/ant/Project.java View File

@@ -828,7 +828,7 @@ public class Project {
*/ */
public void setSystemProperties() { public void setSystemProperties() {
Properties systemP = System.getProperties(); Properties systemP = System.getProperties();
Enumeration e = systemP.keys();
Enumeration e = systemP.propertyNames();
while (e.hasMoreElements()) { while (e.hasMoreElements()) {
Object name = e.nextElement(); Object name = e.nextElement();
String value = systemP.get(name).toString(); String value = systemP.get(name).toString();


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

@@ -133,7 +133,7 @@ public class CommandlineJava implements Cloneable {
try { try {
sys = System.getProperties(); sys = System.getProperties();
Properties p = new Properties(); Properties p = new Properties();
for (Enumeration e = sys.keys(); e.hasMoreElements();) {
for (Enumeration e = sys.propertyNames(); e.hasMoreElements();) {
Object o = e.nextElement(); Object o = e.nextElement();
p.put(o, sys.get(o)); p.put(o, sys.get(o));
} }


Loading…
Cancel
Save