From: Jim Procter Date: Mon, 20 Jun 2016 07:58:10 +0000 (+0100) Subject: JAL-2110 copy alcodonframes only if copy constructor called on dataset alignmentI... X-Git-Tag: Release_2_10_0~140^2~5^2~49^2~6 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d8bceb0fe95bc3be51476f9c8fa0812d21d79075;p=jalview.git JAL-2110 copy alcodonframes only if copy constructor called on dataset alignmentI instance --- diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 34f8f6e..c9ec77b 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -110,7 +110,10 @@ public class Alignment implements AlignmentI /* * Share the same dataset sequence mappings (if any). */ - this.setCodonFrames(al.getCodonFrames()); + if (dataset == null && al.getDataset() == null) + { + this.setCodonFrames(al.getCodonFrames()); + } } /** @@ -1427,6 +1430,7 @@ public class Alignment implements AlignmentI addAnnotation(alan[a]); } + // use add method getCodonFrames().addAll(toappend.getCodonFrames()); List sg = toappend.getGroups(); diff --git a/test/jalview/datamodel/AlignmentTest.java b/test/jalview/datamodel/AlignmentTest.java index 5753e97..08a9441 100644 --- a/test/jalview/datamodel/AlignmentTest.java +++ b/test/jalview/datamodel/AlignmentTest.java @@ -398,6 +398,8 @@ public class AlignmentTest // TODO should the copy constructor copy the dataset? // or make a new one referring to the same dataset sequences?? assertNull(copy.getDataset()); + // TODO test metadata is copied when AlignmentI is a dataset + // assertArrayEquals(copy.getDataset().getSequencesArray(), protein // .getDataset().getSequencesArray()); }