mirror of https://github.com/apache/maven.git
[MNG-3266] make RepositoryBase override not only equals() but hashCode() too (merged from 2.2.x branch r895088)
Submitted by: Jared Roberts git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@895089 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
103a67cbaf
commit
42b849deda
|
@ -2357,6 +2357,7 @@
|
||||||
<name>id</name>
|
<name>id</name>
|
||||||
<version>4.0.0</version>
|
<version>4.0.0</version>
|
||||||
<required>true</required>
|
<required>true</required>
|
||||||
|
<identifier>true</identifier>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
A unique identifier for a repository. This is used to match the repository
|
A unique identifier for a repository. This is used to match the repository
|
||||||
|
@ -2396,40 +2397,6 @@
|
||||||
<defaultValue>default</defaultValue>
|
<defaultValue>default</defaultValue>
|
||||||
</field>
|
</field>
|
||||||
</fields>
|
</fields>
|
||||||
<codeSegments>
|
|
||||||
<codeSegment>
|
|
||||||
<version>4.0.0</version>
|
|
||||||
<code>
|
|
||||||
<![CDATA[
|
|
||||||
/**
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
public boolean equals( Object obj )
|
|
||||||
{
|
|
||||||
if ( obj instanceof RepositoryBase )
|
|
||||||
{
|
|
||||||
|
|
||||||
final RepositoryBase other = (RepositoryBase) obj;
|
|
||||||
|
|
||||||
if ( id != null )
|
|
||||||
{
|
|
||||||
return id.equals( other.id );
|
|
||||||
}
|
|
||||||
return super.equals(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
return ( getId() != null ) ? getId() : "[null]";
|
|
||||||
}
|
|
||||||
]]>
|
|
||||||
</code>
|
|
||||||
</codeSegment>
|
|
||||||
</codeSegments>
|
|
||||||
</class>
|
</class>
|
||||||
|
|
||||||
<class>
|
<class>
|
||||||
|
@ -2456,23 +2423,6 @@
|
||||||
</association>
|
</association>
|
||||||
</field>
|
</field>
|
||||||
</fields>
|
</fields>
|
||||||
<!-- TODO:prevent modello generation of an incorrect equals method. Could be avoided by using <identity/> tags to mark ID as the only identity field -->
|
|
||||||
<codeSegments>
|
|
||||||
<codeSegment>
|
|
||||||
<version>4.0.0</version>
|
|
||||||
<code>
|
|
||||||
<![CDATA[
|
|
||||||
/**
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
public boolean equals( Object obj )
|
|
||||||
{
|
|
||||||
return super.equals( obj );
|
|
||||||
}
|
|
||||||
]]>
|
|
||||||
</code>
|
|
||||||
</codeSegment>
|
|
||||||
</codeSegments>
|
|
||||||
</class>
|
</class>
|
||||||
|
|
||||||
<class>
|
<class>
|
||||||
|
@ -2491,23 +2441,6 @@
|
||||||
<version>4.0.0</version>
|
<version>4.0.0</version>
|
||||||
</field>
|
</field>
|
||||||
</fields>
|
</fields>
|
||||||
<!-- TODO:prevent modello generation of an incorrect equals method. Could be avoided by using <identity/> tags to mark ID as the only identity field -->
|
|
||||||
<codeSegments>
|
|
||||||
<codeSegment>
|
|
||||||
<version>4.0.0</version>
|
|
||||||
<code>
|
|
||||||
<![CDATA[
|
|
||||||
/**
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
public boolean equals( Object obj )
|
|
||||||
{
|
|
||||||
return super.equals( obj );
|
|
||||||
}
|
|
||||||
]]>
|
|
||||||
</code>
|
|
||||||
</codeSegment>
|
|
||||||
</codeSegments>
|
|
||||||
</class>
|
</class>
|
||||||
|
|
||||||
<class java.clone="deep">
|
<class java.clone="deep">
|
||||||
|
|
Loading…
Reference in New Issue