Uploaded image for project: 'Commons DBCP'
  1. Commons DBCP
  2. DBCP-316

datasources.SharedPoolDataSource.getPooledConnectionAndInfo() contains an impossible null check

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      datasources.SharedPoolDataSource.getPooledConnectionAndInfo() contains an impossible null check:

      synchronized (userKeys) {
          key = getUserPassKey(username, password);
      }
              
      try {
          info = (PooledConnectionAndInfo) pool.borrowObject(key);
      }
      catch (SQLException ex) {  // Remove bad UserPassKey
          if (userKeys != null) { // <== cannot be null here, else synch. would have failed with NPE
      ...
      

      The null check should be removed, as userKeys cannot be null (it is a final variable, and set non-null).

      Attachments

        Activity

          People

            Unassigned Unassigned
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: