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

PoolingDataSource.PoolGuardConnectionWrapper equals() implementation incorrect

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: 1.2.2
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: