Skip to content
Snippets Groups Projects
Commit 071a7c14 authored by ribeaudc's avatar ribeaudc
Browse files

minor:

- Message to assertions added.
- Some 'final' keywords added.
- Some assertions added.

SVN: 3356
parent 262879f9
No related branches found
No related tags found
No related merge requests found
...@@ -72,7 +72,7 @@ public class FileWatcherSynchronizer extends TimerTask ...@@ -72,7 +72,7 @@ public class FileWatcherSynchronizer extends TimerTask
return instance; return instance;
} }
private final synchronized void fireStateChanged(FileWatcher fileWatcher) private final synchronized void fireStateChanged(final FileWatcher fileWatcher)
{ {
final ChangeEvent event = new ChangeEvent(fileWatcher.getFileToWatch()); final ChangeEvent event = new ChangeEvent(fileWatcher.getFileToWatch());
for (ChangeListener listener : fileWatcherListeners.get(fileWatcher)) for (ChangeListener listener : fileWatcherListeners.get(fileWatcher))
...@@ -122,18 +122,18 @@ public class FileWatcherSynchronizer extends TimerTask ...@@ -122,18 +122,18 @@ public class FileWatcherSynchronizer extends TimerTask
public final synchronized void removeChangeListener(final File file, final ChangeListener changeListener) public final synchronized void removeChangeListener(final File file, final ChangeListener changeListener)
{ {
FileWatcher fileWatcher = fileWatchers.get(file); final FileWatcher fileWatcher = fileWatchers.get(file);
if (fileWatcher == null) if (fileWatcher == null)
{ {
return; return;
} }
List<ChangeListener> listeners = fileWatcherListeners.get(fileWatcher); final List<ChangeListener> listeners = fileWatcherListeners.get(fileWatcher);
if (listeners == null) if (listeners == null)
{ {
return; return;
} }
listeners.remove(changeListener); listeners.remove(changeListener);
int size = listeners.size(); final int size = listeners.size();
if (operationLog.isDebugEnabled()) if (operationLog.isDebugEnabled())
{ {
operationLog.debug(String.format( operationLog.debug(String.format(
...@@ -153,12 +153,12 @@ public class FileWatcherSynchronizer extends TimerTask ...@@ -153,12 +153,12 @@ public class FileWatcherSynchronizer extends TimerTask
*/ */
public final synchronized ChangeListener[] getChangeListeners(final File file) public final synchronized ChangeListener[] getChangeListeners(final File file)
{ {
FileWatcher fileWatcher = fileWatchers.get(file); final FileWatcher fileWatcher = fileWatchers.get(file);
if (fileWatcher == null) if (fileWatcher == null)
{ {
return null; return null;
} }
List<ChangeListener> listeners = fileWatcherListeners.get(fileWatcher); final List<ChangeListener> listeners = fileWatcherListeners.get(fileWatcher);
if (listeners == null) if (listeners == null)
{ {
return null; return null;
...@@ -180,7 +180,7 @@ public class FileWatcherSynchronizer extends TimerTask ...@@ -180,7 +180,7 @@ public class FileWatcherSynchronizer extends TimerTask
@Override @Override
public final synchronized void run() public final synchronized void run()
{ {
for (FileWatcher fileWatcher : fileWatcherListeners.keySet()) for (final FileWatcher fileWatcher : fileWatcherListeners.keySet())
{ {
fileWatcher.run(); fileWatcher.run();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment