Ravi Nori has posted comments on this change. Change subject: engine: Add infrastructure code for removal of parameter classes ......................................................................
Patch Set 5: (3 comments) .................................................... File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionParametersBase.java Line 257: return this; Line 258: } Line 259: Line 260: public <T> T getParameterValue(VdcParameter<T> param) { Line 261: return paramsMap.<T>get(param, param.getJavaType()); Will remove this method Line 262: } Line 263: Line 264: public <T> T getParameterValue(VdcParameter<T> param, Class<T> retType) { Line 265: return paramsMap.<T>get(param, retType); .................................................... File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VdcParameter.java Line 17: */ Line 18: private VdcParameter() { Line 19: } Line 20: Line 21: private VdcParameter(String name, Class<T> javaType, Guid guid) { Without Class<T> I can do this new VdcParameter<Guid>("name",String.class, guid) Which is not right Line 22: this.name = name; Line 23: this.javaType = javaType; Line 24: this.guid = guid; Line 25: } .................................................... File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VdcParametersMap.java Line 20: VdcParameterValue.raiseExceptionIfInvalidObjectType(param, value); Line 21: paramsMap.put(param.getGuid(), new VdcParameterValue<T>(param, value)); Line 22: } Line 23: Line 24: public <T> T get(VdcParameter<T> param) { Java works by erasure, so at run time we dont know what T is. We cant do what is suggested here Line 25: return get(param, param.getJavaType()); Line 26: } Line 27: Line 28: /** -- 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: 5 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