commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
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 GMT
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. 
     </action>
+    <action dev="markt" type="update">
+      Code clean-up for Java 1.5 (@Override annotations).
+    </action>
   </release>
   <release version="1.5.6" date="2011-04-03" description="This is a patch release, including
bugfixes only.">
     <action dev="markt" type="fix" issue="POOL-179" due-to="Axel Grossmann">

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<T> 
      * @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<T> 
      * 
      * @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<T> 
     /**
      * {@inheritDoc}
      */
+    @Override
     public synchronized void invalidateObject(T obj) throws Exception {
         _numActive--;
         if (_factory != null) {
@@ -222,6 +225,7 @@ public class SoftReferenceObjectPool<T> 
      * @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<T> 
      * 
      * @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<T> 
      *
      * @return the number of instances currently borrowed from this pool
      */
+    @Override
     public synchronized int getNumActive() {
         return _numActive;
     }
@@ -273,6 +279,7 @@ public class SoftReferenceObjectPool<T> 
     /**
      * Clears any objects sitting idle in the pool.
      */
+    @Override
     public synchronized void clear() {
         if(null != _factory) {
             Iterator<SoftReference<T>> iter = _pool.iterator();
@@ -301,6 +308,7 @@ public class SoftReferenceObjectPool<T> 
      *
      * @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<T> 
      * @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<T> 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<K,V> e
      * @param key the pool key
      * @return keyed poolable object instance
      */
+    @Override
     public synchronized V borrowObject(K key) throws Exception {
         assertOpen();
         Stack<V> stack = _pools.get(key);
@@ -201,6 +202,7 @@ public class StackKeyedObjectPool<K,V> 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<K,V> 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<K,V> 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<K,V> 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<K,V> 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<K,V> e
      * @param key the key to query
      * @return the number of instances corresponding to the given <code>key</code>
currently borrowed in this pool
      */
+    @Override
     public synchronized int getNumActive(K key) {
         return getActiveCount(key);
     }
@@ -359,6 +366,7 @@ public class StackKeyedObjectPool<K,V> e
      * @param key the key to query
      * @return the number of instances corresponding to the given <code>key</code>
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<K,V> e
     /**
      * Clears the pool, removing all pooled instances.
      */
+    @Override
     public synchronized void clear() {
         for (Entry<K, Stack<V>> poolEntry : _pools.entrySet()) {
             destroyStack(poolEntry.getKey(),poolEntry.getValue());
@@ -384,6 +393,7 @@ public class StackKeyedObjectPool<K,V> e
      *
      * @param key the key to clear
      */
+    @Override
     public synchronized void clear(K key) {
         Stack<V> stack = _pools.remove(key);
         destroyStack(key,stack);
@@ -420,6 +430,7 @@ public class StackKeyedObjectPool<K,V> 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<K,V> e
      *
      * @throws Exception <strong>deprecated</strong>: 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<K,V> 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<K,V> 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;



Mime
View raw message