You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by le...@apache.org on 2002/01/26 17:54:22 UTC

cvs commit: jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/pool AbstractPool.java

leif        02/01/26 08:54:22

  Modified:    src/java/org/apache/avalon/excalibur/pool AbstractPool.java
  Log:
  Fixed a null pointer exception caused by the getCreatedClass method of the
  factory returning a null value.
  
  Revision  Changes    Path
  1.9       +12 -3     jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/pool/AbstractPool.java
  
  Index: AbstractPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/pool/AbstractPool.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AbstractPool.java	26 Dec 2001 16:15:22 -0000	1.8
  +++ AbstractPool.java	26 Jan 2002 16:54:22 -0000	1.9
  @@ -23,7 +23,7 @@
    * This is an <code>Pool</code> that caches Poolable objects for reuse.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.8 $ $Date: 2001/12/26 16:15:22 $
  + * @version CVS $Revision: 1.9 $ $Date: 2002/01/26 16:54:22 $
    * @since 4.0
    */
   public abstract class AbstractPool
  @@ -129,8 +129,17 @@
               {
                   if( null != getLogger() && getLogger().isDebugEnabled() )
                   {
  -                    getLogger().debug( m_factory.getCreatedClass().getName() +
  -                                       ": could not be instantiated.", e );
  +                    Class createdClass = m_factory.getCreatedClass();
  +                    if (createdClass == null)
  +                    {
  +                        getLogger().debug( "factory created class was null so a new "
  +                            + "instance could not be created.", e );
  +                    }
  +                    else
  +                    {
  +                        getLogger().debug( createdClass.getName() +
  +                                           ": could not be instantiated.", e );
  +                    }
                   }
               }
           }
  
  
  

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