From 76b96928a3b704a542482c63b93927ff449b1b5f Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Fri, 21 Jan 2011 08:44:18 +0000
Subject: [PATCH] Code cleanup removing potential issues detected by FindBugs
---
opends/src/server/org/opends/server/util/args/ArgumentParser.java | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/opends/src/server/org/opends/server/util/args/ArgumentParser.java b/opends/src/server/org/opends/server/util/args/ArgumentParser.java
index fccbfce..b3a1fc8 100644
--- a/opends/src/server/org/opends/server/util/args/ArgumentParser.java
+++ b/opends/src/server/org/opends/server/util/args/ArgumentParser.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
+ * Portions Copyright 2011 ForgeRock AS
*/
package org.opends.server.util.args;
import org.opends.messages.Message;
@@ -577,7 +578,7 @@
/**
* Adds the provided argument to the set of arguments handled by this parser
- * and puts the arguement in the general group.
+ * and puts the argument in the general group.
*
* @param argument The argument to be added.
*
@@ -613,9 +614,9 @@
throw new ArgumentException(message);
}
- if (versionArgument != null)
+ if ((versionArgument != null) && (shortID != null))
{
- if (shortID == versionArgument.getShortIdentifier())
+ if (shortID.equals(versionArgument.getShortIdentifier()))
{
// Update the version argument to not display its short identifier.
try {
@@ -1401,7 +1402,8 @@
{
if (trailingArgsDisplayName == null)
{
- buffer.append(" "+INFO_ARGPARSER_USAGE_TRAILINGARGS.get());
+ buffer.append(" ");
+ buffer.append(INFO_ARGPARSER_USAGE_TRAILINGARGS.get());
}
else
{
--
Gitblit v1.10.0