From b8f523c95f4fd5fc705f2c6c2a2d98217b9da450 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 21 Apr 2015 20:10:37 +0000
Subject: [PATCH] Converted use of Collection.size() to Collection.isEmpty().
---
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/StatusGenericPanel.java | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/StatusGenericPanel.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/StatusGenericPanel.java
index cf491c1..449488d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/StatusGenericPanel.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/StatusGenericPanel.java
@@ -724,7 +724,7 @@
{
task.canLaunch(newTask, errors);
}
- if (errors.size() == 0)
+ if (errors.isEmpty())
{
progressDialog.appendProgressHtml("<br><br>");
launchOperation(newTask, INFO_CTRL_PANEL_REBUILDING_INDEXES_SUMMARY.get(backendName),
@@ -742,7 +742,7 @@
progressDialog.toFront();
}
}
- if (errors.size() > 0)
+ if (!errors.isEmpty())
{
displayErrorDialog(errors);
}
@@ -1311,8 +1311,9 @@
@Override
public void run()
{
- combo.setVisible(newElements.size() > 0);
- lNoBackendsFound.setVisible(newElements.size() == 0);
+ boolean noElems = newElements.isEmpty();
+ combo.setVisible(!noElems);
+ lNoBackendsFound.setVisible(noElems);
}
});
}
@@ -1884,7 +1885,7 @@
{
task.canLaunch(newTask, errors);
}
- if (errors.size() == 0)
+ if (errors.isEmpty())
{
launchOperation(newTask,
INFO_CTRL_PANEL_STARTING_SERVER_SUMMARY.get(),
@@ -1916,12 +1917,12 @@
task.canLaunch(newTask, errors);
}
boolean confirmed = true;
- if (errors.size() == 0)
+ if (errors.isEmpty())
{
confirmed = displayConfirmationDialog(INFO_CTRL_PANEL_CONFIRMATION_REQUIRED_SUMMARY.get(),
INFO_CTRL_PANEL_CONFIRM_STOP_SERVER_DETAILS.get());
}
- if (errors.size() == 0 && confirmed)
+ if (errors.isEmpty() && confirmed)
{
launchOperation(newTask,
INFO_CTRL_PANEL_STOPPING_SERVER_SUMMARY.get(),
@@ -1931,7 +1932,7 @@
ERR_CTRL_PANEL_STOPPING_SERVER_ERROR_DETAILS, progressDialog);
progressDialog.setVisible(true);
}
- if (errors.size() > 0)
+ if (!errors.isEmpty())
{
displayErrorDialog(errors);
}
@@ -1953,12 +1954,12 @@
task.canLaunch(newTask, errors);
}
boolean confirmed = true;
- if (errors.size() == 0)
+ if (errors.isEmpty())
{
confirmed = displayConfirmationDialog(INFO_CTRL_PANEL_CONFIRMATION_REQUIRED_SUMMARY.get(),
INFO_CTRL_PANEL_CONFIRM_RESTART_SERVER_DETAILS.get());
}
- if (errors.size() == 0 && confirmed)
+ if (errors.isEmpty() && confirmed)
{
launchOperation(newTask,
INFO_CTRL_PANEL_STOPPING_SERVER_SUMMARY.get(),
@@ -1968,7 +1969,7 @@
ERR_CTRL_PANEL_RESTARTING_SERVER_ERROR_DETAILS, progressDialog);
progressDialog.setVisible(true);
}
- if (errors.size() > 0)
+ if (!errors.isEmpty())
{
displayErrorDialog(errors);
}
--
Gitblit v1.10.0