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

PoolingDataSource.PoolGuardConnectionWrapper equals() implementation incorrect

    XMLWordPrintableJSON

Details

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

    Description

      The Object.equals( Object ) implementation in PoolingDataSource.PoolGuardConnectionWrapper is broken because it does not attempt to test if the outermost objects are equal. It should be replaced with something like:

      public boolean equals(Object obj) {
      if ( obj == this ) return true;
      if ( obj instanceof PoolGuardConnectionWrapper ) {
      return delegate.equals( ((PoolGuardConnectionWrapper) obj).delegate );
      return false;
      }

      The current implementation prevents putting PoolGuardConenctionWrapper objects in Collections and using the standard contains( Object ) or remove( Object ) methods.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kruland Kevin Ruland
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: