package jalview.io;
import java.util.Locale;
-
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import com.google.common.collect.Lists;
+
import jalview.api.FeatureColourI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.DBRefSource;
protected int appendDbRefs(final StringBuilder sb, SequenceI ds,
boolean summary)
{
- List<DBRefEntry> dbrefs = ds.getDBRefs();
- if (dbrefs == null)
+ List<DBRefEntry> dbrefs,dbrefset = ds.getDBRefs();
+
+ if (dbrefset == null)
{
return 0;
}
+ // PATCH for JAL-3980 defensive copy
+
+ dbrefs = new ArrayList<DBRefEntry>();
+
+ dbrefs.addAll(dbrefset);
+
// note this sorts the refs held on the sequence!
dbrefs.sort(comparator);
boolean ellipsis = false;