commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dgra...@apache.org
Subject cvs commit: jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/jdbc2pool Jdbc2PoolDataSource.java
Date Tue, 15 Apr 2003 01:58:54 GMT
dgraham     2003/04/14 18:58:54

  Modified:    dbcp/src/java/org/apache/commons/dbcp/jdbc2pool
                        Jdbc2PoolDataSource.java
  Log:
  Backed out previous changes because they made test cases fail.  I could not
  reproduce the reported problem in the test case.
  
  Revision  Changes    Path
  1.11      +13 -21    jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/jdbc2pool/Jdbc2PoolDataSource.java
  
  Index: Jdbc2PoolDataSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/jdbc2pool/Jdbc2PoolDataSource.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Jdbc2PoolDataSource.java	15 Apr 2003 01:32:42 -0000	1.10
  +++ Jdbc2PoolDataSource.java	15 Apr 2003 01:58:54 -0000	1.11
  @@ -1,12 +1,9 @@
  -/* 
  - * $Header$
  - * $Revision$
  - * $Date$
  - * 
  - * ====================================================================
  +package org.apache.commons.dbcp.jdbc2pool;
  +
  +/* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -57,8 +54,6 @@
    * <http://www.apache.org/>.
    */
    
  -package org.apache.commons.dbcp.jdbc2pool;
  - 
   import java.io.ByteArrayInputStream;
   import java.io.ByteArrayOutputStream;
   import java.io.IOException;
  @@ -1122,6 +1117,12 @@
                   throw new SQLException(e.getMessage());
               }
           }
  +        if(!(null == password ? null == info.getPassword() : password.equals(info.getPassword())))
  +        {
  +            closeDueToException(info);
  +            throw new SQLException("Given password did not match password used "
  +                                   + "to create the PooledConnection.");
  +        }
           PooledConnection pc = info.getPooledConnection();
   
           boolean defaultAutoCommit = isDefaultAutoCommit();
  @@ -1205,20 +1206,11 @@
   
       private UserPassKey getUserPassKey(String username, String password)
       {
  -        UserPassKey key = (UserPassKey) userKeys.get(username);
  -        if (key == null) {
  +        UserPassKey key = (UserPassKey)userKeys.get(username);
  +        if (key == null) 
  +        {
               key = new UserPassKey(username, password);
               userKeys.put(username, key);
  -            
  -        } else {
  -            String foundPass = key.getPassword();
  -            boolean passwordsEqual =
  -                (foundPass == null ? password == null : foundPass.equals(password));
  -
  -            if (!passwordsEqual) {
  -                key = new UserPassKey(username, password);
  -                userKeys.put(username, key);
  -            }
           }
           return key;
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message