commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r1052118 - in /commons/proper/io/trunk/src: main/java/org/apache/commons/io/monitor/FileAlterationMonitor.java test/java/org/apache/commons/io/monitor/FileAlterationMonitorTestCase.java
Date Thu, 23 Dec 2010 00:32:35 GMT
Author: niallp
Date: Thu Dec 23 00:32:34 2010
New Revision: 1052118

URL: http://svn.apache.org/viewvc?rev=1052118&view=rev
Log:
IO-256 - Fix "Inconsistent Synchonization" on new ThreadFactory highlighted by FindBugs

Modified:
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/monitor/FileAlterationMonitor.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/monitor/FileAlterationMonitorTestCase.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=1052118&r1=1052117&r2=1052118&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
Thu Dec 23 00:32:34 2010
@@ -79,20 +79,11 @@ public final class FileAlterationMonitor
     }
 
     /**
-     * Return the thread factory.
-     *
-     * @return the threadFactory
-     */
-    public ThreadFactory getThreadFactory() {
-        return threadFactory;
-    }
-
-    /**
      * Set the thread factory.
      *
      * @param threadFactory the thread factory
      */
-    public void setThreadFactory(ThreadFactory threadFactory) {
+    public synchronized void setThreadFactory(ThreadFactory threadFactory) {
         this.threadFactory = threadFactory;
     }
 

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/monitor/FileAlterationMonitorTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/monitor/FileAlterationMonitorTestCase.java?rev=1052118&r1=1052117&r2=1052118&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/monitor/FileAlterationMonitorTestCase.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/monitor/FileAlterationMonitorTestCase.java
Thu Dec 23 00:32:34 2010
@@ -94,7 +94,6 @@ public class FileAlterationMonitorTestCa
             listener.clear();
             FileAlterationMonitor monitor = new FileAlterationMonitor(interval, observer);
             assertEquals("Interval", interval, monitor.getInterval());
-            assertNull("Thread Factory", monitor.getThreadFactory());
             monitor.start();
 
             try {
@@ -145,7 +144,6 @@ public class FileAlterationMonitorTestCa
             FileAlterationMonitor monitor = new FileAlterationMonitor(interval, observer);
             monitor.setThreadFactory(Executors.defaultThreadFactory());
             assertEquals("Interval", interval, monitor.getInterval());
-            assertNotNull("Thread Factory", monitor.getThreadFactory());
             monitor.start();
 
             // Create a File



Mime
View raw message