From eb5e0ce96aa9936a540b4d99a57cc2e5df3704f0 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 31 Aug 2016 15:38:21 +0100 Subject: [PATCH] JAL-2034 fix logic so recalcConservation(true) returns true if conservation updates were performed on group --- src/jalview/datamodel/SequenceGroup.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index 22c537a..046f1e6 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -529,6 +529,7 @@ public class SequenceGroup implements AnnotatedCollectionI } // TODO: try harder to detect changes in state in order to minimise // recalculation effort + boolean upd = false; try { Hashtable cnsns[] = AAFrequency.calculate(sequences, startRes, @@ -536,10 +537,12 @@ public class SequenceGroup implements AnnotatedCollectionI if (consensus != null) { _updateConsensusRow(cnsns, sequences.size()); + upd = true; } if (cs != null) { cs.setConsensus(cnsns); + upd = true; } if ((conservation != null) @@ -561,6 +564,8 @@ public class SequenceGroup implements AnnotatedCollectionI cs.setConservation(c); } } + // eager update - will cause a refresh of overview regardless + upd = true; } if (cs != null && !defer) { @@ -570,14 +575,14 @@ public class SequenceGroup implements AnnotatedCollectionI } else { - return false; + return upd; } } catch (java.lang.OutOfMemoryError err) { // TODO: catch OOM System.out.println("Out of memory loading groups: " + err); } - return false; + return upd; } private void _updateConservationRow(Conservation c) -- 1.7.10.2