removing cyclic call
[jalview.git] / src / jalview / datamodel / Sequence.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;
     }
   }