You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Corey Jewett <cj...@syntheticplayground.com> on 2002/09/27 19:12:05 UTC

[PATCH] mpool/VariableSizePool

Check the buffer size instead of relying on BufferUnderflowException. 

Corey


Index: src/java/org/apache/excalibur/mpool/VariableSizePool.java
===================================================================
RCS file:
/home/cvspublic/jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/mpool/VariableSizePool.java,v
retrieving revision 1.4
diff -u -r1.4 VariableSizePool.java
--- src/java/org/apache/excalibur/mpool/VariableSizePool.java	25 Sep
2002 15:50:26 -0000	1.4
+++ src/java/org/apache/excalibur/mpool/VariableSizePool.java	27 Sep
2002 17:09:29 -0000
@@ -59,6 +59,7 @@
  * Please note that this pool offers no resource limiting whatsoever.
  *
  * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
+ * @author Corey Jewett [cj at syntheticplayground.com]
  * @version CVS $Revision: 1.4 $ $Date: 2002/09/25 15:50:26 $
  * @since 4.1
  */
@@ -108,16 +109,12 @@
 
         Object object = null;
 
-        try
+        synchronized( m_buffer )
         {
-            synchronized( m_buffer )
+            if( m_buffer.size() > 0)
             {
                 object = m_buffer.remove();
             }
-        }
-        catch( BufferUnderflowException bue )
-        {
-            object = newInstance();
         }
 
         if( null == object )



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>