This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-jcs.git
commit 77d350403f8cd4653417b33597ca01b0af288a9c Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Tue Jul 9 19:42:53 2024 -0400 Use final Use blocks Remove useless or redundant parens Use diamonds Remove redundant keywords --- .../auxiliary/disk/indexed/IndexedDiskCacheSteadyLoadTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/commons-jcs3-core/src/test/java/org/apache/commons/jcs3/auxiliary/disk/indexed/IndexedDiskCacheSteadyLoadTest.java b/commons-jcs3-core/src/test/java/org/apache/commons/jcs3/auxiliary/disk/indexed/IndexedDiskCacheSteadyLoadTest.java index 8e3cb7e4..48e40b8c 100644 --- a/commons-jcs3-core/src/test/java/org/apache/commons/jcs3/auxiliary/disk/indexed/IndexedDiskCacheSteadyLoadTest.java +++ b/commons-jcs3-core/src/test/java/org/apache/commons/jcs3/auxiliary/disk/indexed/IndexedDiskCacheSteadyLoadTest.java @@ -78,7 +78,7 @@ public class IndexedDiskCacheSteadyLoadTest final int runs = 1000; final int upperKB = 50; - final CacheAccess<String, DiskTestObject> jcs = JCS.getInstance( ( numPerRun / 2 ) + "aSecond" ); + final CacheAccess<String, DiskTestObject> jcs = JCS.getInstance( numPerRun / 2 + "aSecond" ); final ElapsedTimer timer = new ElapsedTimer(); final int numToGet = numPerRun * ( runs / 10 ); @@ -107,7 +107,7 @@ public class IndexedDiskCacheSteadyLoadTest { // 1/2 upper to upperKB-4 KB final int kiloBytes = Math.max( upperKB / 2, random.nextInt( upperKB ) ); - final int bytes = ( kiloBytes ) * 1024; + final int bytes = kiloBytes * 1024; totalSize += bytes; totalPut++; final DiskTestObject object = new DiskTestObject( Integer.valueOf( i ), new byte[bytes]); @@ -117,7 +117,7 @@ public class IndexedDiskCacheSteadyLoadTest // remove half of those inserted the previous run if ( runCount > 1 ) { - for ( int j = ( ( totalPut - numPerRun ) - ( numPerRun / 2 ) ); j < ( totalPut - numPerRun ); j++ ) + for ( int j = totalPut - numPerRun - numPerRun / 2; j < totalPut - numPerRun; j++ ) { jcs.remove( String.valueOf( j ) ); } @@ -128,7 +128,7 @@ public class IndexedDiskCacheSteadyLoadTest { System.out.println( LOG_DIVIDER ); System.out.println( "Elapsed " + timer.getElapsedTimeString() ); - System.out.println( "Run count: " + runCount + " Average size: " + ( totalSize / totalPut ) + "\n" + System.out.println( "Run count: " + runCount + " Average size: " + totalSize / totalPut + "\n" + jcs.getStats() ); logMemoryUsage(); }