From 9826d4193d9db5cb3fcc11feb16295a558d86b37 Mon Sep 17 00:00:00 2001
From: Violette Roche-Montane <violette.roche-montane@forgerock.com>
Date: Mon, 24 Mar 2014 15:31:54 +0000
Subject: [PATCH] Fixed the NPE when the user was not providing credentials.
---
opendj3-server-dev/src/server/org/opends/server/tools/status/StatusCli.java | 29 ++++++++++++++---------------
1 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/opendj3-server-dev/src/server/org/opends/server/tools/status/StatusCli.java b/opendj3-server-dev/src/server/org/opends/server/tools/status/StatusCli.java
index 73ab45f..d81eb34 100644
--- a/opendj3-server-dev/src/server/org/opends/server/tools/status/StatusCli.java
+++ b/opendj3-server-dev/src/server/org/opends/server/tools/status/StatusCli.java
@@ -680,11 +680,14 @@
}
/**
- * Updates the java version contents displaying with what is specified in
- * the provided ServerDescriptor object.
- * This method must be called from the event thread.
- * @param desc the ServerDescriptor object.
- * @param maxLabelWidth the maximum label width of the left label.
+ * Updates the java version contents displaying with what is specified in the
+ * provided ServerDescriptor object. This method must be called from the event
+ * thread.
+ *
+ * @param desc
+ * The ServerDescriptor object.
+ * @param maxLabelWidth
+ * The maximum label width of the left label.
*/
private void writeJavaVersionContents(ServerDescriptor desc,
int maxLabelWidth)
@@ -692,17 +695,13 @@
LocalizableMessage text;
if (desc.getStatus() == ServerDescriptor.ServerStatus.STARTED)
{
- text = LocalizableMessage.raw(desc.getJavaVersion());
- if (text == null)
+ if (!desc.isAuthenticated() || !desc.getExceptions().isEmpty())
{
- if (!desc.isAuthenticated() || !desc.getExceptions().isEmpty())
- {
- text = getNotAvailableBecauseAuthenticationIsRequiredText();
- }
- else
- {
- text = getNotAvailableText();
- }
+ text = getNotAvailableBecauseAuthenticationIsRequiredText();
+ }
+ else
+ {
+ text = LocalizableMessage.raw(desc.getJavaVersion());
}
}
else
--
Gitblit v1.10.0