Sharad Mishra has posted comments on this change.

Change subject: engine: Change iteration to foreach (#849971)
......................................................................


Patch Set 1: (3 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateNetworkToVdsInterfaceCommand.java
Line 165:         // check that interface exists
Line 166:         for (final VdsNetworkInterface i : 
getParameters().getInterfaces()) {
Line 167:             for (VdsNetworkInterface iface : interfaces) {
Line 168:                 if (iface.getName().equals(i.getName())) {
Line 169:                     updatedIface = iface;
Once the match is found, should we not break out of the inner loop?
Line 170:                 }
Line 171:             }
Line 172:             if (updatedIface == null) {
Line 173:                 
addCanDoActionMessage(VdcBllMessages.NETWORK_INTERFACE_NOT_EXISTS);


Line 170:                 }
Line 171:             }
Line 172:             if (updatedIface == null) {
Line 173:                 
addCanDoActionMessage(VdcBllMessages.NETWORK_INTERFACE_NOT_EXISTS);
Line 174:                 return false;
if the first inner loop does not find a match, we exit the method? Should we 
not try going over rest of the entries in "i"?
Line 175:             }
Line 176:             ifaceGateway = updatedIface.getGateway();
Line 177:         }
Line 178: 


Line 172:             if (updatedIface == null) {
Line 173:                 
addCanDoActionMessage(VdcBllMessages.NETWORK_INTERFACE_NOT_EXISTS);
Line 174:                 return false;
Line 175:             }
Line 176:             ifaceGateway = updatedIface.getGateway();
should we break out of outer loop here? otherwise ifaceGateway will be 
overwritten.
Line 177:         }
Line 178: 
Line 179:         boolean managementNetworkUpdated =
Line 180:                 
StringUtils.equals(getParameters().getNetwork().getname(), 
NetworkUtils.getEngineNetwork());


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2fbb9bf14ed5f94b2e74ab6bfde39e959300b31d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Mike Kolesnik <[email protected]>
Gerrit-Reviewer: Livnat Peer <[email protected]>
Gerrit-Reviewer: Sharad Mishra <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to