mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Gaetan Boismal
25.30.2016 6ea56ecde3d05b84f42a7338d7c2c159817d00d0
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()));
    }
  }
}