commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r602598 - in /commons/proper/pool/trunk/src/java/org/apache/commons/pool: ./ composite/
Date Sun, 09 Dec 2007 01:08:59 GMT
Author: sebb
Date: Sat Dec  8 17:08:57 2007
New Revision: 602598

URL: http://svn.apache.org/viewvc?rev=602598&view=rev
Log:
Comment assert statements as they are Java 1.5+

Modified:
    commons/proper/pool/trunk/src/java/org/apache/commons/pool/PoolUtils.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/AbstractLender.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/AbstractManager.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/FailManager.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/FifoLender.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/GrowManager.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/IdleLimitManager.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/LifoLender.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/WaitLimitManager.java

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/PoolUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/PoolUtils.java?rev=602598&r1=602597&r2=602598&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/PoolUtils.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/PoolUtils.java Sat Dec  8 17:08:57
2007
@@ -349,14 +349,14 @@
         if (pool == null) {
             throw new IllegalArgumentException("pool must not be null.");
         }
-        assert !(pool instanceof GenericObjectPool)
-                : "GenericObjectPool is already thread-safe";
-        assert !(pool instanceof SoftReferenceObjectPool)
-                : "SoftReferenceObjectPool is already thread-safe";
-        assert !(pool instanceof StackObjectPool)
-                : "StackObjectPool is already thread-safe";
-        assert !"org.apache.commons.pool.composite.CompositeObjectPool".equals(pool.getClass().getName())
-                : "CompositeObjectPools are already thread-safe";
+//        assert !(pool instanceof GenericObjectPool)
+//                : "GenericObjectPool is already thread-safe";
+//        assert !(pool instanceof SoftReferenceObjectPool)
+//                : "SoftReferenceObjectPool is already thread-safe";
+//        assert !(pool instanceof StackObjectPool)
+//                : "StackObjectPool is already thread-safe";
+//        assert !"org.apache.commons.pool.composite.CompositeObjectPool".equals(pool.getClass().getName())
+//                : "CompositeObjectPools are already thread-safe";
         return new SynchronizedObjectPool(pool);
     }
 
@@ -378,12 +378,12 @@
         if (keyedPool == null) {
             throw new IllegalArgumentException("keyedPool must not be null.");
         }
