commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Ruland (JIRA)" <>
Subject [jira] Created: (DBCP-198) PoolingDataSource.PoolGuardConnectionWrapper equals() implementation incorrect
Date Wed, 16 Aug 2006 15:27:13 GMT
PoolingDataSource.PoolGuardConnectionWrapper equals() implementation incorrect

                 Key: DBCP-198
             Project: Commons Dbcp
          Issue Type: Bug
    Affects Versions: 1.2.1
            Reporter: Kevin Ruland

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.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message