You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2014/04/03 02:45:50 UTC
svn commit: r1584231 - 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/auxiliary/remote/server/
java/org/apache/commons/jcs/engine/...
Author: sebb
Date: Thu Apr 3 00:45:50 2014
New Revision: 1584231
URL: http://svn.apache.org/r1584231
Log:
Avoid name hiding
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/LateralTCPSender.java
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/CacheEventQueue.java
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/config/OptionConverter.java
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryService.java
commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/JCSThrashTest.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=1584231&r1=1584230&r2=1584231&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 Thu Apr 3 00:45:50 2014
@@ -151,18 +151,18 @@ public class JDBCDiskCache<K extends Ser
protected JDBCDiskCachePoolAccess initializePoolAccess( JDBCDiskCacheAttributes cattr,
ICompositeCacheManager compositeCacheManager )
{
- JDBCDiskCachePoolAccess poolAccess = null;
+ JDBCDiskCachePoolAccess poolAccess1 = null;
if ( cattr.getConnectionPoolName() != null )
{
JDBCDiskCachePoolAccessManager manager = JDBCDiskCachePoolAccessManager.getInstance( compositeCacheManager
.getConfigurationProperties() );
- poolAccess = manager.getJDBCDiskCachePoolAccess( cattr.getConnectionPoolName() );
+ poolAccess1 = manager.getJDBCDiskCachePoolAccess( cattr.getConnectionPoolName() );
}
else
{
try
{
- poolAccess = JDBCDiskCachePoolAccessFactory.createPoolAccess( cattr );
+ poolAccess1 = JDBCDiskCachePoolAccessFactory.createPoolAccess( cattr );
}
catch ( Exception e )
{
@@ -171,7 +171,7 @@ public class JDBCDiskCache<K extends Ser
log.error( "Problem getting connection.", e );
}
}
- return poolAccess;
+ return poolAccess1;
}
/**
Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java?rev=1584231&r1=1584230&r2=1584231&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java Thu Apr 3 00:45:50 2014
@@ -120,9 +120,8 @@ public class LateralTCPSender
// have time out socket open do this for us
try
{
- InetSocketAddress address = new InetSocketAddress( host, port );
socket = new Socket();
- socket.connect( address, tcpLateralCacheAttributes.getOpenTimeOut() );
+ socket.connect( new InetSocketAddress( host, port ), tcpLateralCacheAttributes.getOpenTimeOut() );
}
catch ( IOException ioe )
{
Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java?rev=1584231&r1=1584230&r2=1584231&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java Thu Apr 3 00:45:50 2014
@@ -461,8 +461,8 @@ public class RemoteCacheServerFactory
// shutdown
if ( args.length > 0 && args[0].toLowerCase().indexOf( "-shutdown" ) != -1 )
{
- String serviceName = prop.getProperty( REMOTE_CACHE_SERVICE_NAME, REMOTE_CACHE_SERVICE_VAL ).trim();
- String registry = "//:" + port + "/" + serviceName;
+ String remoteServiceName = prop.getProperty( REMOTE_CACHE_SERVICE_NAME, REMOTE_CACHE_SERVICE_VAL ).trim();
+ String registry = "//:" + port + "/" + remoteServiceName;
if ( log.isDebugEnabled() )
{
@@ -494,8 +494,8 @@ public class RemoteCacheServerFactory
try
{
- String serviceName = prop.getProperty( REMOTE_CACHE_SERVICE_NAME, REMOTE_CACHE_SERVICE_VAL ).trim();
- String registry = "//:" + port + "/" + serviceName;
+ String sz = prop.getProperty( REMOTE_CACHE_SERVICE_NAME, REMOTE_CACHE_SERVICE_VAL ).trim();
+ String registry = "//:" + port + "/" + sz;
log.debug( "looking up server " + registry );
Object obj = Naming.lookup( registry );
log.debug( "server found" );
Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/CacheEventQueue.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/CacheEventQueue.java?rev=1584231&r1=1584230&r2=1584231&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/CacheEventQueue.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/CacheEventQueue.java Thu Apr 3 00:45:50 2014
@@ -383,13 +383,13 @@ public class CacheEventQueue<K extends S
se.setData( "" + this.isEmpty() );
elems.add( se );
- int size = 0;
+ int sz = 0;
synchronized ( queueLock )
{
// wait until there is something to read
if ( head == tail )
{
- size = 0;
+ sz = 0;
}
else
{
@@ -397,13 +397,13 @@ public class CacheEventQueue<K extends S
while ( n != null )
{
n = n.next;
- size++;
+ sz++;
}
}
se = new StatElement();
se.setName( "Size" );
- se.setData( "" + size );
+ se.setData( "" + sz );
elems.add( se );
}
Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/config/OptionConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/config/OptionConverter.java?rev=1584231&r1=1584230&r2=1584231&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/config/OptionConverter.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/config/OptionConverter.java Thu Apr 3 00:45:50 2014
@@ -82,7 +82,7 @@ public class OptionConverter
{
char c;
int len = s.length();
- StringBuffer sbuf = new StringBuffer( len );
+ StringBuffer sb = new StringBuffer( len );
int i = 0;
while ( i < len )
@@ -124,9 +124,9 @@ public class OptionConverter
c = '\\';
}
}
- sbuf.append( c );
+ sb.append( c );
}
- return sbuf.toString();
+ return sb.toString();
}
/**
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=1584231&r1=1584230&r2=1584231&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 Thu Apr 3 00:45:50 2014
@@ -138,15 +138,15 @@ public class UDPDiscoveryService
*/
protected void serviceRequestBroadcast()
{
- UDPDiscoverySender sender = null;
+ UDPDiscoverySender sender1 = null;
try
{
// create this connection each time.
// more robust
- sender = new UDPDiscoverySender( getUdpDiscoveryAttributes().getUdpDiscoveryAddr(),
+ sender1 = new UDPDiscoverySender( getUdpDiscoveryAttributes().getUdpDiscoveryAddr(),
getUdpDiscoveryAttributes().getUdpDiscoveryPort() );
- sender.passiveBroadcast( getUdpDiscoveryAttributes().getServiceAddress(), getUdpDiscoveryAttributes()
+ sender1.passiveBroadcast( getUdpDiscoveryAttributes().getServiceAddress(), getUdpDiscoveryAttributes()
.getServicePort(), this.getCacheNames() );
// todo we should consider sending a request broadcast every so
@@ -167,9 +167,9 @@ public class UDPDiscoveryService
{
try
{
- if ( sender != null )
+ if ( sender1 != null )
{
- sender.destroy();
+ sender1.destroy();
}
}
catch ( Exception e )
Modified: commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/JCSThrashTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/JCSThrashTest.java?rev=1584231&r1=1584230&r2=1584231&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/JCSThrashTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/JCSThrashTest.java Thu Apr 3 00:45:50 2014
@@ -178,10 +178,10 @@ public class JCSThrashTest
public void execute()
throws Exception
{
- for ( int i = 0; i < 500; i++ )
+ for ( int j = 0; j < 500; j++ )
{
- final String key = "key" + i;
- jcs.get( key );
+ final String keyj = "key" + j;
+ jcs.get( keyj );
}
jcs.get( "key" );
}
@@ -201,12 +201,12 @@ public class JCSThrashTest
{
// Add a bunch of entries
- for ( int i = 0; i < 500; i++ )
+ for ( int j = 0; j < 500; j++ )
{
// Use a random length value
- final String key = "key" + i;
- byte[] value = new byte[10000];
- jcs.put( key, value );
+ final String keyj = "key" + j;
+ byte[] valuej = new byte[10000];
+ jcs.put( keyj, valuej );
}
}
};