avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/collections VariableSizeBuffer.java
Date Mon, 25 Feb 2002 19:21:49 GMT
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="fede@apache.org">Federico Barbieri</a>
    * @author  <a href="bloritsch@apache.org">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:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message