Please expose setEquals(boolean) as public so EqualsBuilder instances can be 
reused
-----------------------------------------------------------------------------------

                 Key: LANG-466
                 URL: https://issues.apache.org/jira/browse/LANG-466
             Project: Commons Lang
          Issue Type: Improvement
    Affects Versions: 2.4
            Reporter: Lauren Bish
            Priority: Minor


I use EqualsBuilder a lot in equals methods for POJOs and sometimes in utility 
methods to compare properties in DAOs. These methods get called a lot in my 
apps, and I would prefer to reuse an instance of EqualsBuilder instead of 
creating a new instance every time the methods are called. In one method, where 
I retrieve data from a database, a comparison method could be called thousands 
of times in a second. Yes, I have been careful about being threadsafe in my 
reuse of a single EqualsBuilder instance.

The problem is that (as I understand it), once an instance of EqualsBuilder has 
set isEquals to false, it stays false and all comparisons thereafter return 
false whether equal or not. I have overriden the setEquals() method to be 
public and call this before I start the comparison in my methods and this 
allows me to reuse EqualsBuilder. 

I believe setEquals() should be changed to be public in EqualsBuilder as others 
surely use it in a similar manner.


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

Reply via email to