You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/07/09 07:26:33 UTC

[camel] 01/02: Fix read-lock behavior (#5816)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-3.11.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 4010eb03e42dfdcdeaf320e9ca42be4c19d1f6de
Author: Philippe Schaller <ph...@gmail.com>
AuthorDate: Fri Jul 9 09:22:15 2021 +0200

    Fix read-lock behavior (#5816)
---
 .../component/file/strategy/FileChangedExclusiveReadLockStrategy.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/FileChangedExclusiveReadLockStrategy.java b/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/FileChangedExclusiveReadLockStrategy.java
index 99e6f2e..b04d33a 100644
--- a/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/FileChangedExclusiveReadLockStrategy.java
+++ b/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/FileChangedExclusiveReadLockStrategy.java
@@ -87,8 +87,8 @@ public class FileChangedExclusiveReadLockStrategy extends MarkerFileExclusiveRea
             LOG.trace("Previous length: {}, new length: {}", length, newLength);
             LOG.trace("New older than threshold: {}", newOlderThan);
 
-            if (newLength >= minLength && minAge == 0 && newLastModified == lastModified && newLength == length
-                    || minAge != 0 && newLastModified < newOlderThan) {
+            if (newLength >= minLength && ((minAge == 0 && newLastModified == lastModified && newLength == length)
+                    || (minAge != 0 && newLastModified < newOlderThan))) {
                 LOG.trace("Read lock acquired.");
                 exclusive = true;
             } else {