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

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

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment