Author: niallp Date: Sat Mar 12 13:54:58 2011 New Revision: 1080934 URL: http://svn.apache.org/viewvc?rev=1080934&view=rev Log: IO-259 - simplify stop(long) method - just use Thread.join(long)
Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/monitor/FileAlterationMonitor.java Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/monitor/FileAlterationMonitor.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/monitor/FileAlterationMonitor.java?rev=1080934&r1=1080933&r2=1080934&view=diff ============================================================================== --- commons/proper/io/trunk/src/main/java/org/apache/commons/io/monitor/FileAlterationMonitor.java (original) +++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/monitor/FileAlterationMonitor.java Sat Mar 12 13:54:58 2011 @@ -154,8 +154,7 @@ public final class FileAlterationMonitor * Stop monitoring. * * @param stopInterval the amount of time in milliseconds to wait for the thread to finish. - * A value of zero will wait until the thread is finished (see {@link Thread#join(long)}) - * and a negative value will stop the process immediately). + * A value of zero will wait until the thread is finished (see {@link Thread#join(long)}). * @throws Exception if an error occurs initializing the observer * @since Commons IO 2.1 */ @@ -165,11 +164,7 @@ public final class FileAlterationMonitor } running = false; try { - if (stopInterval < 0) { - thread.interrupt(); - } else { - thread.join(stopInterval); - } + thread.join(stopInterval); } catch (InterruptedException e) { Thread.currentThread().interrupt(); }