From: gmungoc Date: Fri, 1 Dec 2017 15:52:58 +0000 (+0000) Subject: JAL-2792 sort feature attributes for output, not for storage X-Git-Tag: Release_2_11_0~94 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8eb8ed34a9bbd66087433ca6a3d41b4fe2553d6a;p=jalview.git JAL-2792 sort feature attributes for output, not for storage --- diff --git a/src/jalview/datamodel/SequenceFeature.java b/src/jalview/datamodel/SequenceFeature.java index 8a6cb61..34565c6 100755 --- a/src/jalview/datamodel/SequenceFeature.java +++ b/src/jalview/datamodel/SequenceFeature.java @@ -30,6 +30,7 @@ import jalview.util.StringUtils; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; +import java.util.SortedMap; import java.util.TreeMap; import java.util.Vector; @@ -643,9 +644,13 @@ public class SequenceFeature implements FeatureLocationI { /* * expand values in a Map attribute across separate lines + * copy to a TreeMap for alphabetical ordering */ - Map values = (Map) value; - for (Entry e : values.entrySet()) + Map values = (Map) value; + SortedMap sm = new TreeMap<>( + String.CASE_INSENSITIVE_ORDER); + sm.putAll(values); + for (Entry e : sm.entrySet()) { sb.append(String.format(ROW_DATA, key, e.getKey().toString(), e .getValue().toString()));