Gilad Chaplik has posted comments on this change.

Change subject: common: introduce qos package, and storage qos
......................................................................


Patch Set 5:

(6 comments)

http://gerrit.ovirt.org/#/c/27093/5/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/qos/BaseQos.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/qos/BaseQos.java:

Line 14: /**
Line 15:  * Base abstract class for QoS objects
Line 16:  *
Line 17:  */
Line 18: public abstract class BaseQos extends IVdcQueryable implements 
BusinessEntity<Guid>, Serializable {
> +1 for QosBase
will consider..
Line 19:     private static final long serialVersionUID = 1122772549710787678L;
Line 20:     private Guid id = Guid.Empty;
Line 21:     private QosType qoSType;
Line 22: 


Line 54:      *
Line 55:      * @param other
Line 56:      * @return are equals
Line 57:      */
Line 58:     public abstract boolean equalValues(BaseQos other);
> 1. when you say "vnic", please be aware that "vnic" != "NetworkQoS"
1) I'm perfectly aware that vnic != network qos, don't worry about it :)

2) ***
Line 59: 
Line 60:     /**
Line 61:      * @return derived values hash code
Line 62:      */


Line 59: 
Line 60:     /**
Line 61:      * @return derived values hash code
Line 62:      */
Line 63:     protected abstract int valuesHashCode();
> According to my comment on hashCode method, this method is redundant.
***
Line 64: 
Line 65:     @Override
Line 66:     public Guid getId() {
Line 67:         return id;


Line 95: 
Line 96:     @Override
Line 97:     public int hashCode() {
Line 98:         final int prime = 31;
Line 99:         int result = valuesHashCode();
> valuesHashCode should not be called here. The identity of the object is def
***
Line 100:         result = prime * result + ((id == null) ? 0 : id.hashCode());
Line 101:         result = prime * result + ((name == null) ? 0 : 
name.hashCode());
Line 102:         result = prime * result + ((qoSType == null) ? 0 : 
qoSType.hashCode());
Line 103:         result = prime * result + ((storagePoolId == null) ? 0 : 
storagePoolId.hashCode());


Line 112:             return false;
Line 113:         if (getClass() != obj.getClass())
Line 114:             return false;
Line 115:         BaseQos other = (BaseQos) obj;
Line 116:         if (id == null) {
> Done
***
Line 117:             if (other.id != null)
Line 118:                 return false;
Line 119:         } else if (!id.equals(other.id))
Line 120:             return false;


Line 129:             if (other.storagePoolId != null)
Line 130:                 return false;
Line 131:         } else if (!storagePoolId.equals(other.storagePoolId))
Line 132:             return false;
Line 133:         return equalValues(other);
> equalValues should not be called here. The identity of the object is define
[***] Answering all of your above comments together:

AFAIK, in OOP you use inheritance in order to make your life easier and to 
enforce things to happen, that is what I'm trying to do here.

In my humble opinion I think that enough time was spent on this petty issue. 
you can either score, debate on that with others or ignore.

Thanks!
Line 134:     }
Line 135: 


-- 
To view, visit http://gerrit.ovirt.org/27093
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1a9af59277b5055453159f002f19046c0051d8ff
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Kobi Ianko <[email protected]>
Gerrit-Reviewer: Lior Vernia <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Yevgeny Zaspitsky <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to