Author: markt Date: Mon Oct 14 21:47:49 2013 New Revision: 1532111 URL: http://svn.apache.org/r1532111 Log: Fix some Checkstyle errors
Modified: commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/VisitTracker.java commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/VisitTrackerFactory.java commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/performance/PerformanceTest.java Modified: commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/VisitTracker.java URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/VisitTracker.java?rev=1532111&r1=1532110&r2=1532111&view=diff ============================================================================== --- commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/VisitTracker.java (original) +++ commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/VisitTracker.java Mon Oct 14 21:47:49 2013 @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,25 +28,25 @@ public class VisitTracker<K> { private boolean destroyed = false; private int id = 0; private K key = null; - + public VisitTracker() { super(); reset(); } - + public VisitTracker(int id) { super(); this.id = id; reset(); } - + public VisitTracker(int id, K key) { super(); this.id = id; this.key = key; reset(); } - + public boolean validate() { if (destroyed) { fail("attempted to validate a destroyed object"); @@ -97,7 +97,7 @@ public class VisitTracker<K> { public String toString() { return "Key: " + key + " id: " + id; } - + private void fail(String message) { throw new IllegalStateException(message); } Modified: commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/VisitTrackerFactory.java URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/VisitTrackerFactory.java?rev=1532111&r1=1532110&r2=1532111&view=diff ============================================================================== --- commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/VisitTrackerFactory.java (original) +++ commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/VisitTrackerFactory.java Mon Oct 14 21:47:49 2013 @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -26,7 +26,7 @@ import org.apache.commons.pool2.impl.Def * test Evictor runs. * */ -public class VisitTrackerFactory<K> implements PooledObjectFactory<VisitTracker<K>>, +public class VisitTrackerFactory<K> implements PooledObjectFactory<VisitTracker<K>>, KeyedPooledObjectFactory<K,VisitTracker<K>> { private int nextId = 0; public VisitTrackerFactory() { Modified: commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java?rev=1532111&r1=1532110&r2=1532111&view=diff ============================================================================== --- commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java (original) +++ commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java Mon Oct 14 21:47:49 2013 @@ -965,8 +965,8 @@ public class TestGenericKeyedObjectPool int totalInstances = zeroLength + oneLength + twoLength; // Number of times evictor should have cycled through pools - int cycleCount = (runs * pool.getNumTestsPerEvictionRun()) - / totalInstances; + int cycleCount = (runs * pool.getNumTestsPerEvictionRun()) / + totalInstances; // Look at elements and make sure they are visited cycleCount // or cycleCount + 1 times @@ -1239,23 +1239,23 @@ public class TestGenericKeyedObjectPool } if (DISPLAY_THREAD_DETAILS || wtt.length/2 != failed){ System.out.println( - "MaxWait: "+maxWait - +" HoldTime: "+holdTime - +" KeyCount: "+keyCount - +" MaxActive: "+threadsPerKey - +" Threads: "+wtt.length - +" Failed: "+failed + "MaxWait: " + maxWait + + " HoldTime: " + holdTime + + " KeyCount: " + keyCount + + " MaxActive: " + threadsPerKey + + " Threads: " + wtt.length + + " Failed: " + failed ); for(int i=0; i < wtt.length; i++){ WaitingTestThread wt = wtt[i]; System.out.println( - "Preborrow: "+(wt.preborrow-origin) - + " Postborrow: "+(wt.postborrow != 0 ? wt.postborrow-origin : -1) - + " BorrowTime: "+(wt.postborrow != 0 ? wt.postborrow-wt.preborrow : -1) - + " PostReturn: "+(wt.postreturn != 0 ? wt.postreturn-origin : -1) - + " Ended: "+(wt.ended-origin) - + " Key: "+(wt._key) - + " ObjId: "+wt.objectId + "Preborrow: " + (wt.preborrow-origin) + + " Postborrow: " + (wt.postborrow != 0 ? wt.postborrow-origin : -1) + + " BorrowTime: " + (wt.postborrow != 0 ? wt.postborrow-wt.preborrow : -1) + + " PostReturn: " + (wt.postreturn != 0 ? wt.postreturn-origin : -1) + + " Ended: " + (wt.ended-origin) + + " Key: " + (wt._key) + + " ObjId: " + wt.objectId ); } } Modified: commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java?rev=1532111&r1=1532110&r2=1532111&view=diff ============================================================================== --- commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java (original) +++ commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java Mon Oct 14 21:47:49 2013 @@ -489,8 +489,8 @@ public class TestGenericObjectPool exten } // Number of times evictor should have cycled through the pool - int cycleCount = (runs * pool.getNumTestsPerEvictionRun()) - / instanceCount; + int cycleCount = (runs * pool.getNumTestsPerEvictionRun()) / + instanceCount; // Look at elements and make sure they are visited cycleCount // or cycleCount + 1 times @@ -1866,21 +1866,21 @@ public class TestGenericObjectPool exten } if (DISPLAY_THREAD_DETAILS || wtt.length/2 != failed){ System.out.println( - "MaxWait: "+maxWait - +" HoldTime: "+holdTime - + " MaxTotal: "+threads - +" Threads: "+wtt.length - +" Failed: "+failed + "MaxWait: " + maxWait + + " HoldTime: " + holdTime + + " MaxTotal: " + threads + + " Threads: " + wtt.length + + " Failed: " + failed ); for(int i=0; i < wtt.length; i++){ WaitingTestThread wt = wtt[i]; System.out.println( - "Preborrow: "+(wt.preborrow-origin) - + " Postborrow: "+(wt.postborrow != 0 ? wt.postborrow-origin : -1) - + " BorrowTime: "+(wt.postborrow != 0 ? wt.postborrow-wt.preborrow : -1) - + " PostReturn: "+(wt.postreturn != 0 ? wt.postreturn-origin : -1) - + " Ended: "+(wt.ended-origin) - + " ObjId: "+wt.objectId + "Preborrow: " + (wt.preborrow-origin) + + " Postborrow: " + (wt.postborrow != 0 ? wt.postborrow-origin : -1) + + " BorrowTime: " + (wt.postborrow != 0 ? wt.postborrow-wt.preborrow : -1) + + " PostReturn: " + (wt.postreturn != 0 ? wt.postreturn-origin : -1) + + " Ended: " + (wt.ended-origin) + + " ObjId: " + wt.objectId ); } } Modified: commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/performance/PerformanceTest.java URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/performance/PerformanceTest.java?rev=1532111&r1=1532110&r2=1532111&view=diff ============================================================================== --- commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/performance/PerformanceTest.java (original) +++ commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/performance/PerformanceTest.java Mon Oct 14 21:47:49 2013 @@ -98,11 +98,11 @@ public class PerformanceTest { taskStats.nrSamples++; if (logLevel >= 2) { String name = "thread" + Thread.currentThread().getName(); - System.out.println("result " + taskStats.nrSamples + "\t" - + name + "\t" + "borrow time: " + borrowTime + "\t" - + "return time: " + returnTime + "\t" + "waiting: " - + taskStats.waiting + "\t" + "complete: " - + taskStats.complete); + System.out.println("result " + taskStats.nrSamples + "\t" + + name + "\t" + "borrow time: " + borrowTime + "\t" + + "return time: " + returnTime + "\t" + "waiting: " + + taskStats.waiting + "\t" + "complete: " + + taskStats.complete); } } return taskStats;