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 7398c749ee32e7360b410f1b5602cf140003cfa3 Author: Gary Gregory <[email protected]> AuthorDate: Tue Jul 9 19:47:03 2024 -0400 Remove redundant parens --- .../commons/jcs3/auxiliary/disk/indexed/LRUMapSizeVsCount.java | 8 ++++---- .../commons/jcs3/utils/struct/LRUMapConcurrentUnitTest.java | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/commons-jcs3-core/src/test/java/org/apache/commons/jcs3/auxiliary/disk/indexed/LRUMapSizeVsCount.java b/commons-jcs3-core/src/test/java/org/apache/commons/jcs3/auxiliary/disk/indexed/LRUMapSizeVsCount.java index d81f02c8..9692e2c7 100644 --- a/commons-jcs3-core/src/test/java/org/apache/commons/jcs3/auxiliary/disk/indexed/LRUMapSizeVsCount.java +++ b/commons-jcs3-core/src/test/java/org/apache/commons/jcs3/auxiliary/disk/indexed/LRUMapSizeVsCount.java @@ -159,14 +159,14 @@ public class LRUMapSizeVsCount System.out.println( "\n" ); System.out.println( "Put average for " + cacheName + " = " + putAvCount ); System.out.println( "Put average for " + cache2Name + " = " + putAvSize ); - ratioPut = (putAvSize *1.0) / putAvCount; + ratioPut = putAvSize *1.0 / putAvCount; System.out.println( cache2Name.trim() + " puts took " + ratioPut + " times the " + cacheName.trim() + ", the goal is <" + targetPut + "x" ); System.out.println( "\n" ); System.out.println( "Put minimum for " + cacheName + " = " + minTimeCountPut ); System.out.println( "Put minimum for " + cache2Name + " = " + minTimeSizePut ); - ratioPut = (minTimeSizePut * 1.0) / minTimeCountPut; + ratioPut = minTimeSizePut * 1.0 / minTimeCountPut; System.out.println( cache2Name.trim() + " puts took " + ratioPut + " times the " + cacheName.trim() + ", the goal is <" + targetPut + "x" ); @@ -174,14 +174,14 @@ public class LRUMapSizeVsCount System.out.println( "Get average for " + cacheName + " = " + getAvCount ); System.out.println( "Get average for " + cache2Name + " = " + getAvSize ); ratioGet = Float.intBitsToFloat( (int) getAvCount ) / Float.intBitsToFloat( (int) getAvSize ); - ratioGet = (getAvSize * 1.0) / getAvCount; + ratioGet = getAvSize * 1.0 / getAvCount; System.out.println( cache2Name.trim() + " gets took " + ratioGet + " times the " + cacheName.trim() + ", the goal is <" + targetGet + "x" ); System.out.println( "\n" ); System.out.println( "Get minimum for " + cacheName + " = " + minTimeCountGet ); System.out.println( "Get minimum for " + cache2Name + " = " + minTimeSizeGet ); - ratioPut = (minTimeSizeGet * 1.0) / minTimeCountGet; + ratioPut = minTimeSizeGet * 1.0 / minTimeCountGet; System.out.println( cache2Name.trim() + " puts took " + ratioPut + " times the " + cacheName.trim() + ", the goal is <" + targetGet + "x" ); } diff --git a/commons-jcs3-core/src/test/java/org/apache/commons/jcs3/utils/struct/LRUMapConcurrentUnitTest.java b/commons-jcs3-core/src/test/java/org/apache/commons/jcs3/utils/struct/LRUMapConcurrentUnitTest.java index f36117d0..08b38a81 100644 --- a/commons-jcs3-core/src/test/java/org/apache/commons/jcs3/utils/struct/LRUMapConcurrentUnitTest.java +++ b/commons-jcs3-core/src/test/java/org/apache/commons/jcs3/utils/struct/LRUMapConcurrentUnitTest.java @@ -186,8 +186,8 @@ public class LRUMapConcurrentUnitTest //since we got them backwards the total should be at the end. // add one confirm that total is gone. - map.put( ( total ) + ":key", "data" + ( total ) ); - assertNull( map.get( ( total - 1 ) + ":key" ) ); + map.put( total + ":key", "data" + total ); + assertNull( map.get( total - 1 + ":key" ) ); } /** @@ -213,7 +213,7 @@ public class LRUMapConcurrentUnitTest } // get the total to total *2 items out, these should be found. - for ( int i = ( total * 2 ) - 1; i >= total; i-- ) + for ( int i = total * 2 - 1; i >= total; i-- ) { final String res = map.get( i + ":key" ); assertNotNull( "[" + i + ":key] should not be null", res );
