From 6ea56ecde3d05b84f42a7338d7c2c159817d00d0 Mon Sep 17 00:00:00 2001
From: Gaetan Boismal <gaetan.boismal@forgerock.com>
Date: Tue, 01 Mar 2016 09:44:57 +0000
Subject: [PATCH] Code cleanup
---
opendj-server-legacy/src/main/java/org/opends/server/util/cli/LDAPConnectionArgumentParser.java | 19 ++++---------------
1 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/cli/LDAPConnectionArgumentParser.java b/opendj-server-legacy/src/main/java/org/opends/server/util/cli/LDAPConnectionArgumentParser.java
index b8e6926..eed748d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/cli/LDAPConnectionArgumentParser.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/cli/LDAPConnectionArgumentParser.java
@@ -19,7 +19,6 @@
import static org.opends.messages.ToolMessages.*;
import static com.forgerock.opendj.cli.Utils.*;
-import static com.forgerock.opendj.cli.CliMessages.ERR_TOOL_CONFLICTING_ARGS;
import java.io.PrintStream;
import java.util.LinkedList;
@@ -139,11 +138,10 @@
private LDAPConnection connect(SecureConnectionCliArgs args, PrintStream out, PrintStream err)
throws LDAPConnectionException, ArgumentException
{
- // Checks for conflicting arguments
- throwIfArgumentsConflict(err, args.getBindPasswordArg(), args.getBindPasswordArg());
- throwIfArgumentsConflict(err, args.getKeyStorePasswordArg(), args.getKeyStorePasswordFileArg());
- throwIfArgumentsConflict(err, args.getTrustStorePasswordArg(), args.getTrustStorePasswordFileArg());
- throwIfArgumentsConflict(err, args.getUseSSLArg(), args.getUseStartTLSArg());
+ throwIfArgumentsConflict(args.getBindPasswordArg(), args.getBindPasswordArg());
+ throwIfArgumentsConflict(args.getKeyStorePasswordArg(), args.getKeyStorePasswordFileArg());
+ throwIfArgumentsConflict(args.getTrustStorePasswordArg(), args.getTrustStorePasswordFileArg());
+ throwIfArgumentsConflict(args.getUseSSLArg(), args.getUseStartTLSArg());
// Create the LDAP connection options object, which will be used to
// customize the way that we connect to the server and specify a set of
@@ -463,13 +461,4 @@
ae.printStackTrace(); // Should never happen
}
}
-
- private void throwIfArgumentsConflict(final PrintStream err, final Argument arg1, final Argument arg2)
- throws ArgumentException
- {
- if (arg1.isPresent() && arg2.isPresent())
- {
- printAndThrowException(err, ERR_TOOL_CONFLICTING_ARGS.get(arg1.getLongIdentifier(), arg2.getLongIdentifier()));
- }
- }
}
--
Gitblit v1.10.0