Author: mreutegg
Date: Wed Dec 16 16:14:00 2015
New Revision: 1720381
URL: http://svn.apache.org/viewvc?rev=1720381&view=rev
Log:
OAK-3798: NodeDocument.getNewestRevision() incorrect when there are previous
documents
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java?rev=1720381&r1=1720380&r2=1720381&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java
Wed Dec 16 16:14:00 2015
@@ -795,15 +795,14 @@ public final class NodeDocument extends
}
if (!fullScan) {
// check if we can stop going through changes
- if (isRevisionNewer(context, lower, r)
+ if (clusterIds.contains(r.getClusterId())
+ && isRevisionNewer(context, lower, r)
&& newestRevs.containsKey(r.getClusterId())) {
- if (isRevisionNewer(context, lower, r)) {
- clusterIds.remove(r.getClusterId());
- if (clusterIds.isEmpty()) {
- // all remaining revisions are older than
- // the lower bound
- break;
- }
+ clusterIds.remove(r.getClusterId());
+ if (clusterIds.isEmpty()) {
+ // all remaining revisions are older than
+ // the lower bound
+ break;
}
}
}