This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 85da480 Fix read-lock behavior (#5816)
85da480 is described below
commit 85da480b5099de24656e4890633780d3e9d90894
Author: Philippe Schaller <[email protected]>
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 {