Alon Bar-Lev has posted comments on this change.

Change subject: engine: Add infrastructure code for removal of parameter classes
......................................................................


Patch Set 12:

(4 comments)

....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VdcParametersMap.java
Line 40:             throw new 
InvalidParameterValueException(param.getJavaType(), value.getClass());
Line 41:         }
Line 42:     }
Line 43: 
Line 44:     private void raiseExceptionIfInvalidReturnType(Class javaType, 
Class valueType) {
this is used only once, can we squash into caller?
Line 45:         if (!valueType.equals(javaType)) {
Line 46:             throw new InvalidParameterRequestTypeException(javaType, 
valueType);
Line 47:         }
Line 48:     }


Line 62:     public boolean equals(Object obj) {
Line 63:         if (this == obj) {
Line 64:             return true;
Line 65:         }
Line 66:         if (obj == null || getClass() != obj.getClass()) {
why here don't you use instanceof?
Line 67:             return false;
Line 68:         }
Line 69:         return paramsMap.equals(((VdcParametersMap) obj).paramsMap);
Line 70:     }


....................................................
File 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/serialization/json/JsonObjectDeserializer.java
Line 53:         
formattedMapper.getDeserializationConfig().addMixInAnnotations(VmStatic.class, 
JsonVmStaticMixIn.class);
Line 54:         formattedMapper.configure(Feature.FAIL_ON_UNKNOWN_PROPERTIES, 
false);
Line 55:         SimpleModule module = new SimpleModule("VdcParameterModule", 
new Version(1, 0, 0, "M"));
Line 56:         module.addKeyDeserializer(VdcParameter.class, new 
VdcParameterDeserializer());
Line 57:         formattedMapper.registerModule(module);
can't we use the same magic for annotation of the guid and value?
Line 58:         formattedMapper.enableDefaultTyping();
Line 59:     }
Line 60: 
Line 61:     @Override


....................................................
File 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/serialization/json/JsonObjectSerializer.java
Line 99:     public String serializeUnformattedJson(Serializable payload) 
throws SerializationExeption {
Line 100:         return writeJsonAsString(payload, unformattedMapper);
Line 101:     }
Line 102: 
Line 103:     private static class VdcParameterSerializer extends 
JsonSerializer<VdcParameter> {
question, can't this go into VdcParameter scope?

Also, can't we use annotation magic as well so it be done automatically?
Line 104:         @Override
Line 105:         public void serialize(VdcParameter key, JsonGenerator jg, 
SerializerProvider sp) throws IOException {
Line 106:             jg.writeFieldName(VdcParameter.serialize(key));
Line 107:         }


-- 
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: 12
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

Reply via email to