Liron Aravot has posted comments on this change. Change subject: core: Quota refactor - parameters ......................................................................
Patch Set 14: (6 inline comments) .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaConsumptionParameter.java Line 4: import org.ovirt.engine.core.compat.Guid; Line 5: Line 6: public abstract class QuotaConsumptionParameter implements Cloneable{ Line 7: private Guid quotaGuid; Line 8: private Quota quota; it will be overriden in the ctor anyway as it appears.. Line 9: private QuotaAction quotaAction = QuotaAction.CONSUME; Line 10: Line 11: protected QuotaConsumptionParameter(Guid quotaGuid, Quota quota, QuotaAction quotaAction) { Line 12: this.quotaGuid = quotaGuid; Line 38: this.quotaAction = quotaAction; Line 39: } Line 40: Line 41: public abstract ParameterType getParameterType(); Line 42: should be static. Line 43: public enum QuotaAction { Line 44: CONSUME, RELEASE Line 45: } Line 46: .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaConsumptionParametersWrapper.java Line 55: public QuotaConsumptionParametersWrapper clone() throws CloneNotSupportedException { Line 56: QuotaConsumptionParametersWrapper cloneWrapper = new QuotaConsumptionParametersWrapper(getAuditLogable(), Line 57: canDoActionMessages); Line 58: cloneWrapper.setParameters(new ArrayList<QuotaConsumptionParameter>()); Line 59: parameters can be null and cause NPE Line 60: for (QuotaConsumptionParameter parameter : getParameters()) { Line 61: cloneWrapper.getParameters().add(parameter.clone()); Line 62: } Line 63: .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaStorageConsumptionParameter.java Line 10: Line 11: public QuotaStorageConsumptionParameter(Guid quotaGuid, Line 12: Quota quota, Line 13: QuotaAction quotaAction, Line 14: Guid storageDomainId, can it be to be null? if not it should be primitive.. Line 15: Double requestedStorageGB) { Line 16: super(quotaGuid, quota, quotaAction); Line 17: this.storageDomainId = storageDomainId; Line 18: this.requestedStorageGB = requestedStorageGB; Line 36: Line 37: @Override Line 38: public QuotaStorageConsumptionParameter clone() throws CloneNotSupportedException { Line 39: return new QuotaStorageConsumptionParameter( Line 40: getQuotaGuid(), isn't quata mutuable? no problem with it being the same instance? Line 41: getQuota(), Line 42: getQuotaAction(), Line 43: storageDomainId, Line 44: requestedStorageGB); .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaVdsGroupConsumptionParameter.java Line 47: Line 48: @Override Line 49: public QuotaVdsGroupConsumptionParameter clone() throws CloneNotSupportedException { Line 50: return new QuotaVdsGroupConsumptionParameter( Line 51: getQuotaGuid(), isn't quata mutuable? no problem with it being the same instance? Line 52: getQuota(), Line 53: getQuotaAction(), Line 54: vdsGroupId, Line 55: requestedCpu, -- To view, visit http://gerrit.ovirt.org/8775 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iebfc85569ba1aa8bd840f7239f83b7f921a4bd8e Gerrit-PatchSet: 14 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: ofri masad <oma...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com> Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Laszlo Hornyak <lhorn...@redhat.com> Gerrit-Reviewer: Liron Aravot <lara...@redhat.com> Gerrit-Reviewer: Michael Kublin <mkub...@redhat.com> Gerrit-Reviewer: Sharad Mishra <snmis...@linux.vnet.ibm.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: ofri masad <oma...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches