mirror of https://github.com/apache/maven.git
[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:
parent
4aeb99b92b
commit
b63e25a47a
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue