Mike Kolesnik has uploaded a new change for review.

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

engine: Change iteration to foreach (#849971)

https://bugzilla.redhat.com/849971

Iterate using foreach instead of LinqUtils.
This way the loop can be extended to do other things as well, besides
finding a single element.

Change-Id: I2fbb9bf14ed5f94b2e74ab6bfde39e959300b31d
Signed-off-by: Mike Kolesnik <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateNetworkToVdsInterfaceCommand.java
1 file changed, 4 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/09/7409/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateNetworkToVdsInterfaceCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateNetworkToVdsInterfaceCommand.java
index 27cb297..2a3c94d 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateNetworkToVdsInterfaceCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateNetworkToVdsInterfaceCommand.java
@@ -164,12 +164,11 @@
 
         // check that interface exists
         for (final VdsNetworkInterface i : getParameters().getInterfaces()) {
-            updatedIface = LinqUtils.firstOrNull(interfaces, new 
Predicate<VdsNetworkInterface>() {
-                @Override
-                public boolean eval(VdsNetworkInterface x) {
-                    return x.getName().equals(i.getName());
+            for (VdsNetworkInterface iface : interfaces) {
+                if (iface.getName().equals(i.getName())) {
+                    updatedIface = iface;
                 }
-            });
+            }
             if (updatedIface == null) {
                 
addCanDoActionMessage(VdcBllMessages.NETWORK_INTERFACE_NOT_EXISTS);
                 return false;


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2fbb9bf14ed5f94b2e74ab6bfde39e959300b31d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Mike Kolesnik <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to