Moti Asayag has posted comments on this change.

Change subject: core: Adds custom properties to VmDevice
......................................................................


Patch Set 4: (1 inline comment)

....................................................
File 
backend/manager/tools/src/main/java/org/ovirt/engine/core/config/entity/helper/DeviceCustomPropertiesValueHelper.java
Line 17:         String errMsg = null;
Line 18: 
Line 19:         // HACK, because ConfigValues are not loaded inside 
engine-config
Line 20:         Version version = new Version(key.getVersion());
Line 21:         if (Version.v3_3.compareTo(version) > 0) {
The condition is legit - it fails the operation if the given version is earlier 
to 3.3.

I don't think that having a one-liner as a method is a bad practice, especially 
when the method encapsulates a logic like in this case (which caused at least 
one reviewer to get confused ;-) )

Also, it is quite common in utilities classes to have one-line function, e.g. 
StringUtils.is*

So, if agree to go to the extracting a method direction, the condition from 
Yair's comment should be negated:

   if (!deviceCustomPropertiesSupported(version)){
   ...
   }
Line 22:             result = false;
Line 23:             errMsg = String.format("Device custom properties are not 
supported in version %s", version.toString());
Line 24:         }
Line 25: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I07daa5cccbf8e3cbd6b4191bbc8ebf0729d9d9a0
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Peřina <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Martin Peřina <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to