JAL-674 patch to make Mapping.compareTransferredToRefPDBAnnot test
authorJim Procter <jprocter@dundee.ac.uk>
Wed, 28 Jan 2015 11:13:47 +0000 (11:13 +0000)
committerJim Procter <jprocter@dundee.ac.uk>
Wed, 28 Jan 2015 11:13:47 +0000 (11:13 +0000)
    pass
        otherwise addAll throws an index not found exception with
inspos==-1

src/jalview/analysis/AlignSeq.java

index ba7e520..2ef1c76 100755 (executable)
@@ -1155,7 +1155,8 @@ public class AlignSeq
           }
           if (sq.getAnnotation() != null && sq.getAnnotation().length > 0)
           {
-            annotations.addAll(inspos, Arrays.asList(sq.getAnnotation()));
+            annotations.addAll(inspos == -1 ? annotations.size() : inspos,
+                    Arrays.asList(sq.getAnnotation()));
           }
         }
       }