You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tv...@apache.org on 2014/02/23 12:15:48 UTC

svn commit: r1570995 - in /commons/proper/jcs/trunk/src: java/org/apache/commons/jcs/auxiliary/disk/jdbc/ java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/ java/org/apache/commons/jcs/utils/discovery/ java/org/apache/commons/jcs/utils/threadpoo...

Author: tv
Date: Sun Feb 23 11:15:47 2014
New Revision: 1570995

URL: http://svn.apache.org/r1570995
Log:
Clean up some FindBugs complaints

Modified:
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/threadpool/PoolConfiguration.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/access/CacheAccessUnitTest.java

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java?rev=1570995&r1=1570994&r2=1570995&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java Sun Feb 23 11:15:47 2014
@@ -791,7 +791,7 @@ public class JDBCDiskCache<K extends Ser
                 }
             }
         }
-        catch ( Exception e )
+        catch ( SQLException e )
         {
             log.error( "Problem updating cache.", e );
             reset();

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java?rev=1570995&r1=1570994&r2=1570995&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java Sun Feb 23 11:15:47 2014
@@ -149,7 +149,7 @@ public class LateralTCPListener<K extend
     /**
      * This starts the ListenerThread on the specified port.
      */
-    public void init()
+    public synchronized void init()
     {
         try
         {
@@ -496,7 +496,7 @@ public class LateralTCPListener<K extend
                     inner: while (true)
                     {
                         // Check to see if we've been asked to exit, and exit
-                        synchronized (this)
+                        synchronized (LateralTCPListener.this)
                         {
                             if (terminated)
                             {

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryAttributes.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryAttributes.java?rev=1570995&r1=1570994&r2=1570995&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryAttributes.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryAttributes.java Sun Feb 23 11:15:47 2014
@@ -26,7 +26,7 @@ package org.apache.commons.jcs.utils.dis
  * <p>
  * @author Aaron Smuts
  */
-public class UDPDiscoveryAttributes
+public final class UDPDiscoveryAttributes
     implements Cloneable
 {
     /** service name */

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/threadpool/PoolConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/threadpool/PoolConfiguration.java?rev=1570995&r1=1570994&r2=1570995&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/threadpool/PoolConfiguration.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/threadpool/PoolConfiguration.java Sun Feb 23 11:15:47 2014
@@ -24,7 +24,7 @@ package org.apache.commons.jcs.utils.thr
  * <p>
  * @author Aaron Smuts
  */
-public class PoolConfiguration
+public final class PoolConfiguration
     implements Cloneable
 {
     /** Should we bound the queue */

Modified: commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/access/CacheAccessUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/access/CacheAccessUnitTest.java?rev=1570995&r1=1570994&r2=1570995&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/access/CacheAccessUnitTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/access/CacheAccessUnitTest.java Sun Feb 23 11:15:47 2014
@@ -20,7 +20,6 @@ package org.apache.commons.jcs.access;
  */
 
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
@@ -294,12 +293,9 @@ public class CacheAccessUnitTest
         //System.out.println( result1 );
 
         // verify that the elements are unwrapped
-        Set<String> keySet1 = result1.keySet();
-        Iterator<String> it1 = keySet1.iterator();
-        while ( it1.hasNext() )
+        for (Map.Entry<String, Integer> entry : result1.entrySet())
         {
-            Object key = it1.next();
-            Object value = result1.get( key );
+            Object value = entry.getValue();
             assertFalse( "Should not be a cache element.", value instanceof ICacheElement );
         }
     }
@@ -351,12 +347,9 @@ public class CacheAccessUnitTest
         //System.out.println( result1 );
 
         // verify that the elements are wrapped
-        Set<String> keySet1 = result1.keySet();
-        Iterator<String> it1 = keySet1.iterator();
-        while ( it1.hasNext() )
+        for (Map.Entry<String, ICacheElement<String, Integer>> entry : result1.entrySet())
         {
-            Object key = it1.next();
-            Object value = result1.get( key );
+            Object value = entry.getValue();
             assertTrue( "Should be a cache element.", value instanceof ICacheElement );
         }
     }