ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Smith" <rjmpsm...@gmail.com>
Subject Adding equals() and hashCode() methods to Task and Target
Date Tue, 28 Feb 2006 15:57:13 GMT
Hi all,

Quite some time ago, I wrote a RemoteAnt implementation to allow
portions of an Ant build to run remotely with synchronous logging back
to the main Ant instance. You can find it at
http://confluence.public.thoughtworks.org/display/CC/RobertsRemoteAnt.

I've hit a problem with the XmlLogger class, however. The XmlLogger
uses a hashtable to store references to tasks and targets as the build
progresses. The problem is that the Task and Target classes do not
overide the equals() and hashcode() methods. This causes problems for
me as I am creating local Tasks and Targets to represent those running
on the remote machine. However, when the XmlLogger goes to check the
hashtable when a Task completes, it's not finding the local Task that
was created when the remote Task started.

Would it be possible to implemnent the equals() and hashCode() methods
for Task and Target using only String values (such as project name,
task name, etc.)?

I'd be happy to submit a patch if you like. I just wanted to check
here first to see if such a thing would be accepted.

Many thanks,

Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message