You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2009/05/18 20:19:12 UTC

svn commit: r776035 - in /cxf/branches/2.1.x-fixes: ./ api/src/main/java/org/apache/cxf/service/model/

Author: dkulp
Date: Mon May 18 18:19:12 2009
New Revision: 776035

URL: http://svn.apache.org/viewvc?rev=776035&view=rev
Log:
Merged revisions 776025 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r776025 | dkulp | 2009-05-18 14:02:20 -0400 (Mon, 18 May 2009) | 2 lines
  
  [CXF-2219] Add hashcode and equals methods to various things that appear
  in hashmaps.
........

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java
    cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java
    cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java
    cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/FaultInfo.java
    cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java
    cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/MessageInfo.java
    cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
    cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon May 18 18:19:12 2009
@@ -1 +1 @@
-/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024
+/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024-776025

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java?rev=776035&r1=776034&r2=776035&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java (original)
+++ cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java Mon May 18 18:19:12 2009
@@ -219,5 +219,23 @@
         return messageParts.size() + getOutOfBandParts().size();
     }
     
+    
+    public int hashCode() {
+        return mName == null ? -1 : mName.hashCode();
+    }
+    
+    public boolean equals(Object o) {
+        if (o == this) {
+            return true;
+        }
+
+        if (!(o instanceof AbstractMessageContainer)) {
+            return false;
+        }
+        AbstractMessageContainer oi = (AbstractMessageContainer)o;
+        return equals(mName, oi.mName) 
+            && equals(messageParts, oi.messageParts)
+            && equals(outOfBandParts, oi.outOfBandParts);
+    }
 
 }

Modified: cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java?rev=776035&r1=776034&r2=776035&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java (original)
+++ cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java Mon May 18 18:19:12 2009
@@ -157,4 +157,15 @@
         }
         return extensor;
     }
+    
+    
+
+    protected static final boolean equals(Object o1, Object o2) {
+        if (o1 == null && o2 != null
+            || o1 != null && o2 == null) {
+            return false;
+        }
+        return o1 == null ? true : o1.equals(o2);
+    }
+    
 }

Modified: cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java?rev=776035&r1=776034&r2=776035&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java (original)
+++ cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java Mon May 18 18:19:12 2009
@@ -140,4 +140,19 @@
             .append("]").toString();
     }
     
+    
+    public int hashCode() {
+        return opInfo.hashCode();
+    }
+    
+    public boolean equals(Object o) {
+        if (o == this) {
+            return true;
+        }
+        if (!(o instanceof BindingOperationInfo)) {
+            return false;
+        }
+        return equals(opInfo, ((BindingOperationInfo)o).opInfo);
+    }
+
 }

Modified: cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/FaultInfo.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/FaultInfo.java?rev=776035&r1=776034&r2=776035&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/FaultInfo.java (original)
+++ cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/FaultInfo.java Mon May 18 18:19:12 2009
@@ -35,4 +35,25 @@
     public void setFaultName(QName fname) {
         faultName = fname;
     }
+    
+    
+    
+    public int hashCode() {
+        return faultName == null ? -1 : faultName.hashCode();
+    }
+    
+    public boolean equals(Object o) {
+        if (o == this) {
+            return true;
+        }
+
+        if (!(o instanceof FaultInfo)) {
+            return false;
+        }
+        FaultInfo oi = (FaultInfo)o;
+        return equals(faultName, oi.faultName) 
+            && super.equals(o);
+    }
+    
+
 }

Modified: cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java?rev=776035&r1=776034&r2=776035&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java (original)
+++ cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java Mon May 18 18:19:12 2009
@@ -113,5 +113,6 @@
     public Collection<OperationInfo> getOperations() {
         return Collections.unmodifiableCollection(operations.values());
     }   
-
+    
+    
 }

Modified: cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/MessageInfo.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/MessageInfo.java?rev=776035&r1=776034&r2=776035&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/MessageInfo.java (original)
+++ cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/MessageInfo.java Mon May 18 18:19:12 2009
@@ -74,7 +74,7 @@
 
     @Override
     public String toString() {
-        return "[MessageInfo " + type + mName.toString() + "]";
+        return "[MessageInfo " + type + ": " + mName.toString() + "]";
     }
 
     public Type getType() {

Modified: cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java?rev=776035&r1=776034&r2=776035&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java (original)
+++ cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java Mon May 18 18:19:12 2009
@@ -137,6 +137,25 @@
             .append(getConcreteName()).toString();
     }
     
+    public int hashCode() {
+        return pname == null ? -1 : pname.hashCode();
+    }
     
+    public boolean equals(Object o) {
+        if (o == this) {
+            return true;
+        }
+        if (!(o instanceof MessagePartInfo)) {
+            return false;
+        }
+        MessagePartInfo oi = (MessagePartInfo)o;
+        return equals(pname, oi.pname) 
+            && isElement == oi.isElement
+            && equals(typeName, oi.typeName)
+            && equals(elementName, oi.elementName)
+            && equals(concreteName, oi.concreteName)
+            && equals(typeClass, oi.typeClass);
+    }
+
     
 }

Modified: cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java?rev=776035&r1=776034&r2=776035&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java (original)
+++ cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java Mon May 18 18:19:12 2009
@@ -212,4 +212,25 @@
             .append(opName)
             .append("]").toString();
     }
+    
+    public int hashCode() {
+        return opName == null ? -1 : opName.hashCode();
+    }
+    
+    public boolean equals(Object o) {
+        if (o == this) {
+            return true;
+        }
+
+        if (!(o instanceof OperationInfo)) {
+            return false;
+        }
+        OperationInfo oi = (OperationInfo)o;
+        return equals(opName, oi.opName) 
+            && equals(inputMessage, oi.inputMessage)
+            && equals(outputMessage, oi.outputMessage)
+            && equals(faults, oi.faults)
+            && equals(intf.getName(), oi.intf.getName()); 
+    }
+    
 }