You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-dev@jakarta.apache.org by as...@apache.org on 2005/12/03 03:40:41 UTC

svn commit: r351876 - in /jakarta/jcs/trunk/src: java/org/apache/jcs/config/ java/org/apache/jcs/engine/control/ java/org/apache/jcs/engine/memory/ java/org/apache/jcs/engine/memory/lru/ java/org/apache/jcs/utils/data/ java/org/apache/jcs/utils/props/ ...

Author: asmuts
Date: Fri Dec  2 18:40:21 2005
New Revision: 351876

URL: http://svn.apache.org/viewcvs?rev=351876&view=rev
Log:
Fixed remaining eclipse warnings.
Moved consistency check in LRU Memory Cache into a synchronized block to prevent 
false error detection.
Synchronized the public methods on the Sorted Pref Array for the time being.

Modified:
    jakarta/jcs/trunk/src/java/org/apache/jcs/config/OptionConverter.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/config/PropertySetter.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheManager.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/MemoryCache.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/utils/data/PropertyGroups.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/utils/props/PropertyLoader.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/utils/servlet/BasicHttpAuthenticator.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMap.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/SortedPreferentialArray.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/PoolConfiguration.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPoolManager.java
    jakarta/jcs/trunk/src/test/org/apache/jcs/TestDiskCacheConcurrentRandom.java
    jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestLateralTCPConcurrentRandom.java
    jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestLateralTCPFilterRemoveHashCode.java

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/config/OptionConverter.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/config/OptionConverter.java?rev=351876&r1=351875&r2=351876&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/config/OptionConverter.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/config/OptionConverter.java Fri Dec  2 18:40:21 2005
@@ -48,7 +48,13 @@
     {
     }
 
-    /** Description of the Method */
+    /** 
+     * Combines two arrays.
+     * 
+     * @param l
+     * @param r
+     * @return String[]
+     */
     public static String[] concatanateArrays( String[] l, String[] r )
     {
         int len = l.length + r.length;
@@ -60,7 +66,12 @@
         return a;
     }
 
-    /** Description of the Method */
+    /** 
+     * Escapes special cahracters/
+     * 
+     * @param s
+     * @return  String
+     */
     public static String convertSpecialChars( String s )
     {
         char c;
@@ -139,7 +150,15 @@
         }
     }
 
-    /** Description of the Method */
+    /**
+     * Creates an object for the className value of the key.
+     * 
+     * @param props
+     * @param key
+     * @param superClass
+     * @param defaultValue
+     * @return Object that was created
+     */
     public static Object instantiateByKey( Properties props, String key, Class superClass, Object defaultValue )
     {
 
@@ -161,6 +180,9 @@
      * <p>
      * 
      * Case of value is unimportant.
+     * @param value
+     * @param dEfault
+     * @return  Object
      */
 
     public static boolean toBoolean( String value, boolean dEfault )
@@ -181,7 +203,11 @@
         return dEfault;
     }
 
-    /** Description of the Method */
+    /** Description of the Method 
+     * @param value
+     * @param dEfault
+     * @return
+     */
     public static int toInt( String value, int dEfault )
     {
         if ( value != null )
@@ -200,7 +226,11 @@
         return dEfault;
     }
 
-    /** Description of the Method */
+    /** 
+     * @param value
+     * @param dEfault
+     * @return
+     */
     public static long toFileSize( String value, long dEfault )
     {
         if ( value == null )
@@ -245,6 +275,9 @@
     /**
      * Find the value corresponding to <code>key</code> in <code>props</code>.
      * Then perform variable substitution on the found value.
+     * @param key
+     * @param props
+     * @return
      */
 
     public static String findAndSubst( String key, Properties props )
@@ -278,6 +311,7 @@
      *            The class to which the new object should belong.
      * @param defaultValue
      *            The object to return in case of non-fulfillment
+     * @return
      */
 
     public static Object instantiateByClassName( String className, Class superClass, Object defaultValue )
@@ -346,6 +380,8 @@
      * 
      * @param val
      *            The string on which variable substitution is performed.
+     * @param props
+     * @return String
      * @throws IllegalArgumentException
      *             if <code>val</code> is malformed.
      */

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/config/PropertySetter.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/config/PropertySetter.java?rev=351876&r1=351875&r2=351876&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/config/PropertySetter.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/config/PropertySetter.java Fri Dec  2 18:40:21 2005
@@ -212,6 +212,7 @@
      *            The named of the property to set.
      * @param value
      *            The value of the property.
+     * @throws PropertySetterException
      */
 
     public void setProperty( PropertyDescriptor prop, String name, String value )
@@ -255,6 +256,9 @@
     /**
      * Convert <code>val</code> a String parameter to an object of a given
      * type.
+     * @param val
+     * @param type
+     * @return Object
      */
     protected Object convertArg( String val, Class type )
     {
@@ -292,6 +296,7 @@
 
     /**
      * Gets the propertyDescriptor attribute of the PropertySetter object
+     * @param name
      * 
      * @return The propertyDescriptor value
      */

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheManager.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheManager.java?rev=351876&r1=351875&r2=351876&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheManager.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheManager.java Fri Dec  2 18:40:21 2005
@@ -278,6 +278,11 @@
             ThreadPoolManager.setProps( props );
             ThreadPoolManager poolMgr = ThreadPoolManager.getInstance();
 
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "ThreadPoolManager = " + poolMgr );
+            }
+            
             // configure the cache
             CompositeCacheConfigurator configurator = new CompositeCacheConfigurator( this );
 
