removing cyclic call
authorhansonr <hansonr@STO24954W.ad.stolaf.edu>
Sat, 26 Jan 2019 05:51:50 +0000 (23:51 -0600)
committerhansonr <hansonr@STO24954W.ad.stolaf.edu>
Sat, 26 Jan 2019 05:51:50 +0000 (23:51 -0600)
src/jalview/datamodel/Sequence.java
src/jalview/util/DBRefUtils.java

index 6cf0646..6e9e1cd 100755 (executable)
@@ -1895,12 +1895,8 @@ private List<DBRefEntry> primaryRefs;
     synchronized (dbrefs)
     {
       if (refModCount == dbrefs.getModCount() && primaryRefs != null)
-         return primaryRefs;
-      {
-        refModCount = dbrefs.getModCount(); 
-        DBRefUtils.ensurePrimaries(this);
-        primaryRefs = null;
-      }
+         return primaryRefs; // no changes
+      refModCount = dbrefs.getModCount(); 
       List<DBRefEntry> primaries = (primaryRefs == null ? (primaryRefs = new ArrayList<>()) : primaryRefs);
       primaries.clear();
       if (tmpList == null) {
@@ -1948,6 +1944,8 @@ private List<DBRefEntry> primaryRefs;
            }
         primaries.add(ref);
       }
+      
+      DBRefUtils.ensurePrimaries(this, primaries);
       return primaries;
     }
   }
index ee240b7..381038c 100755 (executable)
@@ -691,9 +691,8 @@ public class DBRefUtils
    * 
    * @param sequence
    */
-  public static void ensurePrimaries(SequenceI sequence)
+  public static void ensurePrimaries(SequenceI sequence, List<DBRefEntry> pr)
   {
-    List<DBRefEntry> pr = sequence.getPrimaryDBRefs();
     if (pr.size() == 0)
     {
       // nothing to do