From 1460db2b0defdb55bd954b5bf548511a46fac040 Mon Sep 17 00:00:00 2001 From: ribeaudc <ribeaudc> Date: Tue, 27 May 2008 18:51:44 +0000 Subject: [PATCH] fix: - 'common' Unit tests. SVN: 6329 --- .../common/utilities/DirectoryScanningTimerTask.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/common/source/java/ch/systemsx/cisd/common/utilities/DirectoryScanningTimerTask.java b/common/source/java/ch/systemsx/cisd/common/utilities/DirectoryScanningTimerTask.java index b47fa208f41..bb726f95525 100644 --- a/common/source/java/ch/systemsx/cisd/common/utilities/DirectoryScanningTimerTask.java +++ b/common/source/java/ch/systemsx/cisd/common/utilities/DirectoryScanningTimerTask.java @@ -52,14 +52,10 @@ public final class DirectoryScanningTimerTask extends TimerTask private final IScannedStore sourceDirectory; - /** - * The number of consecutive errors of reading a directory that need to occur before the event - * is logged. - */ - private final int ignoredErrorCount; - private final IDirectoryScanningHandler directoryScanningHandler; + private final ConditionalNotificationLogger notificationLogger; + /** * Creates a <var>DirectoryScanningTimerTask</var>. * @@ -121,10 +117,10 @@ public final class DirectoryScanningTimerTask extends TimerTask assert directoryScanningHandler != null : "Unspecified IDirectoryScanningHandler implementation"; assert ignoredErrorCount >= 0; - this.ignoredErrorCount = ignoredErrorCount; this.sourceDirectory = scannedStore; this.storeHandler = storeHandler; this.directoryScanningHandler = directoryScanningHandler; + this.notificationLogger = new ConditionalNotificationLogger(getClass(), ignoredErrorCount); } /** @@ -212,8 +208,6 @@ public final class DirectoryScanningTimerTask extends TimerTask private final StoreItem[] listStoreItems() { - final ConditionalNotificationLogger notificationLogger = - new ConditionalNotificationLogger(getClass(), ignoredErrorCount); final StoreItem[] storeItems = sourceDirectory.tryListSortedReadyToProcess(notificationLogger); if (storeItems != null) -- GitLab