From ca669ae54f86dbeea277280690584d9f591c7571 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 18 Feb 2015 07:26:26 +0000
Subject: [PATCH] AutoRefactor: collapse if statements

---
 opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/NewEntryTask.java |   30 ++++++++++++++----------------
 1 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/NewEntryTask.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/NewEntryTask.java
index ad15ebb..1ecbe50 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/NewEntryTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/NewEntryTask.java
@@ -151,26 +151,24 @@
   public boolean canLaunch(Task taskToBeLaunched,
       Collection<LocalizableMessage> incompatibilityReasons)
   {
-    boolean canLaunch = true;
-    if (!isServerRunning())
+    if (!isServerRunning()
+        && state == State.RUNNING
+        && runningOnSameServer(taskToBeLaunched))
     {
-      if (state == State.RUNNING && runningOnSameServer(taskToBeLaunched))
+      // All the operations are incompatible if they apply to this
+      // backend for safety.  This is a short operation so the limitation
+      // has not a lot of impact.
+      Set<String> backends =
+        new TreeSet<String>(taskToBeLaunched.getBackends());
+      backends.retainAll(getBackends());
+      if (backends.size() > 0)
       {
-        // All the operations are incompatible if they apply to this
-        // backend for safety.  This is a short operation so the limitation
-        // has not a lot of impact.
-        Set<String> backends =
-          new TreeSet<String>(taskToBeLaunched.getBackends());
-        backends.retainAll(getBackends());
-        if (backends.size() > 0)
-        {
-          incompatibilityReasons.add(getIncompatibilityMessage(this,
-              taskToBeLaunched));
-          canLaunch = false;
-        }
+        incompatibilityReasons.add(getIncompatibilityMessage(this,
+            taskToBeLaunched));
+        return false;
       }
     }
-    return canLaunch;
+    return true;
   }
 
   /**

--
Gitblit v1.10.0