Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 408054405 for ; Wed, 11 May 2011 14:47:55 +0000 (UTC) Received: (qmail 99356 invoked by uid 500); 11 May 2011 14:47:55 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 99303 invoked by uid 500); 11 May 2011 14:47:55 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 99296 invoked by uid 99); 11 May 2011 14:47:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 May 2011 14:47:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 May 2011 14:47:51 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 12AB02388A29; Wed, 11 May 2011 14:47:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1101902 - in /commons/proper/pool/trunk/src: changes/ java/org/apache/commons/pool2/impl/ test/org/apache/commons/pool2/impl/ Date: Wed, 11 May 2011 14:47:29 -0000 To: commits@commons.apache.org From: markt@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110511144730.12AB02388A29@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: markt Date: Wed May 11 14:47:29 2011 New Revision: 1101902 URL: http://svn.apache.org/viewvc?rev=1101902&view=rev Log: Add missing @Override annotations Modified: commons/proper/pool/trunk/src/changes/changes.xml commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPool.java commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestStackKeyedObjectPool.java Modified: commons/proper/pool/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/changes/changes.xml?rev=1101902&r1=1101901&r2=1101902&view=diff ============================================================================== --- commons/proper/pool/trunk/src/changes/changes.xml (original) +++ commons/proper/pool/trunk/src/changes/changes.xml Wed May 11 14:47:29 2011 @@ -36,6 +36,9 @@ Make deprecated protected attributes private, requiring that access is via the appropriate getters. + + Code clean-up for Java 1.5 (@Override annotations). + Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java?rev=1101902&r1=1101901&r2=1101902&view=diff ============================================================================== --- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java (original) +++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java Wed May 11 14:47:29 2011 @@ -108,6 +108,7 @@ public class SoftReferenceObjectPool * @throws Exception if an exception occurs creating a new instance * @return a valid, activated object instance */ + @Override public synchronized T borrowObject() throws Exception { assertOpen(); T obj = null; @@ -167,6 +168,7 @@ public class SoftReferenceObjectPool * * @param obj instance to return to the pool */ + @Override public synchronized void returnObject(T obj) throws Exception { boolean success = !isClosed(); if (_factory != null) { @@ -200,6 +202,7 @@ public class SoftReferenceObjectPool /** * {@inheritDoc} */ + @Override public synchronized void invalidateObject(T obj) throws Exception { _numActive--; if (_factory != null) { @@ -222,6 +225,7 @@ public class SoftReferenceObjectPool * @throws IllegalStateException if invoked on a {@link #close() closed} pool * @throws Exception when the {@link #getFactory() factory} has a problem creating or passivating an object. */ + @Override public synchronized void addObject() throws Exception { assertOpen(); if (_factory == null) { @@ -256,6 +260,7 @@ public class SoftReferenceObjectPool * * @return estimated number of idle instances in the pool */ + @Override public synchronized int getNumIdle() { pruneClearedReferences(); return _pool.size(); @@ -266,6 +271,7 @@ public class SoftReferenceObjectPool * * @return the number of instances currently borrowed from this pool */ + @Override public synchronized int getNumActive() { return _numActive; } @@ -273,6 +279,7 @@ public class SoftReferenceObjectPool /** * Clears any objects sitting idle in the pool. */ + @Override public synchronized void clear() { if(null != _factory) { Iterator> iter = _pool.iterator(); @@ -301,6 +308,7 @@ public class SoftReferenceObjectPool * * @throws Exception never - exceptions clearing the pool are swallowed */ + @Override public void close() throws Exception { super.close(); clear(); @@ -316,6 +324,7 @@ public class SoftReferenceObjectPool * @throws IllegalStateException when the factory cannot be set at this time * @deprecated to be removed in pool 2.0 */ + @Override @Deprecated public synchronized void setFactory(PoolableObjectFactory factory) throws IllegalStateException { assertOpen(); Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPool.java URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPool.java?rev=1101902&r1=1101901&r2=1101902&view=diff ============================================================================== --- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPool.java (original) +++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPool.java Wed May 11 14:47:29 2011 @@ -143,6 +143,7 @@ public class StackKeyedObjectPool e * @param key the pool key * @return keyed poolable object instance */ + @Override public synchronized V borrowObject(K key) throws Exception { assertOpen(); Stack stack = _pools.get(key); @@ -201,6 +202,7 @@ public class StackKeyedObjectPool e * @param key the pool key * @param obj returning instance */ + @Override public synchronized void returnObject(K key, V obj) throws Exception { decrementActiveCount(key); if (null != _factory) { @@ -257,6 +259,7 @@ public class StackKeyedObjectPool e /** * {@inheritDoc} */ + @Override public synchronized void invalidateObject(K key, V obj) throws Exception { decrementActiveCount(key); if(null != _factory) { @@ -274,6 +277,7 @@ public class StackKeyedObjectPool e * @throws Exception when {@link KeyedPoolableObjectFactory#makeObject} fails. * @throws IllegalStateException when no {@link #setFactory factory} has been set or after {@link #close} has been called on this pool. */ + @Override public synchronized void addObject(K key) throws Exception { assertOpen(); if (_factory == null) { @@ -329,6 +333,7 @@ public class StackKeyedObjectPool e * * @return the total number of instances currently idle in this pool */ + @Override public synchronized int getNumIdle() { return _totIdle; } @@ -338,6 +343,7 @@ public class StackKeyedObjectPool e * * @return the total number of instances currently borrowed from this pool */ + @Override public synchronized int getNumActive() { return _totActive; } @@ -349,6 +355,7 @@ public class StackKeyedObjectPool e * @param key the key to query * @return the number of instances corresponding to the given key currently borrowed in this pool */ + @Override public synchronized int getNumActive(K key) { return getActiveCount(key); } @@ -359,6 +366,7 @@ public class StackKeyedObjectPool e * @param key the key to query * @return the number of instances corresponding to the given key currently idle in this pool */ + @Override public synchronized int getNumIdle(K key) { try { return(_pools.get(key)).size(); @@ -370,6 +378,7 @@ public class StackKeyedObjectPool e /** * Clears the pool, removing all pooled instances. */ + @Override public synchronized void clear() { for (Entry> poolEntry : _pools.entrySet()) { destroyStack(poolEntry.getKey(),poolEntry.getValue()); @@ -384,6 +393,7 @@ public class StackKeyedObjectPool e * * @param key the key to clear */ + @Override public synchronized void clear(K key) { Stack stack = _pools.remove(key); destroyStack(key,stack); @@ -420,6 +430,7 @@ public class StackKeyedObjectPool e * * @return Keys and pool sizes */ + @Override public synchronized String toString() { StringBuffer buf = new StringBuffer(); buf.append(getClass().getName()); @@ -439,6 +450,7 @@ public class StackKeyedObjectPool e * * @throws Exception deprecated: implementations should silently fail if not all resources can be freed. */ + @Override public void close() throws Exception { super.close(); clear(); @@ -454,6 +466,7 @@ public class StackKeyedObjectPool e * @throws IllegalStateException when the factory cannot be set at this time * @deprecated to be removed in pool 2.0 */ + @Override @Deprecated public synchronized void setFactory(KeyedPoolableObjectFactory factory) throws IllegalStateException { if(0 < getNumActive()) { Modified: commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestStackKeyedObjectPool.java URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestStackKeyedObjectPool.java?rev=1101902&r1=1101901&r2=1101902&view=diff ============================================================================== --- commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestStackKeyedObjectPool.java (original) +++ commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestStackKeyedObjectPool.java Wed May 11 14:47:29 2011 @@ -77,6 +77,7 @@ public class TestStackKeyedObjectPool ex } + @Override @After public void tearDown() throws Exception { pool = null;