bloritsch 02/02/25 11:21:49
Modified: src/java/org/apache/avalon/excalibur/collections
VariableSizeBuffer.java
Log:
Fix for attempting to add null to buffer.
Revision Changes Path
1.3 +6 -1
jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/collections/VariableSizeBuffer.java
Index: VariableSizeBuffer.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/collections/VariableSizeBuffer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- VariableSizeBuffer.java 8 Jan 2002 18:06:07 -0000 1.2
+++ VariableSizeBuffer.java 25 Feb 2002 19:21:49 -0000 1.3
@@ -14,7 +14,7 @@
*
* @author <a href="[EMAIL PROTECTED]">Federico Barbieri</a>
* @author <a href="[EMAIL PROTECTED]">Berin Loritsch</a>
- * @version CVS $Revision: 1.2 $ $Date: 2002/01/08 18:06:07 $
+ * @version CVS $Revision: 1.3 $ $Date: 2002/02/25 19:21:49 $
* @since 4.0
*/
public final class VariableSizeBuffer implements Buffer
@@ -79,6 +79,11 @@
*/
public final void add( final Object o )
{
+ if ( null == element )
+ {
+ throw new NullPointerException("Attempted to add null object to
buffer");
+ }
+
if( size() + 1 >= m_buffer.length )
{
Object[] tmp = new Object[ ( (m_buffer.length - 1) * 2) + 1 ];
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>