jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1446585 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeState.java
Date Fri, 15 Feb 2013 14:01:59 GMT
Author: jukka
Date: Fri Feb 15 14:01:58 2013
New Revision: 1446585

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

Another simple optimization. Nodes with different templates can't be equal.

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

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeState.java?rev=1446585&r1=1446584&r2=1446585&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeState.java
Fri Feb 15 14:01:58 2013
@@ -106,12 +106,15 @@ class SegmentNodeState extends AbstractN
         if (this == object) {
             return true;
         } else if (object instanceof NodeState) {
-            if (object instanceof SegmentNodeState
-                    && recordId.equals(((SegmentNodeState) object).recordId)) {
-                return true;
-            } else {
-                return super.equals(object);
+            if (object instanceof SegmentNodeState) {
+                SegmentNodeState that = (SegmentNodeState) object;
+                if (recordId.equals(that.recordId)) {
+                    return true;
+                } else if (!getTemplate().equals(that.getTemplate())) {
+                    return false;
+                }
             }
+            return super.equals(object);
         } else {
             return false;
         }



Mime
View raw message