leif        2002/11/06 20:50:15

  Modified:    datasource/src/java/org/apache/avalon/excalibur/datasource
                        AbstractJdbcConnection.java
  Log:
  Fix a NPE caused when the m_statements variable is not set.  As a note, I don't
  see where it is ever set.  Was this an unintentional commit?  It does not appear
  to be a complete feature.   This needs to be cleaned up.
  
  Revision  Changes    Path
  1.20      +12 -9     
jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/AbstractJdbcConnection.java
  
  Index: AbstractJdbcConnection.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/AbstractJdbcConnection.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- AbstractJdbcConnection.java       6 Nov 2002 08:22:26 -0000       1.19
  +++ AbstractJdbcConnection.java       7 Nov 2002 04:50:15 -0000       1.20
  @@ -116,15 +116,18 @@
           {
               m_connection.clearWarnings();
   
  -            Iterator it = m_statements.keySet().iterator();
  -            while (it.hasNext())
  +            if ( m_statements != null )
               {
  -                Object key = it.next();
  -                Statement statement = (Statement)m_statements.get( key );
  -
  -                try { statement.close(); } catch ( SQLException se ) {}
  -
  -                m_statements.remove( key );
  +                Iterator it = m_statements.keySet().iterator();
  +                while (it.hasNext())
  +                {
  +                    Object key = it.next();
  +                    Statement statement = (Statement)m_statements.get( key );
  +    
  +                    try { statement.close(); } catch ( SQLException se ) {}
  +    
  +                    m_statements.remove( key );
  +                }
               }
           }
           catch( SQLException se )
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@;jakarta.apache.org>

Reply via email to