Author: tv
Date: Wed Aug 10 20:30:12 2011
New Revision: 1156354
URL: http://svn.apache.org/viewvc?rev=1156354&view=rev
Log:
Fix problems reported by PMD and FindBugs
- finalize is public
- Exception is caught
Modified:
commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java
commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryReceiver.java
commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoverySender.java
commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryService.java
Modified:
commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java?rev=1156354&r1=1156353&r2=1156354&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java
Wed Aug 10 20:30:12 2011
@@ -29,7 +29,7 @@ import org.apache.jcs.engine.logging.beh
/**
* The RemoteCacheFailoverRunner tries to establish a connection with a
failover
- * server, if any are defined. Once a failover connectin is made, it will
+ * server, if any are defined. Once a failover connection is made, it will
* attempt to replace the failover with the primary remote server.
* <p>
* It works by switching out the RemoteCacheNoWait inside the Facade.
@@ -153,7 +153,7 @@ public class RemoteCacheFailoverRunner
// Monitor each RemoteCacheManager instance one after the
other.
// Each RemoteCacheManager corresponds to one remote
connection.
String[] failovers =
facade.remoteCacheAttributes.getFailovers();
- // we should probalby check to see if there are any failovers,
+ // we should probably check to see if there are any failovers,
// even though the caller
// should have already.
@@ -177,7 +177,7 @@ public class RemoteCacheFailoverRunner
// shouldn't we see if the primary is backup?
// If we don't check the primary, if it gets connected in the
- // backgorund,
+ // background,
// we will disconnect it only to put it right back
int i = fidx; // + 1; // +1 skips the primary
if ( log.isDebugEnabled() )
@@ -356,9 +356,9 @@ public class RemoteCacheFailoverRunner
ICache ic = rcm.getCache( rca.getCacheName() );
// by default the listener id should be 0, else it will be the
// listener
- // orignally associated with the remote cache. either way is fine.
+ // Originally associated with the remote cache. either way is fine.
// We just don't want the listener id from a failover being used.
- // If the remote server was rebooted this couldbe a problem if new
+ // If the remote server was rebooted this could be a problem if new
// locals were also added.
if ( ic != null )
@@ -458,7 +458,7 @@ public class RemoteCacheFailoverRunner
// else alright
// if the failover index was at 0 here, we would be in a bad
- // situation, unless there were jsut
+ // situation, unless there were just
// no failovers configured.
if ( log.isDebugEnabled() )
{
@@ -481,10 +481,10 @@ public class RemoteCacheFailoverRunner
}
/**
- * Sets the "alright" flag to false in a critial section. This flag
+ * Sets the "alright" flag to false in a critical section. This flag
* indicates whether or not we are connected to any server at all. If we
are
* connected to a secondary server, then alright will be true, but we will
- * continue to try to restore the connetion with the primary server.
+ * continue to try to restore the connection with the primary server.
* <p>
* The primary server is the first server defines in the FailoverServers
* list.
Modified:
commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java?rev=1156354&r1=1156353&r2=1156354&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
Wed Aug 10 20:30:12 2011
@@ -289,7 +289,7 @@ class RemoteCacheServer
// two clustered remote caches. The failover runner will
// have to make sure of this. ALos, the local cache needs
// avoid updating this source. Will need to pass the source
- // id somehow. The remote cache should udate all local
+ // id somehow. The remote cache should update all local
// caches
// but not update the cluster source. Cluster remote caches
// should only be updated by the server and not the
@@ -350,7 +350,7 @@ class RemoteCacheServer
}
}
}
- catch ( Exception e )
+ catch ( IOException e )
{
if ( cacheEventLogger != null )
{
Modified:
commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryReceiver.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryReceiver.java?rev=1156354&r1=1156353&r2=1156354&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryReceiver.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryReceiver.java
Wed Aug 10 20:30:12 2011
@@ -377,7 +377,7 @@ public class UDPDiscoveryReceiver
mSocket.close();
pooledExecutor.shutdownNow();
}
- catch ( Exception e )
+ catch ( IOException e )
{
log.error( "Problem closing socket" );
}
Modified:
commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoverySender.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoverySender.java?rev=1156354&r1=1156353&r2=1156354&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoverySender.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoverySender.java
Wed Aug 10 20:30:12 2011
@@ -111,7 +111,7 @@ public class UDPDiscoverySender
* @throws Throwable
*/
@Override
- public void finalize()
+ protected void finalize()
throws Throwable
{
super.finalize();
Modified:
commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryService.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryService.java?rev=1156354&r1=1156353&r2=1156354&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryService.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryService.java
Wed Aug 10 20:30:12 2011
@@ -412,7 +412,7 @@ public class UDPDiscoveryService
* @throws Throwable on error
*/
@Override
- public void finalize()
+ protected void finalize()
throws Throwable
{
super.finalize();