You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2012/09/12 07:48:07 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 ]
Henri Yandell updated LANG-809:
-------------------------------
Component/s: lang.builder.*
> 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
> Components: lang.builder.*
> 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
For more information on JIRA, see: http://www.atlassian.com/software/jira