JAL-3854 patched SeqSeqUtils.deUniquify to not use instanceOf - seems to work improvement/JAL-3848_slivka_0.8
authorJim Procter <j.procter@dundee.ac.uk>
Sun, 25 Jul 2021 16:48:01 +0000 (17:48 +0100)
committerJim Procter <j.procter@dundee.ac.uk>
Sun, 25 Jul 2021 16:54:32 +0000 (17:54 +0100)
src/jalview/analysis/SeqsetUtils.java

index 61fc747..4118124 100755 (executable)
@@ -260,8 +260,7 @@ public class SeqsetUtils
     while (keys.hasMoreElements())
     {
       Object key = keys.nextElement();
-      if (key instanceof String)
-      {
+      try {
         if ((msq = matcher.findIdMatch((String) key)) != null)
         {
           Hashtable sqinfo = (Hashtable) map.get(key);
@@ -276,6 +275,11 @@ public class SeqsetUtils
                     + "' in uniquified alignment");
           }
         }
+      } catch (ClassCastException ccastex) {
+        if (!quiet)
+        {
+          System.err.println("Unexpected object in SeqSet map : "+key.getClass());
+        }
       }
     }
     if (unmatched.size() > 0 && !quiet)