From abcb169a28a9c3dab2975fb3417327840163bf61 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Mon, 19 Oct 2009 19:38:09 +0000
Subject: [PATCH] In some cases it appears that interrupting the thread that is executing a search does not throw a NamingInterruptedException but a CommunicationException generated by an InterruptedIOException.  The following modifications fix this.

---
 opends/src/guitools/org/opends/guitools/controlpanel/ui/BrowseEntriesPanel.java |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/opends/src/guitools/org/opends/guitools/controlpanel/ui/BrowseEntriesPanel.java b/opends/src/guitools/org/opends/guitools/controlpanel/ui/BrowseEntriesPanel.java
index 3464d05..ff8ec76 100644
--- a/opends/src/guitools/org/opends/guitools/controlpanel/ui/BrowseEntriesPanel.java
+++ b/opends/src/guitools/org/opends/guitools/controlpanel/ui/BrowseEntriesPanel.java
@@ -532,7 +532,7 @@
       }
       catch (Throwable t)
       {
-        if (!(t instanceof InterruptedNamingException))
+        if (!isInterruptedException(t))
         {
           EntryReadErrorEvent ev = new EntryReadErrorEvent(this, dn, t);
           entryPane.entryReadError(ev);
@@ -1477,4 +1477,18 @@
       return menu;
     }
   }
+
+  private boolean isInterruptedException(Throwable t)
+  {
+    boolean isInterruptedException = false;
+    isInterruptedException = t instanceof java.io.InterruptedIOException ||
+    t instanceof InterruptedNamingException;
+    while ((t != null) && !isInterruptedException)
+    {
+      t = t.getCause();
+      isInterruptedException = t instanceof java.io.InterruptedIOException ||
+      t instanceof InterruptedNamingException;
+    }
+    return isInterruptedException;
+  }
 }

--
Gitblit v1.10.0