tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1366896 - /tomcat/trunk/java/org/apache/catalina/tribes/io/BufferPool.java
Date Sun, 29 Jul 2012 19:15:55 GMT
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


Mime
View raw message