From 09841d36e89fd0e52c949643c893e9e7bc891c6e Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Mon, 17 Oct 2016 06:49:28 +0000
Subject: [PATCH] Fix for OPENDJ-3273, detect the --quiet option for stop-ds and pass it down to avoid printing out the tail of the errors log.

---
 opendj-server-legacy/src/main/java/org/opends/server/tools/StopDS.java |   22 +++++++++-------------
 1 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/StopDS.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/StopDS.java
index 2aee66e..48e1d6f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/StopDS.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/StopDS.java
@@ -86,11 +86,10 @@
   /** The fully-qualified name of this class. */
   private static final String CLASS_NAME = "org.opends.server.tools.StopDS";
 
-  /**
+  /*
    * Return codes used when the hidden option --checkStoppability is used.
-   * NOTE: when checkStoppability is specified is recommended not to allocate
-   * a lot of memory for the JVM (Using -Xms and -Xmx options) as there might
-   * be calls to Runtime.exec.
+   * NOTE: when checkStoppability is specified, it is recommended not to allocate a lot of memory for the JVM
+   * (Using -Xms and -Xmx options) as there might be calls to Runtime.exec.
    */
   /** The server is already stopped. */
   private static int SERVER_ALREADY_STOPPED = 98;
@@ -525,10 +524,10 @@
     }
     catch (LDAPConnectionException lce)
     {
-      LocalizableMessage message = null;
+      LocalizableMessage message;
       if (lce.getCause() != null && lce.getCause().getCause() != null &&
         lce.getCause().getCause() instanceof SSLException) {
-      message = ERR_STOPDS_CANNOT_CONNECT_SSL.get(host.getValue(),
+        message = ERR_STOPDS_CANNOT_CONNECT_SSL.get(host.getValue(),
         port.getValue());
       } else {
         String hostPort = host.getValue() + ":" + port.getValue();
@@ -562,13 +561,10 @@
       attributes.add(new LDAPAttribute(ATTR_SHUTDOWN_MESSAGE, stopReason.getValue()));
     }
 
-    if (stopTime != null)
-    {
-      SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_GMT_TIME);
-      dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
-      String stopTimeValues = dateFormat.format(stopTime);
-      attributes.add(new LDAPAttribute(ATTR_TASK_SCHEDULED_START_TIME, stopTimeValues));
-    }
+    SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_GMT_TIME);
+    dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
+    String stopTimeValues = dateFormat.format(stopTime);
+    attributes.add(new LDAPAttribute(ATTR_TASK_SCHEDULED_START_TIME, stopTimeValues));
 
     ArrayList<Control> controls = new ArrayList<>();
     if (proxyAuthzID.isPresent())

--
Gitblit v1.10.0