Return-Path: Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 55916 invoked by uid 500); 11 Aug 2003 15:02:02 -0000 Received: (qmail 55902 invoked from network); 11 Aug 2003 15:02:02 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 11 Aug 2003 15:02:02 -0000 Received: (qmail 66778 invoked by uid 1340); 11 Aug 2003 15:02:07 -0000 Date: 11 Aug 2003 15:02:07 -0000 Message-ID: <20030811150207.66777.qmail@minotaur.apache.org> From: dirkv@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/dbcp/src/java/org/apache/commons/dbcp BasicDataSource.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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) {