commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1344514 - in /commons/proper/jcs/trunk/src: java/org/apache/jcs/auxiliary/disk/block/ java/org/apache/jcs/auxiliary/disk/indexed/ test/org/apache/jcs/ test/org/apache/jcs/auxiliary/disk/block/ test/org/apache/jcs/auxiliary/disk/indexed/ te...
Date Thu, 31 May 2012 00:08:19 GMT
Author: sebb
Date: Thu May 31 00:08:18 2012
New Revision: 1344514

URL: http://svn.apache.org/viewvc?rev=1344514&view=rev
Log:
Unnecessary casts

Modified:
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDisk.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDisk.java
    commons/proper/jcs/trunk/src/test/org/apache/jcs/JCSLightLoadUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/jcs/JCSRemovalSimpleConcurrentTest.java
    commons/proper/jcs/trunk/src/test/org/apache/jcs/RemovalTestUtil.java
    commons/proper/jcs/trunk/src/test/org/apache/jcs/TestTCPLateralCache.java
    commons/proper/jcs/trunk/src/test/org/apache/jcs/ZeroSizeCacheUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/HugeQuantityBlockDiskCacheLoadTest.java
    commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/HugeQuantityIndDiskCacheLoadTest.java
    commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheRandomConcurrentTestUtil.java
    commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheRemovalUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheShrinkUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManualTester.java

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDisk.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDisk.java?rev=1344514&r1=1344513&r2=1344514&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDisk.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDisk.java Thu
May 31 00:08:18 2012
@@ -289,7 +289,7 @@ public class BlockDisk
             log.debug( "read, total post combination data.length = " + data.length );
         }
 
