You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Rob Gansevles (JIRA)" <ji...@apache.org> on 2010/06/10 22:51:38 UTC

[jira] Created: (DBCP-337) equals in DelegatingXXX is not reflexive and could be faster

equals in DelegatingXXX is not reflexive and could be faster
------------------------------------------------------------

                 Key: DBCP-337
                 URL: https://issues.apache.org/jira/browse/DBCP-337
             Project: Commons Dbcp
          Issue Type: Bug
            Reporter: Rob Gansevles
            Priority: Minor


The equals() methods in the different DelegatingXXX classes do not start with a simple object equality check for this.
The equals methods do not implement the contract for equals because x.equals(x) where getInnermostDelegate() for x returns null will return false.
Performance-wise the check would help since you don't need to walk the delegate tree.

I will attach a patch.

Rob


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DBCP-337) equals in DelegatingXXX is not reflexive and could be faster

Posted by "Rob Gansevles (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DBCP-337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rob Gansevles updated DBCP-337:
-------------------------------

    Attachment: delegate_equals_patch

this patch adds an '==' check as first statement to the equals() methods.
Patch is against trunk.

Rob

> equals in DelegatingXXX is not reflexive and could be faster
> ------------------------------------------------------------
>
>                 Key: DBCP-337
>                 URL: https://issues.apache.org/jira/browse/DBCP-337
>             Project: Commons Dbcp
>          Issue Type: Bug
>            Reporter: Rob Gansevles
>            Priority: Minor
>         Attachments: delegate_equals_patch
>
>
> The equals() methods in the different DelegatingXXX classes do not start with a simple object equality check for this.
> The equals methods do not implement the contract for equals because x.equals(x) where getInnermostDelegate() for x returns null will return false.
> Performance-wise the check would help since you don't need to walk the delegate tree.
> I will attach a patch.
> Rob

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.