You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by bl...@apache.org on 2002/02/25 20:21:49 UTC

cvs commit: jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/collections VariableSizeBuffer.java

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/collections VariableSizeBuffer.java

Posted by Marcus Crafter <cr...@fztig938.bank.dresdner.net>.
Hi Berin,

On Mon, Feb 25, 2002 at 07:21:49PM -0000, bloritsch@apache.org wrote:
> bloritsch    02/02/25 11:21:49
> 
>    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");
>   +        }

	The parameter name in this case is 'o' :)

	Cheers,

	Marcus

-- 
        .....
     ,,$$$$$$$$$,      Marcus Crafter
    ;$'      '$$$$:    Computer Systems Engineer
    $:         $$$$:   ManageSoft GmbH
     $       o_)$$$:   82-84 Mainzer Landstrasse
     ;$,    _/\ &&:'   60327 Frankfurt Germany
       '     /( &&&
           \_&&&&'
          &&&&.
    &&&&&&&:

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