diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-17 01:40:44 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-17 01:40:44 +0000 |
commit | 3ded433af820aae000913fa0305380a0f7988c2c (patch) | |
tree | 8f9854db54f0337c4db488e78f5b3d4ac9ac8ba6 /sca-java-2.x/trunk/modules/implementation-spring/src | |
parent | d65fd2438b4ba4df1967018fc4934db22b47df24 (diff) |
Fix the equals and hashCode to avoid componentType conflicts
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@924089 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/implementation-spring/src')
-rw-r--r-- | sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java b/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java index 8081fb4911..7a73f79a45 100644 --- a/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java +++ b/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java @@ -225,4 +225,34 @@ public class SpringImplementation extends ImplementationImpl implements Implemen public void setClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((location == null) ? 0 : location.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (!(obj instanceof SpringImplementation)) { + return false; + } + SpringImplementation other = (SpringImplementation)obj; + if (location == null) { + if (other.location != null) { + return false; + } + } else if (!location.equals(other.location)) { + return false; + } + return true; + } }
\ No newline at end of file |