You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2012/07/29 21:15:55 UTC

svn commit: r1366896 - /tomcat/trunk/java/org/apache/catalina/tribes/io/BufferPool.java

Author: markt
Date: Sun Jul 29 19:15:54 2012
New Revision: 1366896

URL: http://svn.apache.org/viewvc?rev=1366896&view=rev
Log:
Simplify since minimum Java version is now >= 1.5

Modified:
    tomcat/trunk/java/org/apache/catalina/tribes/io/BufferPool.java

Modified: tomcat/trunk/java/org/apache/catalina/tribes/io/BufferPool.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/io/BufferPool.java?rev=1366896&r1=1366895&r2=1366896&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/io/BufferPool.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/io/BufferPool.java Sun Jul 29 19:15:54 2012
@@ -55,27 +55,18 @@ public class BufferPool {
 
 
     public static BufferPool getBufferPool() {
-        if (  (instance == null) ) {
+        if (instance == null) {
             synchronized (BufferPool.class) {
-                if ( instance == null ) {
-                   BufferPoolAPI pool = null;
-                   Class<?> clazz = null;
-                   try {
-                       // TODO Is this approach still required?
-                       clazz = Class.forName("org.apache.catalina.tribes.io.BufferPool15Impl");
-                       pool = (BufferPoolAPI)clazz.newInstance();
-                   } catch ( Throwable x ) {
-                       log.warn("Unable to initilize BufferPool, not pooling XByteBuffer objects:"+x.getMessage());
-                       if ( log.isDebugEnabled() ) log.debug("Unable to initilize BufferPool, not pooling XByteBuffer objects:",x);
-                   }
-                   if (pool != null) {
-                       pool.setMaxSize(DEFAULT_POOL_SIZE);
-                       log.info("Created a buffer pool with max size:"+DEFAULT_POOL_SIZE+" bytes of type:"+(clazz!=null?clazz.getName():"null"));
-                       instance = new BufferPool(pool);
-                   }
-                }//end if
-            }//sync
-        }//end if
+                if (instance == null) {
+                   BufferPoolAPI pool = new BufferPool15Impl();
+                   pool.setMaxSize(DEFAULT_POOL_SIZE);
+                   log.info("Created a buffer pool with max size:" +
+                           DEFAULT_POOL_SIZE + " bytes of type: " +
+                           pool.getClass().getName());
+                   instance = new BufferPool(pool);
+                }
+            }
+        }
         return instance;
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org