Allon Mureinik has uploaded a new change for review.

Change subject: core: VdcActionUtils: Unwrap else blocks
......................................................................

core: VdcActionUtils: Unwrap else blocks

Unwrapped redundant else blocks in order to make the class more
readable.

Change-Id: I475e1c4a99ba004bc3ebe2182a7351a0d28dcbda
Signed-off-by: Allon Mureinik <amure...@redhat.com>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/VdcActionUtils.java
1 file changed, 12 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/52/18852/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/VdcActionUtils.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/VdcActionUtils.java
index bc8a16f..72e22d5 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/VdcActionUtils.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/VdcActionUtils.java
@@ -312,19 +312,22 @@
         }
 
         if (entity.getClass().getName().endsWith("VDS")) {
-            return (entity instanceof VDS ?
+            return entity instanceof VDS ?
                     ((VDS) entity).getStatus() :
-                    null);
-        } else if (entity.getClass().getName().endsWith("VM")) {
-            return (entity instanceof VM ?
+                    null;
+        }
+        if (entity.getClass().getName().endsWith("VM")) {
+            return entity instanceof VM ?
                     ((VM) entity).getStatus() :
-                    null);
-        } else if (entity.getClass().getName().endsWith("VmTemplate")) {
-            return (entity instanceof VmTemplate ?
+                    null;
+        }
+        if (entity.getClass().getName().endsWith("VmTemplate")) {
+            return entity instanceof VmTemplate ?
                     ((VmTemplate) entity).getStatus() :
-                    null);
+                    null;
 
-        } else if (entity instanceof StorageDomain) {
+        }
+        if (entity instanceof StorageDomain) {
             StorageDomainStatus status = ((StorageDomain) entity).getStatus();
             return status != null ? status : StorageDomainStatus.Uninitialized;
         }


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I475e1c4a99ba004bc3ebe2182a7351a0d28dcbda
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amure...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to