add equals/hashcode for dependency

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163118 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2004-09-19 06:12:37 +00:00
parent e25114e87f
commit 5d4897ddba
1 changed files with 34 additions and 0 deletions

View File

@ -845,6 +845,40 @@
{
return getProperties().getProperty( property );
}
public boolean equals( Object o )
{
if ( o == null )
{
return false;
}
if ( getClass() != o.getClass() )
{
return false;
}
if ( getId() != null )
{
return getId().equals( ( (Dependency) o ).getId() );
}
else
{
return ( (Dependency) o ).getId() == null;
}
}
public int hashCode()
{
if ( getId() != null )
{
return getId().hashCode();
}
else
{
return super.hashCode();
}
}
]]></code>
</codeSegment>
</codeSegments>