@@ -333,7 +338,11 @@
         return this.defaultElementAttr.copy();
     }
 
-    /** Gets the cache attribute of the CacheHub object */
+    /** 
+     * Gets the cache attribute of the CacheHub object 
+     * @param cacheName
+     * @return CompositeCache -- the cache region controller
+     */
     public CompositeCache getCache( String cacheName )
     {
         return getCache( cacheName, this.defaultCacheAttr.copy() );
@@ -570,7 +579,8 @@
     }
 
     /**
-     * Gets stats for debugging.
+     * Gets stats for debugging.  This calls gets statistics and then
+     * puts all the results in a string.  This returns data for all regions.
      * 
      * @return String
      */
@@ -587,6 +597,7 @@
         int statsLen = stats.length;
         for ( int i = 0; i < statsLen; i++ )
         {
+            buf.append( "\n" ); 
             buf.append( stats[i] );
         }
         return buf.toString();

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/MemoryCache.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/MemoryCache.java?rev=351876&r1=351875&r2=351876&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/MemoryCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/MemoryCache.java Fri Dec  2 18:40:21 2005
@@ -71,7 +71,7 @@
      * directly access items in the memory cache.
      * 
      * @return An iterator
-     * @deprecated
+     * 
      */
     public Iterator getIterator();
 

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java?rev=351876&r1=351875&r2=351876&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java Fri Dec  2 18:40:21 2005
@@ -122,8 +122,12 @@
         {
             return;
         }
-        log.debug( "In memory limit reached, spooling" );
-
+        
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "In memory limit reached, spooling" );
+        }
+        
         // Write the last 'chunkSize' items to disk.
         int chunkSizeCorrected = Math.min( size, chunkSize );
 
@@ -170,18 +174,22 @@
                     verifyCache();
                     throw new Error( "update: last is null!" );
                 }
+                
+                // If this is out of the sync block it can detect a mismatch where there is none.
+                if ( map.size() != dumpCacheSize() )
+                {
+                    log.warn( "update: After spool, size mismatch: map.size() = " + map.size() + ", linked list size = "
+                        + dumpCacheSize() );
+                }                
             }
         }
 
         if ( log.isDebugEnabled() )
         {
-            log.debug( "update: After spool map size: " + map.size() );
-        }
-        if ( map.size() != dumpCacheSize() )
-        {
-            log.error( "update: After spool, size mismatch: map.size() = " + map.size() + ", linked list size = "
-                + dumpCacheSize() );
+            log.debug( "update: After spool map size: " + map.size() + " linked list size = "
+                + dumpCacheSize());
         }
+        
     }
 
     /**

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/data/PropertyGroups.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/data/PropertyGroups.java?rev=351876&r1=351875&r2=351876&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/data/PropertyGroups.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/data/PropertyGroups.java Fri Dec  2 18:40:21 2005
@@ -68,7 +68,10 @@
         load( name );
     }
 
-    /** Description of the Method */
+    /** Description of the Method 
+     * @param name
+     * @throws Exception
+     */
     public void load( String name )
         throws Exception
     {
@@ -76,7 +79,9 @@
         load();
     }
 
