Laszlo Hornyak has posted comments on this change.
Change subject: engine: hashcode method simplification
......................................................................
Patch Set 1: (3 inline comments)
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/HashCodeBuilder.java
Line 1: package org.ovirt.engine.core.common.utils;
Line 2:
Line 3: public class HashCodeBuilder {
Line 4: public HashCodeBuilder(final int prime) {
Line 5: super();
Done
Line 6: this.prime = prime;
Line 7: }
Line 8:
Line 9: public HashCodeBuilder() {
Line 10: this(31);
Line 11: }
Line 12:
Line 13: final int prime;
Line 14: int result = 1;
Done
Line 15:
Line 16: public HashCodeBuilder append(Object obj) {
Line 17: return append(ObjectUtils.hashCode(obj));
Line 18: }
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/ObjectUtils.java
Line 22: return bd1 == bd2 || bd1 != null && bd2 != null &&
bd1.compareTo(bd2) == 0;
Line 23: }
Line 24:
Line 25: public static int hashCode(Object obj) {
Line 26: if(obj == null) {
this method is called with the data fields of a bean, and most of them can be
null
Line 27: return 0;
Line 28: } else {
Line 29: return obj.hashCode();
Line 30: }
--
To view, visit http://gerrit.ovirt.org/14386
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I15afc6227f2a4d67befbdfe67b8c42b381308228
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Greg Padgett <[email protected]>
Gerrit-Reviewer: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches