From 57b66fd1b4c0459f58fdca9cdc9347de80cc0a3d Mon Sep 17 00:00:00 2001
From: cramakri <cramakri>
Date: Wed, 15 Jun 2011 11:12:12 +0000
Subject: [PATCH] LMS-2323 Ignore a harmless known exception that we can't
 prevent.

SVN: 21696
---
 .../dss/client/api/gui/AbstractSwingGUI.java  | 22 ++++++++++++-------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/client/api/gui/AbstractSwingGUI.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/client/api/gui/AbstractSwingGUI.java
index 4c09fccb81c..9d87b79b654 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/client/api/gui/AbstractSwingGUI.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/client/api/gui/AbstractSwingGUI.java
@@ -237,15 +237,21 @@ public abstract class AbstractSwingGUI
         final Throwable th =
                 (throwable instanceof Error) ? throwable : CheckedExceptionTunnel
                         .unwrapIfNecessary((Exception) throwable);
-        SwingUtilities.invokeLater(new Runnable()
-            {
-                public void run()
+        if (throwable instanceof ClassCastException)
+        {
+            System.err.println("Encountered ClassCastException problem.");
+        } else
+        {
+            SwingUtilities.invokeLater(new Runnable()
                 {
-                    JOptionPane.showMessageDialog(parentFrame,
-                            WordUtils.wrap(message, MESSAGE_WRAP_MAX_CHAR), title,
-                            JOptionPane.ERROR_MESSAGE);
-                }
-            });
+                    public void run()
+                    {
+                        JOptionPane.showMessageDialog(parentFrame,
+                                WordUtils.wrap(message, MESSAGE_WRAP_MAX_CHAR), title,
+                                JOptionPane.ERROR_MESSAGE);
+                    }
+                });
+        }
         th.printStackTrace();
     }
 
-- 
GitLab