You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Kevin Ruland (JIRA)" <ji...@apache.org> on 2006/08/16 17:27:13 UTC

[jira] Created: (DBCP-198) PoolingDataSource.PoolGuardConnectionWrapper equals() implementation incorrect

PoolingDataSource.PoolGuardConnectionWrapper equals() implementation incorrect
------------------------------------------------------------------------------

                 Key: DBCP-198
                 URL: http://issues.apache.org/jira/browse/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: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Resolved: (DBCP-198) PoolingDataSource.PoolGuardConnectionWrapper equals() implementation incorrect

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DBCP-198?page=all ]

Phil Steitz resolved DBCP-198.
------------------------------

    Resolution: Fixed

This bug only manifests when wrapped connections are not DelegatingConnections.  The implementation of equals in DelegatingConnection masks the problem in this subclass.

Fixed in r441852.

> PoolingDataSource.PoolGuardConnectionWrapper equals() implementation incorrect
> ------------------------------------------------------------------------------
>
>                 Key: DBCP-198
>                 URL: http://issues.apache.org/jira/browse/DBCP-198
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>            Reporter: Kevin Ruland
>             Fix For: 1.2.2
>
>
> 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: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (DBCP-198) PoolingDataSource.PoolGuardConnectionWrapper equals() implementation incorrect

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DBCP-198?page=comments#action_12445464 ] 
            
Phil Steitz commented on DBCP-198:
----------------------------------

Additional tests and fix to handle the case where accessToUnderlyingConnection is false committed in r469008.

> PoolingDataSource.PoolGuardConnectionWrapper equals() implementation incorrect
> ------------------------------------------------------------------------------
>
>                 Key: DBCP-198
>                 URL: http://issues.apache.org/jira/browse/DBCP-198
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>            Reporter: Kevin Ruland
>             Fix For: 1.2.2
>
>
> 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: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Updated: (DBCP-198) PoolingDataSource.PoolGuardConnectionWrapper equals() implementation incorrect

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DBCP-198?page=all ]

Phil Steitz updated DBCP-198:
-----------------------------

    Fix Version/s: 1.2.2

> PoolingDataSource.PoolGuardConnectionWrapper equals() implementation incorrect
> ------------------------------------------------------------------------------
>
>                 Key: DBCP-198
>                 URL: http://issues.apache.org/jira/browse/DBCP-198
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>            Reporter: Kevin Ruland
>             Fix For: 1.2.2
>
>
> 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: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org