commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject cvs commit: jakarta-commons/dbcp/src/java/org/apache/commons/dbcp BasicDataSource.java
Date Mon, 11 Aug 2003 15:02:07 GMT
dirkv       2003/08/11 08:02:07

  Modified:    dbcp/src/java/org/apache/commons/dbcp BasicDataSource.java
  Log:
  Bugzilla Bug 21748:  BasicDataSource.close() throws NPE
  
  If a BasicDataSource is closed without having been used, the connectionPool
  will not have been initialised and a NPE will be thrown.
  (Reported by Aaron Knauf)
  
  Revision  Changes    Path
  1.15      +7 -5      jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/BasicDataSource.java
  
  Index: BasicDataSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/BasicDataSource.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- BasicDataSource.java	9 Apr 2003 02:39:16 -0000	1.14
  +++ BasicDataSource.java	11 Aug 2003 15:02:07 -0000	1.15
  @@ -589,7 +589,9 @@
           connectionPool = null;
           dataSource = null;
           try {
  -            oldpool.close();
  +            if (oldpool != null) {
  +                oldpool.close();
  +            }
           } catch(SQLException e) {
               throw e;
           } catch(RuntimeException e) {
  
  
  

Mime
View raw message