Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 24213 invoked from network); 15 Mar 2005 13:18:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 15 Mar 2005 13:18:49 -0000 Received: (qmail 82213 invoked by uid 500); 15 Mar 2005 13:18:48 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 82044 invoked by uid 500); 15 Mar 2005 13:18:47 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 82031 invoked by uid 500); 15 Mar 2005 13:18:47 -0000 Received: (qmail 82027 invoked by uid 99); 15 Mar 2005 13:18:47 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 15 Mar 2005 05:18:47 -0800 Received: (qmail 24170 invoked by uid 1539); 15 Mar 2005 13:18:45 -0000 Date: 15 Mar 2005 13:18:45 -0000 Message-ID: <20050315131845.24168.qmail@minotaur.apache.org> From: peterreilly@apache.org To: ant-cvs@apache.org Subject: cvs commit: ant/src/main/org/apache/tools/ant Location.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N peterreilly 2005/03/15 05:18:45 Modified: src/main/org/apache/tools/ant Location.java Log: add equals and hashcode to Location Revision Changes Path 1.23 +27 -1 ant/src/main/org/apache/tools/ant/Location.java Index: Location.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Location.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- Location.java 3 Mar 2005 14:00:08 -0000 1.22 +++ Location.java 15 Mar 2005 13:18:45 -0000 1.23 @@ -117,7 +117,7 @@ public int getColumnNumber() { return columnNumber; } - + /** * Returns the file name, line number, a colon and a trailing space. * An error message can be appended easily. For unknown locations, an @@ -145,4 +145,30 @@ return buf.toString(); } + /** + * Equality operation. + * @param other the object to compare to. + * @return true if the other object contains the same information + * as this object. + */ + public boolean equals(Object other) { + if (this == other) { + return true; + } + if (other == null) { + return false; + } + if (!(other.getClass() == getClass())) { + return false; + } + return toString().equals(other.toString()); + } + + /** + * Hash operation. + * @return a hash code value for this location. + */ + public int hashCode() { + return toString().hashCode(); + } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org