You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Colbert Philippe (JIRA)" <ji...@apache.org> on 2012/06/16 18:22:42 UTC

[jira] [Updated] (LANG-809) Encapsulate trival equal test into a method to avoid repeating over and over.....

     [ https://issues.apache.org/jira/browse/LANG-809?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colbert Philippe updated LANG-809:
----------------------------------

    Summary: Encapsulate trival equal test into a method to avoid repeating over and over.....  (was: Encapsulate trival equal test into a method to avoir repeating over and over.....)
    
> Encapsulate trival equal test into a method to avoid repeating over and over.....
> ---------------------------------------------------------------------------------
>
>                 Key: LANG-809
>                 URL: https://issues.apache.org/jira/browse/LANG-809
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 3.1
>         Environment: Windows 7
>            Reporter: Colbert Philippe
>            Priority: Minor
>              Labels: Encapsulate, EqualsBuilder, in, test, trivial
>
> In class EqualsBuilder, the documentation gives sample code on how to use EqualsBuilder.  The proper usage of class EqualsBuilder is a bit long.  My suggestion is to encapsulate the following trivial test into a method inside the class EqualsBuilder.  You call it the new method trivalTest(Object obj1, Object obj2).
>    // This is the code that should be put in a method to avoid repeating....
>    if (obj == null) { return false; }
>    if (obj == this) { return true; }
>    if (obj.getClass() != getClass()) {
>      return false;
>    }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira