Author: adulceanu
Date: Tue Apr 11 15:00:00 2017
New Revision: 1790988
URL: http://svn.apache.org/viewvc?rev=1790988&view=rev
Log:
OAK-6051 - Clarify migration tests failures when switching Commit#hasChanges
implementations
Added JavaDoc to SegmentNodeState#fastEquals and Commit#hasChanges
Modified:
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeState.java
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/scheduler/Commit.java
Modified:
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeState.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeState.java?rev=1790988&r1=1790987&r2=1790988&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeState.java
(original)
+++
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeState.java
Tue Apr 11 15:00:00 2017
@@ -621,7 +621,20 @@ public class SegmentNodeState extends Re
}
//------------------------------------------------------------< Object >--
-
+
+ /**
+ * Indicates whether two {@link NodeState} instances are equal to each
+ * other. A return value of {@code true} clearly means that the instances
+ * are equal, while a return value of {@code false} doesn't necessarily
mean
+ * the instances are not equal. These "false negatives" are an
+ * implementation detail and callers cannot rely on them being stable.
+ *
+ * @param a
+ * the first {@link NodeState} instance
+ * @param b
+ * the second {@link NodeState} instance
+ * @return {@code true}, if these two instances are equal.
+ */
public static boolean fastEquals(NodeState a, NodeState b) {
if (Record.fastEquals(a, b)) {
return true;
Modified:
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/scheduler/Commit.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/scheduler/Commit.java?rev=1790988&r1=1790987&r2=1790988&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/scheduler/Commit.java
(original)
+++
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/scheduler/Commit.java
Tue Apr 11 15:00:00 2017
@@ -91,10 +91,12 @@ public class Commit {
}
/**
- * Checks if the commit contains any changes.
+ * Checks if the commit contains any changes. This is a shallow check, with
+ * the same semantics as
+ * {@link SegmentNodeState#fastEquals(NodeState, NodeState)}, which cannot
+ * guarantee against false negatives.
*
- * @return {@code true}, if the commit has changes, {@code false},
- * otherwise.
+ * @return {@code true}, if the commit has changes.
*/
public boolean hasChanges() {
return !SegmentNodeState.fastEquals(changes.getBaseState(),
changes.getNodeState());