diff --git oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeState.java oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeState.java index d51fd6afeb..4916254eab 100644 --- oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeState.java +++ oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeState.java @@ -621,7 +621,21 @@ public class SegmentNodeState extends Record implements NodeState { } //------------------------------------------------------------< 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"; {@code false} + * otherwise. + */ public static boolean fastEquals(NodeState a, NodeState b) { if (Record.fastEquals(a, b)) { return true; diff --git oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/scheduler/Commit.java oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/scheduler/Commit.java index 2064279bd3..15aca92dbb 100644 --- oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/scheduler/Commit.java +++ oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/scheduler/Commit.java @@ -91,7 +91,10 @@ 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.