-    /** Description of the Method */
+    /** Description of the Method 
+     * @throws Exception
+     */
     public void load()
         throws Exception
     {
@@ -114,6 +119,7 @@
 
     /**
      * Gets the property attribute of the PropertyGroups object
+     * @param key
      * 
      * @return The property value
      */
@@ -129,6 +135,8 @@
 
     /**
      * Gets the property attribute of the PropertyGroups object
+     * @param key
+     * @param dflt
      * 
      * @return The property value
      */
@@ -144,6 +152,7 @@
 
     /**
      * Gets the properties attribute of the PropertyGroups object
+     * @param key
      * 
      * @return The properties value
      */
@@ -161,19 +170,26 @@
         return null;
     }
 
-    /** Description of the Method */
+    /** 
+     * @return Enumeration of the keys
+     */
     public Enumeration propertyKeys()
     {
         return new PropertyKeysEnum();
     }
 
-    /** Description of the Method */
+    /** Description of the Method 
+     * @return
+     */
     public Enumeration simpleKeys()
     {
         return new SimpleKeysEnum();
     }
 
-    /** Description of the Method */
+    /** Description of the Method 
+     * @param sB
+     * @param key
+     */
     private void keyVal( StringBuffer sB, Object key )
     {
         String k = (String) key;
@@ -182,7 +198,10 @@
         sB.append( get( key ).toString() );
     }
 
-    /** Description of the Method */
+    /**
+     * @return String
+     * 
+     */
     public synchronized String toString()
     {
         StringBuffer sB = new StringBuffer();
@@ -227,13 +246,19 @@
             baseEnum = keys();
         }
 
-        /** Description of the Method */
+        /**
+         * @return  boolean true is has more
+         * 
+         */
         public boolean hasMoreElements()
         {
             return howMany > 0;
         }
 
-        /** Description of the Method */
+        /**
+         * @return Object
+         * 
+         */
         public Object nextElement()
         {
             while ( baseEnum.hasMoreElements() )
@@ -272,13 +297,19 @@
             baseEnum = keys();
         }
 
-        /** Description of the Method */
+        /**
+         * @return
+         * 
+         */
         public boolean hasMoreElements()
         {
             return howMany > 0;
         }
 
