You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by GitBox <gi...@apache.org> on 2021/09/20 07:57:05 UTC

[GitHub] [jackrabbit-oak] Joscorbe commented on a change in pull request #359: OAK-9564: Make the renewLease mechanism a bit more tolerant against unexpected updates

Joscorbe commented on a change in pull request #359:
URL: https://github.com/apache/jackrabbit-oak/pull/359#discussion_r711947384



##########
File path: oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/UpdateUtils.java
##########
@@ -150,6 +150,18 @@ public static boolean checkConditions(@NotNull Document doc,
                 } else if (c.type == Condition.Type.NOTEQUALS && equal) {
                     return false;
                 }
+            } else if (c.type == Condition.Type.LESSTHAN) {
+                if (r != null) {
+                    if (value instanceof Map) {
+                        value = ((Map) value).get(r);
+                    } else {
+                        value = null;
+                    }
+                }
+                if (value instanceof Comparable && c.value instanceof Comparable) {
+                    int lessThan = ((Comparable) value).compareTo(c.value);
+                    return lessThan == -1;
+                }

Review comment:
       I have removed all the logic related with "lessThan", as now I'm using UpdateOp.max() as you proposed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org