diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java b/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java index a16ee29a9c..06cce46b1e 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java @@ -345,6 +345,7 @@ public class FileReadingMessageSource extends IntegrationObjectSupport implement } + @Override public Message receive() throws MessagingException { Message message = null; @@ -530,7 +531,7 @@ public class FileReadingMessageSource extends IntegrationObjectSupport implement "] with context [" + event.context() + "]"); } - for (WatchKey watchKey : pathKeys.values()) { + for (WatchKey watchKey : this.pathKeys.values()) { watchKey.cancel(); } this.pathKeys.clear();