ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martijn Kruithof>
Subject Re: Adding equals() and hashCode() methods to Task and Target
Date Tue, 28 Feb 2006 16:15:20 GMT
What would be the criteria for two taks / targets to be equal in the 
normal ant context?

Normally I would say two distinct tasks / targets are never equal?


Robert Smith schreef:

>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
>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,
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message