You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2010/01/01 23:59:51 UTC

svn commit: r895088 - /maven/maven-2/branches/maven-2.2.x/maven-model/src/main/mdo/maven.mdo

Author: hboutemy
Date: Fri Jan  1 22:59:50 2010
New Revision: 895088

URL: http://svn.apache.org/viewvc?rev=895088&view=rev
Log:
[MNG-3266] make RepositoryBase override not only equals() but hashCode() too
Submitted by: Jared Roberts

Modified:
    maven/maven-2/branches/maven-2.2.x/maven-model/src/main/mdo/maven.mdo

Modified: maven/maven-2/branches/maven-2.2.x/maven-model/src/main/mdo/maven.mdo
URL: http://svn.apache.org/viewvc/maven/maven-2/branches/maven-2.2.x/maven-model/src/main/mdo/maven.mdo?rev=895088&r1=895087&r2=895088&view=diff
==============================================================================
--- maven/maven-2/branches/maven-2.2.x/maven-model/src/main/mdo/maven.mdo (original)
+++ maven/maven-2/branches/maven-2.2.x/maven-model/src/main/mdo/maven.mdo Fri Jan  1 22:59:50 2010
@@ -2283,6 +2283,7 @@
           <name>id</name>
           <version>4.0.0</version>
           <required>true</required>
+          <identifier>true</identifier>
           <description>
             <![CDATA[
             A unique identifier for a repository. This is used to match the repository
@@ -2322,33 +2323,6 @@
           <defaultValue>default</defaultValue>
         </field>
       </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;
-    }
-            ]]>
-          </code>
-        </codeSegment>
-      </codeSegments>
     </class>
 
     <class>
@@ -2375,23 +2349,6 @@
           </association>
         </field>
       </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>
@@ -2410,23 +2367,6 @@
           <version>4.0.0</version>
         </field>
       </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>