incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r921297 - /sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java
Date Wed, 10 Mar 2010 10:50:32 GMT
Author: cziegeler
Date: Wed Mar 10 10:50:32 2010
New Revision: 921297

URL: http://svn.apache.org/viewvc?rev=921297&view=rev
Log:
SLING-1431 : Utility method to get the service ranking - implement equals and hashCode

Modified:
    sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java

Modified: sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java?rev=921297&r1=921296&r2=921297&view=diff
==============================================================================
--- sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java
(original)
+++ sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java
Wed Mar 10 10:50:32 2010
@@ -355,5 +355,18 @@ public class OsgiUtil {
             // If ranks are equal, then sort by service id in descending order.
             return (id.compareTo(otherId) < 0) ? 1 : -1;
         }
+
+        @Override
+        public boolean equals(Object obj) {
+            if ( obj instanceof ComparableImplementation ) {
+                return this.props.equals(((ComparableImplementation)obj).props);
+            }
+            return false;
+        }
+
+        @Override
+        public int hashCode() {
+            return this.props.hashCode();
+        }
     }
 }



Mime
View raw message