-        /** Description of the Method */
+        /**
+         * @return
+         * 
+         */
         public Object nextElement()
         {
             while ( baseEnum.hasMoreElements() )

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/props/PropertyLoader.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/props/PropertyLoader.java?rev=351876&r1=351875&r2=351876&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/props/PropertyLoader.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/props/PropertyLoader.java Fri Dec  2 18:40:21 2005
@@ -148,6 +148,8 @@
      * that uses the current thread's context classloader. A better strategy
      * would be to use techniques shown in
      * http://www.javaworld.com/javaworld/javaqa/2003-06/01-qa-0606-load.html
+     * @param name
+     * @return Properties
      */
     public static Properties loadProperties( final String name )
     {

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/servlet/BasicHttpAuthenticator.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/servlet/BasicHttpAuthenticator.java?rev=351876&r1=351875&r2=351876&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/servlet/BasicHttpAuthenticator.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/servlet/BasicHttpAuthenticator.java Fri Dec  2 18:40:21 2005
@@ -51,6 +51,9 @@
 
     /**
      * Authenticates the http <code>"Authorization"</code> header information.
+     * @param req
+     * @param res
+     * @return boolean
      */
     public final boolean authenticate( HttpServletRequest req, HttpServletResponse res )
     {
@@ -75,6 +78,9 @@
     /**
      * Returns true iff the given "Authorization" http request header contains
      * authorized user id and password.
+     * @param authHeader
+     * @return
+     * @throws IOException
      */
     private boolean authorized( String authHeader )
         throws IOException
@@ -106,6 +112,8 @@
 
     /**
      * Default implementation of checking the password.
+     * @param userid
+     * @param password
      * 
      * @return true iff the given user id and password is valid.
      */

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMap.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMap.java?rev=351876&r1=351875&r2=351876&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMap.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMap.java Fri Dec  2 18:40:21 2005
@@ -339,21 +339,6 @@
     }
 
     /**
-     * Adds a new node to the end of the link list. Currently not used.
-     * 
-     * @param key
-     * @param val
-     *            The feature to be added to the Last
-     *  
-     */
-    private void addLast( Object key, Object val )
-    {
-        LRUElementDescriptor me = new LRUElementDescriptor( key, val );
-        list.addLast( me );
-        verifyCache( me.getKey() );
-    }
-
-    /**
      * Adds a new node to the start of the link list.
      * 
      * @param key
@@ -499,7 +484,7 @@
      * 
      * @param key
      */
-    private void verifyCache( Object key )
+    protected void verifyCache( Object key )
     {
         if ( !log.isDebugEnabled() )
         {

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/SortedPreferentialArray.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/SortedPreferentialArray.java?rev=351876&r1=351875&r2=351876&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/SortedPreferentialArray.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/SortedPreferentialArray.java Fri Dec  2 18:40:21 2005
@@ -26,7 +26,8 @@
  * Insertion time is n, search is log(n)
  * 
  * 
- * Clients must manage thread safety.
+ * Clients must manage thread safety on previous version.  I synchronized the public methods to add
+ * easy thread safety.  I synchronized all public methods that make modifications.
  *  
  */
 public class SortedPreferentialArray
@@ -65,7 +66,7 @@
      * @param obj
      *            Object
      */
-    public void add( Comparable obj )
+    public synchronized void add( Comparable obj )
     {
         if ( obj == null )
         {
@@ -115,7 +116,7 @@
      * 
      * @return Comparable
      */
-    public Comparable getLargest()
+    public synchronized Comparable getLargest()
     {
         return array[curSize - 1];
     }
@@ -125,7 +126,7 @@
      * 
      * @return Comparable
      */
-    public Comparable getSmallest()
+    public synchronized Comparable getSmallest()
     {
         return array[0];
     }
@@ -259,7 +260,7 @@
      * @param pref
      *            boolean
      */
-    public void setPreferLarge( boolean pref )
+    public synchronized void setPreferLarge( boolean pref )
     {
         preferLarge = pref;
     }
@@ -271,7 +272,7 @@
      *            Comparable
      * @return Comparable, null if arg is null or none was found.
      */
-    public Comparable takeNearestLargerOrEqual( Comparable obj )
+    public synchronized Comparable takeNearestLargerOrEqual( Comparable obj )
     {
         if ( obj == null )
         {

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/PoolConfiguration.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/PoolConfiguration.java?rev=351876&r1=351875&r2=351876&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/PoolConfiguration.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/PoolConfiguration.java Fri Dec  2 18:40:21 2005
@@ -74,15 +74,16 @@
 
     /**
      * 
+     * @param useBoundary
      * @param boundarySize
      * @param maximumPoolSize
      * @param minimumPoolSize
      * @param keepAliveTime
-     * @param abortWhenlocked
+     * @param whenBlockedPolicy
      * @param startUpSize
      */
     public PoolConfiguration( boolean useBoundary, int boundarySize, int maximumPoolSize, int minimumPoolSize,
-                             int keepAliveTime, String henBlockedPolicy, int startUpSize )
+                             int keepAliveTime, String whenBlockedPolicy, int startUpSize )
     {
     }
 
@@ -223,6 +224,7 @@
 
     /**
      * To string for debugging purposes.
+     * @return String
      */
     public String toString()
     {
@@ -239,6 +241,7 @@
 
     /**
      * Copies the instance variables to another instance.
+     * @return PoolConfiguration
      */
     public Object clone()
     {

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPoolManager.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPoolManager.java?rev=351876&r1=351875&r2=351876&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPoolManager.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPoolManager.java Fri Dec  2 18:40:21 2005
@@ -356,6 +356,8 @@
 
     /**
      * Configures the default PoolConfiguration settings
+     * @param root
+     * @return PoolConfiguration
      *  
      */
     private PoolConfiguration loadConfig( String root )

Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/TestDiskCacheConcurrentRandom.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/test/org/apache/jcs/TestDiskCacheConcurrentRandom.java?rev=351876&r1=351875&r2=351876&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/TestDiskCacheConcurrentRandom.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/TestDiskCacheConcurrentRandom.java Fri Dec  2 18:40:21 2005
@@ -1,9 +1,8 @@
 package org.apache.jcs;
 
-import junit.framework.*;
+import junit.framework.TestCase;
 
 import org.apache.jcs.access.TestCacheAccess;
-import org.apache.jcs.engine.control.CompositeCacheManager;
 
 /**
  * This is used by other tests to generate a random load on the disk cache.

Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestLateralTCPConcurrentRandom.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestLateralTCPConcurrentRandom.java?rev=351876&r1=351875&r2=351876&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestLateralTCPConcurrentRandom.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestLateralTCPConcurrentRandom.java Fri Dec  2 18:40:21 2005
@@ -5,8 +5,6 @@
 import junit.framework.TestCase;
 
 import org.apache.jcs.JCS;
-import org.apache.jcs.auxiliary.lateral.LateralCacheAttributes;
-import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
 import org.apache.jcs.engine.CacheElement;
 import org.apache.jcs.engine.behavior.ICacheElement;
 
@@ -18,6 +16,7 @@
 {
 
     private static boolean isSysOut = false;
+
     //private static boolean isSysOut = true;
 
     /**
@@ -59,8 +58,7 @@
         boolean show = true;//false;
 
         JCS cache = JCS.getInstance( region );
-        
-        
+
         TCPLateralCacheAttributes lattr2 = new TCPLateralCacheAttributes();
         lattr2.setTcpListenerPort( 1102 );
         lattr2.setTransmissionTypeName( "TCP" );
@@ -68,7 +66,7 @@
 
         // this service will put and remove using the lateral to
         // the cache instance above
-        // the cache thinks it is different since the listenerid is different        
+        // the cache thinks it is different since the listenerid is different
         LateralTCPService service = new LateralTCPService( lattr2 );
         service.setListenerId( 123456 );
 
@@ -82,8 +80,8 @@
                 String key = "key" + kn;
                 if ( n == 1 )
                 {
-                    ICacheElement element = new CacheElement( region, key, region + ":data" + i + " junk asdfffffffadfasdfasf "
-                        + kn + ":" + n );
+                    ICacheElement element = new CacheElement( region, key, region + ":data" + i
+                        + " junk asdfffffffadfasdfasf " + kn + ":" + n );
                     service.update( element );
                     if ( show )
                     {
@@ -93,8 +91,8 @@
                 /**/
                 else if ( n == 2 )
                 {
-                   service.remove( region, key );
-                   if ( show )
+                    service.remove( region, key );
+                    if ( show )
                     {
                         p( "removed " + key );
                     }
@@ -103,15 +101,15 @@
                 else
                 {
                     // slightly greater chance of get
-                    try 
+                    try
                     {
                         Object obj = service.get( region, key );
                         if ( show && obj != null )
                         {
                             p( obj.toString() );
-                        }                        
+                        }
                     }
-                    catch( Exception e )
+                    catch ( Exception e )
                     {
                         // consider failing, some timeouts are expected
                         e.printStackTrace();
@@ -132,36 +130,37 @@
             e.printStackTrace( System.out );
             throw e;
         }
-        
+
         JCS jcs = JCS.getInstance( region );
         String key = "testKey" + testNum;
         String data = "testData" + testNum;
         jcs.put( key, data );
         String value = (String) jcs.get( key );
         assertEquals( "Couldn't put normally.", data, value );
-        
+
         // make sure the items we can find are in the correct region.
         for ( int i = 1; i < numOps; i++ )
         {
             String keyL = "key" + i;
-            String dataL = (String)jcs.get( keyL );
+            String dataL = (String) jcs.get( keyL );
             if ( dataL != null )
             {
                 assertTrue( "Incorrect region detected.", dataL.startsWith( region ) );
             }
-            
+
         }
 
         //Thread.sleep( 1000 );
 
         //ICacheElement element = new CacheElement( region, "abc", "testdata");
         //service.update( element );
-        
+
         //Thread.sleep( 2500 );
-        // could be too mcuh going on right now to get ti through, sot he test might fail.
+        // could be too mcuh going on right now to get ti through, sot he test
+        // might fail.
         //String value2 = (String) jcs.get( "abc" );
-        //assertEquals( "Couldn't put laterally, could be too much traffic in queue.", "testdata", value2 );
-                
+        //assertEquals( "Couldn't put laterally, could be too much traffic in
+        // queue.", "testdata", value2 );
 
     }
 

Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestLateralTCPFilterRemoveHashCode.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestLateralTCPFilterRemoveHashCode.java?rev=351876&r1=351875&r2=351876&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestLateralTCPFilterRemoveHashCode.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestLateralTCPFilterRemoveHashCode.java Fri Dec  2 18:40:21 2005
@@ -64,7 +64,7 @@
         throws Exception
     {
 
-        boolean show = true;//false;
+        //boolean show = true;//false;
 
         JCS cache = JCS.getInstance( region );
 



---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org