JAL-674 patch logic to test whether old and new sequence reference for annotation...
authorJim Procter <j.procter@dundee.ac.uk>
Wed, 15 Oct 2014 08:56:53 +0000 (09:56 +0100)
committerJim Procter <j.procter@dundee.ac.uk>
Wed, 15 Oct 2014 08:56:53 +0000 (09:56 +0100)
src/jalview/datamodel/AlignmentAnnotation.java

index 92a4f6d..679681c 100755 (executable)
@@ -949,10 +949,14 @@ public class AlignmentAnnotation
     {
       if (sequenceRef != null)
       {
+        boolean rIsDs=sequenceRef.getDatasetSequence()==null,tIsDs=sequenceI.getDatasetSequence()==null;
         if (sequenceRef != sequenceI
-                && !sequenceRef.equals(sequenceI)
-                && sequenceRef.getDatasetSequence() != sequenceI
+                && (rIsDs && !tIsDs && sequenceRef != sequenceI
                         .getDatasetSequence())
+                && (!rIsDs && tIsDs && sequenceRef.getDatasetSequence() != sequenceI)
+                && (!rIsDs && !tIsDs && sequenceRef.getDatasetSequence() != sequenceI
+                        .getDatasetSequence())
+                && !sequenceRef.equals(sequenceI))
         {
           // if sequenceRef isn't intersecting with sequenceI
           // throw away old mapping and reconstruct.