From 52fca080c3cb048defbe2d3a6f44fff760365b51 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 5 Apr 2016 18:14:42 +0100 Subject: [PATCH] =?utf8?q?JAL-2046=20explicitly=20copy=20char[]=20when=20clo?= =?utf8?q?ning=20sequence=20data=20for=20copy-constructor/deriveSequence=E2=80?= =?utf8?q?=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/datamodel/Sequence.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 6f1b403..cb3ae70 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -25,6 +25,7 @@ import jalview.api.DBRefEntryI; import jalview.util.StringUtils; import java.util.ArrayList; +import java.util.Arrays; import java.util.Enumeration; import java.util.List; import java.util.Vector; @@ -216,8 +217,12 @@ public class Sequence extends ASequence implements SequenceI protected void initSeqFrom(SequenceI seq, AlignmentAnnotation[] alAnnotation) { - initSeqAndName(seq.getName(), seq.getSequence(), seq.getStart(), + { + char[] oseq = seq.getSequence(); + initSeqAndName(seq.getName(), Arrays.copyOf(oseq, oseq.length), + seq.getStart(), seq.getEnd()); + } description = seq.getDescription(); sourceDBRef = seq.getSourceDBRef() == null ? null : new DBRefEntry( seq.getSourceDBRef()); -- 1.7.10.2