mattyb149 commented on code in PR #7664:
URL: https://github.com/apache/nifi/pull/7664#discussion_r1316681639


##########
nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/file/monitor/SynchronousFileWatcher.java:
##########
@@ -77,21 +77,16 @@ public boolean checkAndReset() throws IOException {
     private boolean checkForUpdate() throws IOException {
         if (resourceLock.tryLock()) {
             try {
-                final StateWrapper wrapper = lastState.get();
+                final Object oldState = lastState.get().getState();
                 final Object newState = monitor.getCurrentState(path);
-                if (newState == null && wrapper.getState() == null) {
+                if (newState == null && oldState == null) {
                     return false;
                 }
-                if (newState == null || wrapper.getState() == null) {
-                    lastState.set(new StateWrapper(newState));
+                lastState.set(new StateWrapper(newState));

Review Comment:
   Why the null checks then? Just to be defensive?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to