-        return (Serializable) elementSerializer.deSerialize( data );
+        return elementSerializer.deSerialize( data );
     }
 
     /**

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDisk.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDisk.java?rev=1344514&r1=1344513&r2=1344514&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDisk.java
(original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDisk.java
Thu May 31 00:08:18 2012
@@ -116,7 +116,7 @@ class IndexedDisk
         fc.read(data, ded.pos + HEADER_SIZE_BYTES);
         data.flip();
 
-        return (Serializable) elementSerializer.deSerialize( data.array() );
+        return elementSerializer.deSerialize( data.array() );
     }
 
     /**

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/JCSLightLoadUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/JCSLightLoadUnitTest.java?rev=1344514&r1=1344513&r2=1344514&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/JCSLightLoadUnitTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/JCSLightLoadUnitTest.java Thu May 31
00:08:18 2012
@@ -90,7 +90,7 @@ public class JCSLightLoadUnitTest
 
         for ( int i = items; i > 0; i-- )
         {
-            String res = (String) jcs.get( i + ":key" );
+            String res = jcs.get( i + ":key" );
             assertNotNull( "[" + i + ":key] should not be null", res );
         }
 

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/JCSRemovalSimpleConcurrentTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/JCSRemovalSimpleConcurrentTest.java?rev=1344514&r1=1344513&r2=1344514&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/JCSRemovalSimpleConcurrentTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/JCSRemovalSimpleConcurrentTest.java Thu
May 31 00:08:18 2012
@@ -80,7 +80,7 @@ public class JCSRemovalSimpleConcurrentT
 
         for ( int i = count; i >= 0; i-- )
         {
-            String res = (String) jcs.get( "key:" + i + ":anotherpart" );
+            String res = jcs.get( "key:" + i + ":anotherpart" );
             assertNotNull( "[key:" + i + ":anotherpart] should not be null, " + jcs.getStats(),
res );
         }
         System.out.println( "Confirmed that " + count + " items could be found" );
@@ -118,7 +118,7 @@ public class JCSRemovalSimpleConcurrentT
 
         for ( int i = count; i >= 0; i-- )
         {
-            String res = (String) jcs.get( i + ":key" );
+            String res = jcs.get( i + ":key" );
             assertNotNull( "[" + i + ":key] should not be null", res );
         }
         System.out.println( "Confirmed that " + count + " items could be found" );
@@ -156,7 +156,7 @@ public class JCSRemovalSimpleConcurrentT
 
         for ( int i = count; i >= 0; i-- )
         {
-            String res = (String) jcs.get( i + ":key" );
+            String res = jcs.get( i + ":key" );
             assertNotNull( "[" + i + ":key] should not be null", res );
         }
         System.out.println( "Confirmed that " + count + " items could be found" );
@@ -167,7 +167,7 @@ public class JCSRemovalSimpleConcurrentT
 
         for ( int i = count; i >= 0; i-- )
         {
-            String res = (String) jcs.get( i + ":key" );
+            String res = jcs.get( i + ":key" );
             if ( res != null )
             {
                 assertNull( "[" + i + ":key] should be null after remvoeall" + jcs.getStats(),
res );
@@ -201,7 +201,7 @@ public class JCSRemovalSimpleConcurrentT
 
         for ( int i = count; i >= 0; i-- )
         {
-            String res = (String) jcs.get( i + ":key" );
+            String res = jcs.get( i + ":key" );
             assertNotNull( "[" + i + ":key] should not be null", res );
         }
         System.out.println( "Confirmed that " + count + " items could be found" );
@@ -212,7 +212,7 @@ public class JCSRemovalSimpleConcurrentT
         {
             jcs.put( i + ":key", "data" + i );
             jcs.clear();
-            String res = (String) jcs.get( i + ":key" );
+            String res = jcs.get( i + ":key" );
             if ( res != null )
             {
                 assertNull( "[" + i + ":key] should be null after remvoeall" + jcs.getStats(),
res );

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/RemovalTestUtil.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/RemovalTestUtil.java?rev=1344514&r1=1344513&r2=1344514&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/RemovalTestUtil.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/RemovalTestUtil.java Thu May 31 00:08:18
2012
@@ -62,7 +62,7 @@ public class RemovalTestUtil
 
         for ( int i = end; i >= start; i-- )
         {
-            String res = (String) jcs.get( i + ":key" );
+            String res = jcs.get( i + ":key" );
             assertNotNull( "[" + i + ":key] should not be null", res );
         }
         System.out.println( "Confirmed that " + ( end - start ) + " items could be found"
);
@@ -100,7 +100,7 @@ public class RemovalTestUtil
 
         for ( int i = end; i >= start; i-- )
         {
-            String res = (String) jcs.get( i + ":key" );
+            String res = jcs.get( i + ":key" );
             assertNotNull( "[" + i + ":key] should not be null", res );
         }
     }
@@ -124,7 +124,7 @@ public class RemovalTestUtil
         // don't care if they are found
         for ( int i = end; i >= start; i-- )
         {
-            String res = (String) jcs.get( i + ":key" );
+            String res = jcs.get( i + ":key" );
             if ( check )
             {
                 assertNotNull( "[" + i + ":key] should not be null", res );

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/TestTCPLateralCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/TestTCPLateralCache.java?rev=1344514&r1=1344513&r2=1344514&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/TestTCPLateralCache.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/TestTCPLateralCache.java Thu May 31 00:08:18
2012
@@ -130,7 +130,7 @@ public class TestTCPLateralCache
 
         for ( int i = 0; i <= items; i++ )
         {
-            String value = (String) jcs.get( i + ":key" );
+            String value = jcs.get( i + ":key" );
 
             assertEquals( region + " data " + i, value );
         }

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/ZeroSizeCacheUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/ZeroSizeCacheUnitTest.java?rev=1344514&r1=1344513&r2=1344514&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/ZeroSizeCacheUnitTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/ZeroSizeCacheUnitTest.java Thu May 31
00:08:18 2012
@@ -64,7 +64,7 @@ public class ZeroSizeCacheUnitTest
         // all the gets should be null
         for ( int i = items; i >= 0; i-- )
         {
-            String res = (String) jcs.get( i + ":key" );
+            String res = jcs.get( i + ":key" );
             assertNull( "[" + i + ":key] should be null", res );
         }
 
@@ -82,7 +82,7 @@ public class ZeroSizeCacheUnitTest
 
         for ( int i = items; i >= 0; i-- )
         {
-            String res = (String) jcs.get( i + ":key" );
+            String res = jcs.get( i + ":key" );
             assertNull( "[" + i + ":key] should be null", res );
         }
 

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/HugeQuantityBlockDiskCacheLoadTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/HugeQuantityBlockDiskCacheLoadTest.java?rev=1344514&r1=1344513&r2=1344514&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/HugeQuantityBlockDiskCacheLoadTest.java
(original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/HugeQuantityBlockDiskCacheLoadTest.java
Thu May 31 00:08:18 2012
@@ -96,7 +96,7 @@ public class HugeQuantityBlockDiskCacheL
             for ( int i = 0; i <= items; i++ )
             {
                 //System.out.print(  "\033[s" );
-                String value = (String) jcs.get( i + ":key" );
+                String value = jcs.get( i + ":key" );
                 if ( i % 1000 == 0 )
                 {
                     //System.out.print(  "\033[r" );

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/HugeQuantityIndDiskCacheLoadTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/HugeQuantityIndDiskCacheLoadTest.java?rev=1344514&r1=1344513&r2=1344514&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/HugeQuantityIndDiskCacheLoadTest.java
(original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/HugeQuantityIndDiskCacheLoadTest.java
Thu May 31 00:08:18 2012
@@ -76,7 +76,7 @@ public class HugeQuantityIndDiskCacheLoa
 
             for ( int i = 0; i <= items; i++ )
             {
-                String value = (String) jcs.get( i + ":key" );
+                String value = jcs.get( i + ":key" );
 
                 assertEquals( region + " data " + i, value );
             }

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheRandomConcurrentTestUtil.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheRandomConcurrentTestUtil.java?rev=1344514&r1=1344513&r2=1344514&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheRandomConcurrentTestUtil.java
(original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheRandomConcurrentTestUtil.java
Thu May 31 00:08:18 2012
@@ -69,7 +69,7 @@ public class IndexedDiskCacheRandomConcu
         String key = "testKey" + testNum;
         String data = "testData" + testNum;
         jcs.put( key, data );
-        String value = (String) jcs.get( key );
+        String value = jcs.get( key );
         assertEquals( data, value );
 
     }

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheRemovalUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheRemovalUnitTest.java?rev=1344514&r1=1344513&r2=1344514&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheRemovalUnitTest.java
(original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheRemovalUnitTest.java
Thu May 31 00:08:18 2012
@@ -69,11 +69,11 @@ public class JDBCDiskCacheRemovalUnitTes
         Thread.sleep( 1000 );
 
         // VERIFY
-        String resultBeforeRemove = (String) jcs.get( keyPart1 + ":" + keyPart2 );
+        String resultBeforeRemove = jcs.get( keyPart1 + ":" + keyPart2 );
         assertEquals( "Wrong result", data, resultBeforeRemove );
 
         jcs.remove( keyPart1 + ":" );
-        String resultAfterRemove = (String) jcs.get( keyPart1 + ":" + keyPart2 );
+        String resultAfterRemove = jcs.get( keyPart1 + ":" + keyPart2 );
         assertNull( "Should not have a result after removal.", resultAfterRemove );
 
         System.out.println( jcs.getStats() );

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheShrinkUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheShrinkUnitTest.java?rev=1344514&r1=1344513&r2=1344514&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheShrinkUnitTest.java
(original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheShrinkUnitTest.java
Thu May 31 00:08:18 2012
@@ -140,7 +140,7 @@ public class JDBCDiskCacheShrinkUnitTest
 
         for ( int i = 0; i <= items; i++ )
         {
-            String value = (String) jcs.get( i + ":key" );
+            String value = jcs.get( i + ":key" );
 
             assertEquals( "key = [" + i + ":key] value = [" + value + "]", region + " data
" + i, value );
         }
@@ -192,7 +192,7 @@ public class JDBCDiskCacheShrinkUnitTest
 
         for ( int i = 0; i <= items; i++ )
         {
-            String value = (String) jcs.get( i + ":key" );
+            String value = jcs.get( i + ":key" );
 
             assertEquals( "key = [" + i + ":key] value = [" + value + "]", region + " data
" + i, value );
         }

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManualTester.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManualTester.java?rev=1344514&r1=1344513&r2=1344514&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManualTester.java
(original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManualTester.java
Thu May 31 00:08:18 2012
@@ -58,7 +58,7 @@ public class RemoteHttpCacheManualTester
 
         for ( int i = items; i > 0; i-- )
         {
-            String res = (String) jcs.get( i + ":key" );
+            String res = jcs.get( i + ":key" );
             if ( res == null )
             {
                 //assertNotNull( "[" + i + ":key] should not be null", res );



Mime
View raw message