-        assert !(keyedPool instanceof GenericKeyedObjectPool)
-                : "GenericKeyedObjectPool is already thread-safe";
-        assert !(keyedPool instanceof StackKeyedObjectPool)
-                : "StackKeyedObjectPool is already thread-safe";
-        assert !"org.apache.commons.pool.composite.CompositeKeyedObjectPool".equals(keyedPool.getClass().getName())
-                : "CompositeKeyedObjectPools are already thread-safe";
+//        assert !(keyedPool instanceof GenericKeyedObjectPool)
+//                : "GenericKeyedObjectPool is already thread-safe";
+//        assert !(keyedPool instanceof StackKeyedObjectPool)
+//                : "StackKeyedObjectPool is already thread-safe";
+//        assert !"org.apache.commons.pool.composite.CompositeKeyedObjectPool".equals(keyedPool.getClass().getName())
+//                : "CompositeKeyedObjectPools are already thread-safe";
         return new SynchronizedKeyedObjectPool(keyedPool);
     }
 

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/AbstractLender.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/AbstractLender.java?rev=602598&r1=602597&r2=602598&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/AbstractLender.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/AbstractLender.java
Sat Dec  8 17:08:57 2007
@@ -51,7 +51,7 @@
 
     public void repay(final Object obj) {
         final List pool = getObjectPool().getPool();
-        assert Thread.holdsLock(pool);
+//        assert Thread.holdsLock(pool);
         pool.add(obj);
         pool.notifyAll();
     }

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/AbstractManager.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/AbstractManager.java?rev=602598&r1=602597&r2=602598&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/AbstractManager.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/AbstractManager.java
Sat Dec  8 17:08:57 2007
@@ -86,7 +86,7 @@
      * @param obj the object to return to the pool.
      */
     public void returnToPool(final Object obj) {
-        assert Thread.holdsLock(objectPool.getPool());
+//        assert Thread.holdsLock(objectPool.getPool());
         objectPool.getLender().repay(obj);
     }
 

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/FailManager.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/FailManager.java?rev=602598&r1=602597&r2=602598&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/FailManager.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/FailManager.java
Sat Dec  8 17:08:57 2007
@@ -55,7 +55,7 @@
      * @throws Exception usually from {@link PoolableObjectFactory} methods.
      */
     public Object nextFromPool() throws Exception {
-        assert Thread.holdsLock(objectPool.getPool());
+//        assert Thread.holdsLock(objectPool.getPool());
         Object obj = null;
         // Drain until good or empty
         while (objectPool.getLender().size() > 0 && obj == null) {

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/FifoLender.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/FifoLender.java?rev=602598&r1=602597&r2=602598&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/FifoLender.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/FifoLender.java Sat
Dec  8 17:08:57 2007
@@ -35,7 +35,7 @@
 
     public Object borrow() {
         final List pool = getObjectPool().getPool();
-        assert Thread.holdsLock(pool);
+//        assert Thread.holdsLock(pool);
         if (pool instanceof LinkedList) {
             return ((LinkedList)pool).removeFirst();
         } else {

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/GrowManager.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/GrowManager.java?rev=602598&r1=602597&r2=602598&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/GrowManager.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/GrowManager.java
Sat Dec  8 17:08:57 2007
@@ -49,7 +49,7 @@
      * @throws Exception when {@link PoolableObjectFactory#makeObject()} fails.
      */
     public Object nextFromPool() throws Exception {
-        assert Thread.holdsLock(objectPool.getPool());
+//        assert Thread.holdsLock(objectPool.getPool());
         Object obj = null;
 
         final long startActivateTime = System.currentTimeMillis();

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/IdleLimitManager.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/IdleLimitManager.java?rev=602598&r1=602597&r2=602598&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/IdleLimitManager.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/IdleLimitManager.java
Sat Dec  8 17:08:57 2007
@@ -49,7 +49,7 @@
      * @param obj the object to return to the pool.
      */
     public void returnToPool(final Object obj) {
-        assert Thread.holdsLock(objectPool.getPool());
+//        assert Thread.holdsLock(objectPool.getPool());
         if (maxIdle > 0 && maxIdle <= objectPool.getNumIdle()) {
             // XXX Does this remove the most stale object in
             final ListIterator iter = objectPool.getLender().listIterator();

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/LifoLender.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/LifoLender.java?rev=602598&r1=602597&r2=602598&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/LifoLender.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/LifoLender.java Sat
Dec  8 17:08:57 2007
@@ -35,7 +35,7 @@
 
     public Object borrow() {
         final List pool = getObjectPool().getPool();
-        assert Thread.holdsLock(pool);
+//        assert Thread.holdsLock(pool);
         if (pool instanceof LinkedList) {
             return ((LinkedList)pool).removeLast();
         } else {

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/WaitLimitManager.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/WaitLimitManager.java?rev=602598&r1=602597&r2=602598&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/WaitLimitManager.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/composite/WaitLimitManager.java
Sat Dec  8 17:08:57 2007
@@ -53,7 +53,7 @@
      */
     public Object nextFromPool() throws NoSuchElementException, Exception, InterruptedException
{
         final Object poolLock = objectPool.getPool();
-        assert Thread.holdsLock(poolLock);
+//        assert Thread.holdsLock(poolLock);
         final long endTime = maxWaitMillis > 0 ? System.currentTimeMillis() + maxWaitMillis
: Long.MAX_VALUE;
         while (maxWaitMillis <= 0 || endTime > System.currentTimeMillis()) {
             if (Thread.currentThread().isInterrupted()) {



Mime
View raw message