From 750f4ef44dea9b12c41fedc326a6cf6e71bb56a4 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 15 Jul 2013 08:40:31 +0000
Subject: [PATCH] Created NullOutputStream.wrapOrNullStream() and used it in all tools instead of duplicating the null checks everywhere.
---
opends/src/server/org/opends/server/tools/LDAPDelete.java | 23 +++--------------------
1 files changed, 3 insertions(+), 20 deletions(-)
diff --git a/opends/src/server/org/opends/server/tools/LDAPDelete.java b/opends/src/server/org/opends/server/tools/LDAPDelete.java
index 019aa24..a5ec657 100644
--- a/opends/src/server/org/opends/server/tools/LDAPDelete.java
+++ b/opends/src/server/org/opends/server/tools/LDAPDelete.java
@@ -23,7 +23,7 @@
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
- * Portions Copyright 2012 ForgeRock AS.
+ * Portions Copyright 2012-2013 ForgeRock AS.
*/
package org.opends.server.tools;
import org.opends.admin.ads.util.ConnectionUtils;
@@ -293,25 +293,8 @@
public static int mainDelete(String[] args, boolean initializeServer,
OutputStream outStream, OutputStream errStream)
{
- PrintStream out;
- if (outStream == null)
- {
- out = NullOutputStream.printStream();
- }
- else
- {
- out = new PrintStream(outStream);
- }
-
- PrintStream err;
- if (errStream == null)
- {
- err = NullOutputStream.printStream();
- }
- else
- {
- err = new PrintStream(errStream);
- }
+ PrintStream out = NullOutputStream.wrapOrNullStream(outStream);
+ PrintStream err = NullOutputStream.wrapOrNullStream(errStream);
LDAPConnectionOptions connectionOptions = new LDAPConnectionOptions();
--
Gitblit v1.10.0