[MNG-3240] maven-model RepositoryBase.equals() causes ClassCastException

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@586533 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Carlos Sanchez Gonzalez 2007-10-19 16:52:49 +00:00
parent 4aeb99b92b
commit b63e25a47a
1 changed files with 12 additions and 10 deletions

View File

@ -2624,16 +2624,18 @@
*/
public boolean equals( Object obj )
{
RepositoryBase other = (RepositoryBase) obj;
boolean retValue = false;
if ( id != null )
{
retValue = id.equals( other.id );
}
return retValue;
if ( obj instanceof RepositoryBase ) {
final RepositoryBase other = (RepositoryBase) obj;
if ( id != null )
{
return id.equals( other.id );
}
return super.equals(obj);
}
return false;
}
]]>
</code>