JAL-34 - quick hack to see how we can do alignment comparison for splitframes linking...
[jalview.git] / src / jalview / datamodel / ContactMapHolder.java
index af083dd..45c0d18 100644 (file)
@@ -3,6 +3,7 @@ package jalview.datamodel;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
 
 import jalview.ws.datamodel.MappableContactMatrixI;
@@ -17,7 +18,9 @@ public class ContactMapHolder implements ContactMapHolderI
   {
     if (contactmaps != null && contactmaps.size() > 0)
     {
-      return contactmaps.values();
+      // defensive copy, and return non redundant set of ContactMatrixI
+      // instances
+      return new HashSet<ContactMatrixI>(contactmaps.values());
     }
     return Collections.EMPTY_LIST;
   }