From 7459ed95f5ad213bafb1c691b193283850889e52 Mon Sep 17 00:00:00 2001 From: hansonr Date: Fri, 25 Jan 2019 23:51:50 -0600 Subject: [PATCH] removing cyclic call --- src/jalview/datamodel/Sequence.java | 10 ++++------ src/jalview/util/DBRefUtils.java | 3 +-- 2 files changed, 5 insertions(+), 8 deletions(-) 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 -- 1.7.10.2