jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1452214 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentPropertyState.java
Date Mon, 04 Mar 2013 08:51:41 GMT
Author: jukka
Date: Mon Mar  4 08:51:41 2013
New Revision: 1452214

URL: http://svn.apache.org/r1452214
Log:
OAK-593: Segment-based MK

Optimize a common case in the SegmentPropertyState equality check

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentPropertyState.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentPropertyState.java?rev=1452214&r1=1452213&r2=1452214&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentPropertyState.java
Mon Mar  4 08:51:41 2013
@@ -180,4 +180,22 @@ class SegmentPropertyState extends Abstr
         return reader.readLength(values.getEntry(reader, 0));
     }
 
+    //------------------------------------------------------------< Object >--
+
+    @Override
+    public boolean equals(Object object) {
+        // optimize for common cases
+        if (this == object) {
+            return true;
+        } else if (object instanceof SegmentPropertyState) {
+            SegmentPropertyState that = (SegmentPropertyState) object;
+            if (recordId.equals(that.recordId)
+                    && template.equals(that.template)) {
+                return true;
+            }
+        }
+        // fall back to default equality check in AbstractPropertyState
+        return super.equals(object);
+    }
+
 }



Mime
View raw message