From 3a66dd55b2f91b279497fbdddbc36ea6c16f72b8 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 01 Mar 2013 09:52:32 +0000
Subject: [PATCH] OPENDJ-777 ldapcompare should exit with different values w.r.t comparison is successful or not

---
 opendj3/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/ConsoleApplication.java |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/opendj3/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/ConsoleApplication.java b/opendj3/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/ConsoleApplication.java
index 4294e84..98e0b0b 100755
--- a/opendj3/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/ConsoleApplication.java
+++ b/opendj3/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/ConsoleApplication.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2008-2009 Sun Microsystems, Inc.
- *      Portions copyright 2011-2012 ForgeRock AS
+ *      Portions copyright 2011-2013 ForgeRock AS
  *      Portions copyright 2011 Nemanja Lukić
  */
 package com.forgerock.opendj.ldap.tools;
@@ -67,17 +67,22 @@
     }
 
     /**
-     * Closes the provided {@code Closeable} if it is not {@code null}.
+     * Closes the provided {@code Closeable}s if they are not {@code null}.
      *
-     * @param closeable
-     *            The closeable to be closed.
+     * @param closeables
+     *          The closeables to be closed.
      */
-    final void closeIfNotNull(Closeable closeable) {
-        if (closeable != null) {
-            try {
-                closeable.close();
-            } catch (Exception ignored) {
-                // Do nothing.
+    final void closeIfNotNull(Closeable... closeables) {
+        if (closeables == null) {
+            return;
+        }
+        for (Closeable closeable : closeables) {
+            if (closeable != null) {
+                try {
+                    closeable.close();
+                } catch (Exception ignored) {
+                    // Do nothing.
+                }
             }
         }
     }

--
Gitblit v1.10.0