From 97c4b6bd774960fe9301829cf2d1ac23882e8958 Mon Sep 17 00:00:00 2001 From: Mark Donszelmann Date: Fri, 27 Nov 2009 14:33:32 +0100 Subject: Fixed test for NAR-109 --- src/main/java/net/sf/antcontrib/cpptasks/CCTask.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/main') diff --git a/src/main/java/net/sf/antcontrib/cpptasks/CCTask.java b/src/main/java/net/sf/antcontrib/cpptasks/CCTask.java index 62a8e6d..fec91af 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/CCTask.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/CCTask.java @@ -21,6 +21,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Comparator; import java.util.Enumeration; +import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; import java.util.List; @@ -173,8 +174,8 @@ public class CCTask extends Task { * Builds a Hashtable to targets needing to be rebuilt keyed by compiler * configuration */ - public static Hashtable getTargetsToBuildByConfiguration(Map targets) { - Hashtable targetsByConfig = new Hashtable(); + public static Map getTargetsToBuildByConfiguration(Map targets) { + Map targetsByConfig = new HashMap(); Iterator targetEnum = targets.values().iterator(); while (targetEnum.hasNext()) { TargetInfo target = (TargetInfo) targetEnum.next(); @@ -688,17 +689,17 @@ public class CCTask extends Task { // // compile all targets with getRebuild() == true // - Hashtable targetsByConfig = getTargetsToBuildByConfiguration(targets); + Map targetsByConfig = getTargetsToBuildByConfiguration(targets); // // build array containing Vectors with precompiled generation // steps going first // Vector[] targetVectors = new Vector[targetsByConfig.size()]; int index = 0; - Enumeration targetVectorEnum = targetsByConfig.elements(); - while (targetVectorEnum.hasMoreElements()) { + Iterator targetVectorEnum = targetsByConfig.values().iterator(); + while (targetVectorEnum.hasNext()) { Vector targetsForConfig = (Vector) targetVectorEnum - .nextElement(); + .next(); // // get the configuration from the first entry // @@ -708,10 +709,10 @@ public class CCTask extends Task { targetVectors[index++] = targetsForConfig; } } - targetVectorEnum = targetsByConfig.elements(); - while (targetVectorEnum.hasMoreElements()) { + targetVectorEnum = targetsByConfig.values().iterator(); + while (targetVectorEnum.hasNext()) { Vector targetsForConfig = (Vector) targetVectorEnum - .nextElement(); + .next(); for (int i = 0; i < targetVectors.length; i++) { if (targetVectors[i] == targetsForConfig) { break; -- cgit v1.2.3