Roy Golan has posted comments on this change.

Change subject: engine: Disk interface validation
......................................................................


Patch Set 8:

(1 comment)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/DiskValidator.java
Line 137:      * @return
Line 138:      */
Line 139:     public static boolean isDiskInterfaceSupportedByOs (DiskInterface 
diskInterface, int osId, Version version) {
Line 140:         List<DiskInterface> supportedDiskInterfaces =
Line 141:                 getSupportedDiskInterfaces(osId, version);
isn't it simpler (maybe even more efficient but you know...) to just search the 
string list instead of converting to enum?

 getOsRepository().getDiskInterfaces(o, v).contains(diskInterface.name())

essentially the same no? 

All -  if getting list of enums from osRepo is something we will see benefit 
from we can add a util method to get a List<? extends Enum> from List<String>
Line 142: 
Line 143:         if (!supportedDiskInterfaces.contains(diskInterface)) {
Line 144:             return false;
Line 145:         }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibe095557089aa5670c50eaa120eac9f60e13aea0
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Gustavo Frederico Temple Pedrosa <gustavo.pedr...@eldorado.org.br>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Frank Kobzik <fkob...@redhat.com>
Gerrit-Reviewer: Gustavo Frederico Temple Pedrosa 
<gustavo.pedr...@eldorado.org.br>
Gerrit-Reviewer: Leonardo Bianconi <leonardo.bianc...@eldorado.org.br>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: Sergey Gotliv <sgot...@redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjeli...@redhat.com>
Gerrit-Reviewer: Vered Volansky <vvola...@redhat.com>
Gerrit-Reviewer: Vitor de Lima <vitor.l...@eldorado.org.br>
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