Merge branch 'bug/JAL-2586' into develop
authorkiramt <k.mourao@dundee.ac.uk>
Thu, 8 Jun 2017 14:01:35 +0000 (15:01 +0100)
committerkiramt <k.mourao@dundee.ac.uk>
Thu, 8 Jun 2017 14:01:35 +0000 (15:01 +0100)
help/html/releases.html
src/jalview/appletgui/TreeCanvas.java
src/jalview/datamodel/Alignment.java
src/jalview/gui/TreeCanvas.java
src/jalview/util/LinkedIdentityHashSet.java

index cb46024..5c8da91 100755 (executable)
@@ -162,6 +162,8 @@ li:before {
           <li><!-- JAL-2373 -->Percentage identity and conservation menu items do not show a tick or allow shading to be disabled</li>
           <li><!-- JAL-2385 -->Conservation shading or PID threshold lost when base colourscheme changed if slider not visible</li>
           <li><!-- JAL-2547 -->Sequence features shown in tooltip for gaps before start of features</li>
+          <li><!-- JAL-2576 -->Very large alignments take a long time to load</li>
+          <li><!-- JAL-2590 -->Cannot load Newick trees from eggnog ortholog database</li>
           </ul>
           <em>Application</em>
           <ul>
index 48e9d64..272a2b3 100755 (executable)
@@ -261,10 +261,11 @@ public class TreeCanvas extends Panel implements MouseListener,
         g.fillRect(xend - 2, ypos - 2, 4, 4);
       }
 
-      int ystart = (int) (((SequenceNode) node.left()).ycount * chunk)
-              + offy;
-      int yend = (int) (((SequenceNode) node.right()).ycount * chunk)
+      int ystart = (int) (node.left() == null ? 0 : (((SequenceNode) node
+              .left()).ycount * chunk))
               + offy;
+      int yend = (int) (node.right() == null ? 0 : (((SequenceNode) node
+              .right()).ycount * chunk)) + offy;
 
       Rectangle pos = new Rectangle(xend - 2, ypos - 2, 5, 5);
       nodeHash.put(node, pos);
index 5d91b36..f5e6fc7 100755 (executable)
@@ -1067,21 +1067,18 @@ public class Alignment implements AlignmentI
         currentSeq = currentSeq.createDatasetSequence();
       }
     }
-    if (seqs.contains(currentSeq))
-    {
-      return;
-    }
+
     List<SequenceI> toProcess = new ArrayList<>();
     toProcess.add(currentSeq);
     while (toProcess.size() > 0)
     {
       // use a queue ?
       SequenceI curDs = toProcess.remove(0);
-      if (seqs.contains(curDs))
+
+      if (!seqs.add(curDs))
       {
         continue;
       }
-      seqs.add(curDs);
       // iterate over database references, making sure we add forward referenced
       // sequences
       if (curDs.getDBRefs() != null)
index 3494fb8..e60ac8e 100755 (executable)
@@ -332,9 +332,10 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
         g.fillRect(xend - 2, ypos - 2, 4, 4);
       }
 
-      int ystart = (int) (((SequenceNode) node.left()).ycount * chunk)
-              + offy;
-      int yend = (int) (((SequenceNode) node.right()).ycount * chunk)
+      int ystart = (node.left() == null ? 0 : (int) (((SequenceNode) node
+              .left()).ycount * chunk)) + offy;
+      int yend = (node.right() == null ? 0 : (int) (((SequenceNode) node
+              .right()).ycount * chunk))
               + offy;
 
       Rectangle pos = new Rectangle(xend - 2, ypos - 2, 5, 5);
index bce540f..7f109ec 100644 (file)
@@ -34,7 +34,7 @@ import java.util.LinkedHashMap;
  */
 public class LinkedIdentityHashSet<E> extends AbstractSet<E>
 {
-  LinkedHashMap<IdentityWrapper, IdentityWrapper> set = new LinkedHashMap<IdentityWrapper, IdentityWrapper>();
+  LinkedHashMap<IdentityWrapper, IdentityWrapper> set = new LinkedHashMap<>();
 
   static class IdentityWrapper
   {
@@ -51,7 +51,7 @@ public class LinkedIdentityHashSet<E> extends AbstractSet<E>
     @Override
     public boolean equals(Object obj)
     {
-      return this.obj == obj;
+      return this.obj == ((IdentityWrapper) obj).obj;
     }
 
     @Override