Author: tv
Date: Wed Apr 2 08:42:29 2014
New Revision: 1583929
URL: http://svn.apache.org/r1583929
Log:
Fix some more PMD complaints
Added:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMISocketFactory.java
(contents, props changed)
- copied, changed from r1583899,
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMIScoketFactory.java
Removed:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMIScoketFactory.java
Modified:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcher.java
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/AbstractCacheEventQueue.java
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/ElementAttributes.java
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCache.java
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCacheConfigurator.java
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/event/ElementEventQueue.java
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/memory/AbstractDoubleLinkedListMemoryCache.java
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/memory/shrinking/ShrinkerThread.java
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryManager.java
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryReceiver.java
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryService.java
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/props/PropertyLoader.java
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/struct/SortedPreferentialArray.java
commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactoryUnitTest.java
commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMIScoketFactoryUnitTest.java
commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/discovery/UDPDiscoveryServiceUnitTest.java
commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/discovery/UDPDiscoveryUnitTest.java
Modified:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java
Wed Apr 2 08:42:29 2014
@@ -212,8 +212,7 @@ public class LateralTCPCacheFactory
// get dereferenced, also we don't want one for every region.
discovery = UDPDiscoveryManager.getInstance().getService(
lac.getUdpDiscoveryAddr(),
lac.getUdpDiscoveryPort(),
-
lac.getTcpListenerPort(), cacheMgr,
-
cacheEventLogger );
+
lac.getTcpListenerPort(), cacheMgr);
discovery.addParticipatingCacheName( lac.getCacheName() );
discovery.addDiscoveryListener( discoveryListener );
Modified:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcher.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcher.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcher.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcher.java
Wed Apr 2 08:42:29 2014
@@ -133,7 +133,7 @@ public class RemoteHttpCacheDispatcher
try
{
- if ( baseUrl != null && ( baseUrl.indexOf( "?" ) == -1 ) )
+ if ( baseUrl != null && baseUrl.indexOf( "?" ) == -1 )
{
url.append( "?" );
}
Copied:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMISocketFactory.java
(from r1583899,
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMIScoketFactory.java)
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMISocketFactory.java?p2=commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMISocketFactory.java&p1=commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMIScoketFactory.java&r1=1583899&r2=1583929&rev=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMIScoketFactory.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMISocketFactory.java
Wed Apr 2 08:42:29 2014
@@ -30,12 +30,12 @@ import java.rmi.server.RMISocketFactory;
* This can be injected into the the remote cache server as follows:
*
* <pre>
- *
jcs.remotecache.customrmisocketfactory=org.apache.commons.jcs.auxiliary.remote.server.TimeoutConfigurableRMIScoketFactory
+ *
jcs.remotecache.customrmisocketfactory=org.apache.commons.jcs.auxiliary.remote.server.TimeoutConfigurableRMISocketFactory
* jcs.remotecache.customrmisocketfactory.readTimeout=5000
* jcs.remotecache.customrmisocketfactory.openTimeout=5000
* </pre>
*/
-public class TimeoutConfigurableRMIScoketFactory
+public class TimeoutConfigurableRMISocketFactory
extends RMISocketFactory
implements Serializable
{
Propchange:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMISocketFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/AbstractCacheEventQueue.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/AbstractCacheEventQueue.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/AbstractCacheEventQueue.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/AbstractCacheEventQueue.java
Wed Apr 2 08:42:29 2014
@@ -111,7 +111,7 @@ public abstract class AbstractCacheEvent
*/
public synchronized boolean isAlive()
{
- return ( !destroyed );
+ return !destroyed;
}
/**
Modified:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/ElementAttributes.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/ElementAttributes.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/ElementAttributes.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/ElementAttributes.java
Wed Apr 2 08:42:29 2014
@@ -242,7 +242,7 @@ public class ElementAttributes
public long getTimeToLiveSeconds()
{
long now = System.currentTimeMillis();
- return ( ( this.getCreateTime() + ( this.getMaxLifeSeconds() * 1000 )
) - now ) / 1000;
+ return ( this.getCreateTime() + this.getMaxLifeSeconds() * 1000 - now
) / 1000;
}
/**
Modified:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCache.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCache.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCache.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCache.java
Wed Apr 2 08:42:29 2014
@@ -108,9 +108,6 @@ public class CompositeCache<K extends Se
/** Auxiliary cache hit count (number of times found in ANY auxiliary) */
private int hitCountAux;
- /** Auxiliary hit counts broken down by auxiliary. */
- private int[] auxHitCountByIndex;
-
/** Count of misses where element was not found. */
private int missCountNotFound = 0;
@@ -155,11 +152,6 @@ public class CompositeCache<K extends Se
public void setAuxCaches( AuxiliaryCache<K, V>[] auxCaches )
{
this.auxCaches = auxCaches;
-
- if ( auxCaches != null )
- {
- this.auxHitCountByIndex = new int[auxCaches.length];
- }
}
/**
@@ -344,7 +336,7 @@ public class CompositeCache<K extends Se
log.debug( "diskcache in aux list: cattr " +
cacheAttr.isUseDisk() );
}
if ( cacheAttr.isUseDisk()
- && ( cacheAttr.getDiskUsagePattern() ==
DiskUsagePattern.UPDATE )
+ && cacheAttr.getDiskUsagePattern() ==
DiskUsagePattern.UPDATE
&& cacheElement.getElementAttributes().getIsSpool() )
{
aux.update( cacheElement );
@@ -579,8 +571,6 @@ public class CompositeCache<K extends Se
// Update counters
hitCountAux++;
- auxHitCountByIndex[i]++;
-
copyAuxiliaryRetrievedItemToMemory(
element );
}
@@ -682,7 +672,7 @@ public class CompositeCache<K extends Se
// if we didn't find all the elements, increment the miss count by the
number of elements not found
if ( elements.size() != keys.size() )
{
- missCountNotFound += ( keys.size() - elements.size() );
+ missCountNotFound += keys.size() - elements.size();
if ( log.isDebugEnabled() )
{
@@ -996,8 +986,6 @@ public class CompositeCache<K extends Se
// Update counters
hitCountAux++;
- auxHitCountByIndex[i]++;
-
copyAuxiliaryRetrievedItemToMemory( element );
}
}
@@ -1087,7 +1075,7 @@ public class CompositeCache<K extends Se
// not get updated.
// you will need to set the idle time to -1.
- if ( ( idleTime != -1 ) && ( now - lastAccessTime ) > (
idleTime * 1000 ) )
+ if ( ( idleTime != -1 ) && ( now - lastAccessTime ) > idleTime
* 1000 )
{
if ( log.isDebugEnabled() )
{
@@ -1553,7 +1541,7 @@ public class CompositeCache<K extends Se
auxStats[i + 1] = aux.getStatistics();
}
- // sore the auxiliary stats
+ // store the auxiliary stats
stats.setAuxiliaryCacheStats( auxStats );
return stats;
Modified:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCacheConfigurator.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCacheConfigurator.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCacheConfigurator.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCacheConfigurator.java
Wed Apr 2 08:42:29 2014
@@ -239,7 +239,7 @@ public class CompositeCacheConfigurator
while ( en.hasMoreElements() )
{
String key = (String) en.nextElement();
- if ( key.startsWith( SYSTEM_REGION_PREFIX ) && ( key.indexOf(
"attributes" ) == -1 ) )
+ if ( key.startsWith( SYSTEM_REGION_PREFIX ) && key.indexOf(
"attributes" ) == -1 )
{
String regionName = key.substring(
SYSTEM_REGION_PREFIX.length() );
String value = OptionConverter.findAndSubst( key, props );
@@ -269,7 +269,7 @@ public class CompositeCacheConfigurator
while ( en.hasMoreElements() )
{
String key = (String) en.nextElement();
- if ( key.startsWith( REGION_PREFIX ) && ( key.indexOf(
"attributes" ) == -1 ) )
+ if ( key.startsWith( REGION_PREFIX ) && key.indexOf( "attributes"
) == -1 )
{
String regionName = key.substring( REGION_PREFIX.length() );
Modified:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/event/ElementEventQueue.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/event/ElementEventQueue.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/event/ElementEventQueue.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/event/ElementEventQueue.java
Wed Apr 2 08:42:29 2014
@@ -168,7 +168,7 @@ public class ElementEventQueue
*/
public boolean isAlive()
{
- return ( !destroyed );
+ return !destroyed;
}
/**
Modified:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/memory/AbstractDoubleLinkedListMemoryCache.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/memory/AbstractDoubleLinkedListMemoryCache.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/memory/AbstractDoubleLinkedListMemoryCache.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/memory/AbstractDoubleLinkedListMemoryCache.java
Wed Apr 2 08:42:29 2014
@@ -118,7 +118,7 @@ public abstract class AbstractDoubleLink
MemoryElementDescriptor<K, V> oldNode = map.put(
newNode.ce.getKey(), newNode );
// If the node was the same as an existing node, remove it.
- if ( oldNode != null && ( newNode.ce.getKey().equals(
oldNode.ce.getKey() ) ) )
+ if ( oldNode != null && newNode.ce.getKey().equals(
oldNode.ce.getKey() ) )
{
list.remove( oldNode );
}
Modified:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/memory/shrinking/ShrinkerThread.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/memory/shrinking/ShrinkerThread.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/memory/shrinking/ShrinkerThread.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/memory/shrinking/ShrinkerThread.java
Wed Apr 2 08:42:29 2014
@@ -164,9 +164,9 @@ public class ShrinkerThread<K extends Se
// If the item is not removed, check is it has been idle
// long enough to be spooled.
- if ( !remove && ( maxMemoryIdleTime != -1 ) )
+ if ( !remove && maxMemoryIdleTime != -1 )
{
- if ( !spoolLimit || ( spoolCount < this.maxSpoolPerRun ) )
+ if ( !spoolLimit || spoolCount < this.maxSpoolPerRun )
{
final long lastAccessTime =
attributes.getLastAccessTime();
@@ -202,7 +202,7 @@ public class ShrinkerThread<K extends Se
}
// stop processing if limit has been reached.
- if ( spoolLimit && ( spoolCount >= this.maxSpoolPerRun
) )
+ if ( spoolLimit && spoolCount >= this.maxSpoolPerRun )
{
keys = null;
return;
Modified:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryManager.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryManager.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryManager.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryManager.java
Wed Apr 2 08:42:29 2014
@@ -25,7 +25,6 @@ import java.util.Map;
import org.apache.commons.jcs.engine.behavior.ICompositeCacheManager;
import org.apache.commons.jcs.engine.behavior.IProvideScheduler;
import org.apache.commons.jcs.engine.behavior.IShutdownObservable;
-import org.apache.commons.jcs.engine.logging.behavior.ICacheEventLogger;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -72,12 +71,10 @@ public class UDPDiscoveryManager
* @param discoveryPort
* @param servicePort
* @param cacheMgr
- * @param cacheEventLogger
* @return UDPDiscoveryService
*/
public synchronized UDPDiscoveryService getService( String
discoveryAddress, int discoveryPort, int servicePort,
- ICompositeCacheManager
cacheMgr,
- ICacheEventLogger
cacheEventLogger )
+ ICompositeCacheManager
cacheMgr )
{
String key = discoveryAddress + ":" + discoveryPort + ":" +
servicePort;
@@ -94,7 +91,7 @@ public class UDPDiscoveryManager
attributes.setUdpDiscoveryPort( discoveryPort );
attributes.setServicePort( servicePort );
- service = new UDPDiscoveryService( attributes, cacheEventLogger );
+ service = new UDPDiscoveryService( attributes );
// register for shutdown notification
if ( cacheMgr instanceof IShutdownObservable )
Modified:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryReceiver.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryReceiver.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryReceiver.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryReceiver.java
Wed Apr 2 08:42:29 2014
@@ -168,7 +168,7 @@ public class UDPDiscoveryReceiver
final ObjectInputStream objectStream = new ObjectInputStream(
byteStream );
obj = objectStream.readObject();
- if ( (obj != null) && (obj instanceof UDPDiscoveryMessage) )
+ if ( obj != null && obj instanceof UDPDiscoveryMessage )
{
// Ensure that the address we're supposed to send to is,
indeed, the address
// of the machine on the other end of this connection. This
guards against
Modified:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryService.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryService.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryService.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryService.java
Wed Apr 2 08:42:29 2014
@@ -29,7 +29,6 @@ import java.util.concurrent.TimeUnit;
import org.apache.commons.jcs.engine.behavior.IRequireScheduler;
import org.apache.commons.jcs.engine.behavior.IShutdownObserver;
-import org.apache.commons.jcs.engine.logging.behavior.ICacheEventLogger;
import org.apache.commons.jcs.utils.discovery.behavior.IDiscoveryListener;
import org.apache.commons.jcs.utils.net.HostNameUtil;
import org.apache.commons.logging.Log;
@@ -76,9 +75,8 @@ public class UDPDiscoveryService
/**
* @param attributes
- * @param cacheEventLogger
*/
- public UDPDiscoveryService( UDPDiscoveryAttributes attributes,
ICacheEventLogger cacheEventLogger )
+ public UDPDiscoveryService( UDPDiscoveryAttributes attributes)
{
udpDiscoveryAttributes = (UDPDiscoveryAttributes) attributes.clone();
Modified:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/props/PropertyLoader.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/props/PropertyLoader.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/props/PropertyLoader.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/props/PropertyLoader.java
Wed Apr 2 08:42:29 2014
@@ -141,7 +141,7 @@ public abstract class PropertyLoader
}
}
- if ( THROW_ON_LOAD_FAILURE && ( result == null ) )
+ if ( THROW_ON_LOAD_FAILURE && result == null )
{
throw new IllegalArgumentException( "could not load [" + fileName
+ "]" + " as " + "a classloader resource" );
}
Modified:
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/struct/SortedPreferentialArray.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/struct/SortedPreferentialArray.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/struct/SortedPreferentialArray.java
(original)
+++
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/struct/SortedPreferentialArray.java
Wed Apr 2 08:42:29 2014
@@ -479,7 +479,7 @@ public class SortedPreferentialArray<T e
// EQUAL TO
// object at current position is equal to the obj, use this,
// TODO could avoid some shuffling if I found a lower pos.
- if ((array[curPos]).compareTo( obj ) == 0 )
+ if (array[curPos].compareTo( obj ) == 0 )
{
if ( log.isDebugEnabled() )
{
@@ -494,7 +494,7 @@ public class SortedPreferentialArray<T e
// GREATER THAN
// array object at current position is greater than the obj, go
// left
- if ((array[curPos]).compareTo( obj ) > 0 )
+ if (array[curPos].compareTo( obj ) > 0 )
{
if ( log.isDebugEnabled() )
{
@@ -514,7 +514,7 @@ public class SortedPreferentialArray<T e
// LESS THAN
// the object at the current position is smaller, go right
- if ((array[curPos]).compareTo( obj ) < 0 )
+ if (array[curPos].compareTo( obj ) < 0 )
{
if ( log.isDebugEnabled() )
{
Modified:
commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactoryUnitTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactoryUnitTest.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactoryUnitTest.java
(original)
+++
commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactoryUnitTest.java
Wed Apr 2 08:42:29 2014
@@ -202,7 +202,7 @@ public class RemoteCacheServerFactoryUni
int readTimeout = 1234;
int openTimeout = 1234;
Properties props = new Properties();
- props.put(
IRemoteCacheConstants.CUSTOM_RMI_SOCKET_FACTORY_PROPERTY_PREFIX,
TimeoutConfigurableRMIScoketFactory.class.getName() );
+ props.put(
IRemoteCacheConstants.CUSTOM_RMI_SOCKET_FACTORY_PROPERTY_PREFIX,
TimeoutConfigurableRMISocketFactory.class.getName() );
props.put(
IRemoteCacheConstants.CUSTOM_RMI_SOCKET_FACTORY_PROPERTY_PREFIX +
".readTimeout", String.valueOf( readTimeout ) );
props.put(
IRemoteCacheConstants.CUSTOM_RMI_SOCKET_FACTORY_PROPERTY_PREFIX +
".openTimeout", String.valueOf( openTimeout ) );
@@ -211,7 +211,7 @@ public class RemoteCacheServerFactoryUni
// VERIFY
assertNotNull( "Should have a custom socket factory.", result );
- assertEquals( "Wrong readTimeout", readTimeout,
((TimeoutConfigurableRMIScoketFactory)result).getReadTimeout() );
- assertEquals( "Wrong readTimeout", openTimeout,
((TimeoutConfigurableRMIScoketFactory)result).getOpenTimeout() );
+ assertEquals( "Wrong readTimeout", readTimeout,
((TimeoutConfigurableRMISocketFactory)result).getReadTimeout() );
+ assertEquals( "Wrong readTimeout", openTimeout,
((TimeoutConfigurableRMISocketFactory)result).getOpenTimeout() );
}
}
Modified:
commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMIScoketFactoryUnitTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMIScoketFactoryUnitTest.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMIScoketFactoryUnitTest.java
(original)
+++
commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMIScoketFactoryUnitTest.java
Wed Apr 2 08:42:29 2014
@@ -39,7 +39,7 @@ public class TimeoutConfigurableRMIScoke
// SETUP
int port = 3455;
String host = "localhost";
- TimeoutConfigurableRMIScoketFactory factory = new
TimeoutConfigurableRMIScoketFactory();
+ TimeoutConfigurableRMISocketFactory factory = new
TimeoutConfigurableRMISocketFactory();
// DO WORK
ServerSocket serverSocket = factory.createServerSocket( port );
Modified:
commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/discovery/UDPDiscoveryServiceUnitTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/discovery/UDPDiscoveryServiceUnitTest.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/discovery/UDPDiscoveryServiceUnitTest.java
(original)
+++
commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/discovery/UDPDiscoveryServiceUnitTest.java
Wed Apr 2 08:42:29 2014
@@ -23,8 +23,6 @@ import java.util.ArrayList;
import junit.framework.TestCase;
-import org.apache.commons.jcs.auxiliary.MockCacheEventLogger;
-
/** Unit tests for the service. */
public class UDPDiscoveryServiceUnitTest
extends TestCase
@@ -41,7 +39,7 @@ public class UDPDiscoveryServiceUnitTest
attributes.setServicePort( 1000 );
// create the service
- UDPDiscoveryService service = new UDPDiscoveryService( attributes, new
MockCacheEventLogger() );
+ UDPDiscoveryService service = new UDPDiscoveryService( attributes );
service.addParticipatingCacheName( "testCache1" );
MockDiscoveryListener discoveryListener = new MockDiscoveryListener();
@@ -75,7 +73,7 @@ public class UDPDiscoveryServiceUnitTest
attributes.setServicePort( 1000 );
// create the service
- UDPDiscoveryService service = new UDPDiscoveryService( attributes, new
MockCacheEventLogger() );
+ UDPDiscoveryService service = new UDPDiscoveryService( attributes );
service.addParticipatingCacheName( "testCache1" );
MockDiscoveryListener discoveryListener = new MockDiscoveryListener();
@@ -137,7 +135,7 @@ public class UDPDiscoveryServiceUnitTest
attributes.setServicePort( 1000 );
// create the service
- UDPDiscoveryService service = new UDPDiscoveryService( attributes, new
MockCacheEventLogger() );
+ UDPDiscoveryService service = new UDPDiscoveryService( attributes );
service.addParticipatingCacheName( "testCache1" );
MockDiscoveryListener discoveryListener = new MockDiscoveryListener();
@@ -198,7 +196,7 @@ public class UDPDiscoveryServiceUnitTest
attributes.setServicePort( 1000 );
// create the service
- UDPDiscoveryService service = new UDPDiscoveryService( attributes, new
MockCacheEventLogger() );
+ UDPDiscoveryService service = new UDPDiscoveryService( attributes );
service.addParticipatingCacheName( "testCache1" );
MockDiscoveryListener discoveryListener = new MockDiscoveryListener();
Modified:
commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/discovery/UDPDiscoveryUnitTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/discovery/UDPDiscoveryUnitTest.java?rev=1583929&r1=1583928&r2=1583929&view=diff
==============================================================================
---
commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/discovery/UDPDiscoveryUnitTest.java
(original)
+++
commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/discovery/UDPDiscoveryUnitTest.java
Wed Apr 2 08:42:29 2014
@@ -23,7 +23,6 @@ import java.util.ArrayList;
import junit.framework.TestCase;
-import org.apache.commons.jcs.auxiliary.MockCacheEventLogger;
import org.apache.commons.jcs.utils.timing.SleepUtil;
/**
@@ -45,7 +44,7 @@ public class UDPDiscoveryUnitTest
attributes.setServicePort( 1000 );
// create the service
- UDPDiscoveryService service = new UDPDiscoveryService( attributes, new
MockCacheEventLogger() );
+ UDPDiscoveryService service = new UDPDiscoveryService( attributes );
service.addParticipatingCacheName( "testCache1" );
MockDiscoveryListener discoveryListener = new MockDiscoveryListener();