[CONTROLLER-14] Replace EqualsBuilder and HashBuilder for performance Created: 15/May/13  Updated: 19/Oct/17  Resolved: 05/May/15

Status: Resolved
Project: controller
Component/s: adsal
Affects Version/s: 0.4.0
Fix Version/s: None

Type: Improvement
Reporter: Ed Warnicke Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All



 Description   

Currently EqualsBuilder

http://commons.apache.org/proper/commons-lang///javadocs/api-2.6/org/apache/commons/lang/builder/EqualsBuilder.html

and HashCodeBuilder

http://commons.apache.org/proper/commons-lang///javadocs/api-2.6/org/apache/commons/lang/builder/HashCodeBuilder.html

are being used in many places within the code. These should be replaced for performance reasons.

Eclipse provides a facility to autogenerate replacements and its use should be explored.



 Comments   
Comment by Ed Warnicke [ 15/May/13 ]

EqualsBuilder uses the standard Bloch algorithm for equals:

http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java?view=markup

and Eclipse appears to do likewise with its generated code.

HashCodeBuilder's algorithm is described here:
http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java?view=markup

and also appears to match what Eclipse is generating.

Comment by Ed Warnicke [ 15/May/13 ]

First initial pass at a fix (for one file only) in:
https://git.opendaylight.org/gerrit/#/c/342/

Comment by Ed Warnicke [ 16/May/13 ]

Fixed a bunch more, in small chunks for easy review:

https://git.opendaylight.org/gerrit/#/c/349/
https://git.opendaylight.org/gerrit/#/c/350/
https://git.opendaylight.org/gerrit/#/c/351/
https://git.opendaylight.org/gerrit/#/c/352/
https://git.opendaylight.org/gerrit/#/c/353/
https://git.opendaylight.org/gerrit/#/c/354/
https://git.opendaylight.org/gerrit/#/c/355/

Comment by Carol Sanders [ 05/May/15 ]

This bug is part of the project to Move all ADSAL associated component bugs to ADSAL.

Generated at Wed Feb 07 19:51:58 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.