From 24d5b48eebb74764f581f0089699410f850a5489 Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Thu, 31 Aug 2006 21:42:21 +0000 Subject: [PATCH] remove equals/hashcode from Target. Bugzilla report 40207. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@439055 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 2 ++ src/main/org/apache/tools/ant/Target.java | 24 ----------------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index 3b3a67730..90bcf1810 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -8,6 +8,8 @@ Fixed bugs: ----------- * included empty directories. Bugzilla report 40258. +* Invalid hash code of Target causes XmlLogger to fail. + Bugzilla report 40207. Other changes: -------------- diff --git a/src/main/org/apache/tools/ant/Target.java b/src/main/org/apache/tools/ant/Target.java index 0a0f9f23a..8958352dd 100644 --- a/src/main/org/apache/tools/ant/Target.java +++ b/src/main/org/apache/tools/ant/Target.java @@ -454,28 +454,4 @@ public class Target implements TaskContainer { String test = project.replaceProperties(unlessCondition); return project.getProperty(test) == null; } - - /** - * Equality check is based on target name - * @param that other thing to check - * @return true iff type and name are equal - */ - public boolean equals(Object that) { - if (this == that) return true; - if (that == null || getClass() != that.getClass()) return false; - - final Target target = (Target) that; - - if (name != null ? !name.equals(target.name) : target.name != null) return false; - - return true; - } - - /** - * Hash code is based on name, is 0 if the name==null - * @return hash code - */ - public int hashCode() { - return (name != null ? name.hashCode() : 0); - } }