Alon Bar-Lev has posted comments on this change. Change subject: engine: Add infrastructure code for removal of parameter classes ......................................................................
Patch Set 8: (3 comments) .................................................... File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VdcParametersMap.java Line 62: if (size() != otherParamsMap.size()) { Line 63: return false; Line 64: } Line 65: for (Entry<VdcParameter, Object> entry : paramsMap.entrySet()) { Line 66: Object otherValue = otherParamsMap.get(entry.getKey(), entry.getKey().getJavaType()); you can have this method, but delegate it to map... public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } VdcParametersMap otherParamsMap = (VdcParametersMap) obj; return paramsMap.equals(otherParamsMap.paramsMap) } Line 67: if (otherValue == null) { Line 68: return false; Line 69: } Line 70: Object thisValue = entry.getValue(); Line 95: for (Entry<VdcParameter, Object> entry : paramsMap.entrySet()) { Line 96: copy.put(entry.getKey(), entry.getValue()); Line 97: } Line 98: return copy; Line 99: } but you are performing shallow copy... Line 100: Line 101: /** Line 102: * Used by Json deserializer. Copy the contents of the map by calling Line 103: * put method which does the type checking Line 102: * Used by Json deserializer. Copy the contents of the map by calling Line 103: * put method which does the type checking Line 104: */ Line 105: public void setParamsMap(Map<VdcParameter, Object> paramsMap) { Line 106: this.paramsMap = new HashMap<VdcParameter, Object>(); correct, the type checking is a good reason. Line 107: for (Entry<VdcParameter, Object> entry : paramsMap.entrySet()) { Line 108: put(entry.getKey(), entry.getValue()); Line 109: } Line 110: } -- To view, visit http://gerrit.ovirt.org/20414 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6a0970e492c0eff561888a46b02e47645ff68fc3 Gerrit-PatchSet: 8 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Ravi Nori <rn...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Barak Azulay <bazu...@redhat.com> Gerrit-Reviewer: Liran Zelkha <lzel...@redhat.com> Gerrit-Reviewer: Ravi Nori <rn...@redhat.com> Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com> Gerrit-Reviewer: mooli tayer <mta...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches