diff --git a/src/main/org/apache/tools/ant/types/XMLCatalog.java b/src/main/org/apache/tools/ant/types/XMLCatalog.java index d4a605847..647f2d23a 100644 --- a/src/main/org/apache/tools/ant/types/XMLCatalog.java +++ b/src/main/org/apache/tools/ant/types/XMLCatalog.java @@ -58,7 +58,6 @@ import java.lang.reflect.Method; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; @@ -711,8 +710,6 @@ public class XMLCatalog extends DataType source.setSystemId(sysid); log("catalog entry matched a readable file: '" + sysid + "'", Project.MSG_DEBUG); - } catch (FileNotFoundException ex) { - // ignore } catch (IOException ex) { // ignore } diff --git a/src/main/org/apache/tools/ant/util/CollectionUtils.java b/src/main/org/apache/tools/ant/util/CollectionUtils.java index 4224df497..c10dd1230 100644 --- a/src/main/org/apache/tools/ant/util/CollectionUtils.java +++ b/src/main/org/apache/tools/ant/util/CollectionUtils.java @@ -63,15 +63,17 @@ import java.util.Vector; * * @author Stefan Bodewig * @author Ingmar Stein + * @author Martijn Kruithof * * @since Ant 1.5 */ public class CollectionUtils { /** - * Vector.equals() doesn't do any good in 1.1 + * Please use Vector.equals() or List.equals() * * @since Ant 1.5 + * @deprecated */ public static boolean equals(Vector v1, Vector v2) { if (v1 == v2) { @@ -82,30 +84,17 @@ public class CollectionUtils { return false; } - if (v1.size() != v2.size()) { - return false; - } - - Enumeration e1 = v1.elements(); - Enumeration e2 = v2.elements(); - while (e1.hasMoreElements()) { - if (!e1.nextElement().equals(e2.nextElement())) { - return false; - } - } - - // don't need to check e2.hasMoreElements as the Vectors have - // same size. - - return true; + return v1.equals(v2); } /** - * Hashtable.equals() doesn't do any good in 1.1. + * Dictionary does not have an equals. + * Please use Map.equals() * *
Follows the equals contract of Java 2's Map.
* * @since Ant 1.5 + * @deprecated */ public static boolean equals(Dictionary d1, Dictionary d2) { if (d1 == d2) { @@ -137,9 +126,10 @@ public class CollectionUtils { } /** - * JDK 1.1 does not know the putAll method for hash tables. + * Dictionary does not know the putAll method. Please use Map.putAll(). * * @since Ant 1.6 + * @deprecated */ public static void putAll(Dictionary m1, Dictionary m2) { for (Enumeration it = m2.keys(); it.hasMoreElements();) {