From: hansonr Date: Sat, 26 Jan 2019 05:51:50 +0000 (-0600) Subject: removing cyclic call X-Git-Tag: Release_2_11_4_0~45^2~18^2~286 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7459ed95f5ad213bafb1c691b193283850889e52;p=jalview.git removing cyclic call --- diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 6cf0646..6e9e1cd 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -1895,12 +1895,8 @@ private List 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 primaries = (primaryRefs == null ? (primaryRefs = new ArrayList<>()) : primaryRefs); primaries.clear(); if (tmpList == null) { @@ -1948,6 +1944,8 @@ private List primaryRefs; } primaries.add(ref); } + + DBRefUtils.ensurePrimaries(this, primaries); return primaries; } } diff --git a/src/jalview/util/DBRefUtils.java b/src/jalview/util/DBRefUtils.java index ee240b7..381038c 100755 --- a/src/jalview/util/DBRefUtils.java +++ b/src/jalview/util/DBRefUtils.java @@ -691,9 +691,8 @@ public class DBRefUtils * * @param sequence */ - public static void ensurePrimaries(SequenceI sequence) + public static void ensurePrimaries(SequenceI sequence, List pr) { - List pr = sequence.getPrimaryDBRefs(); if (pr.size() == 0) { // nothing to do