git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
02d5262
)
bugfix
author
jprocter
<Jim Procter>
Thu, 19 Apr 2007 16:16:23 +0000
(16:16 +0000)
committer
jprocter
<Jim Procter>
Thu, 19 Apr 2007 16:16:23 +0000
(16:16 +0000)
src/jalview/datamodel/AlignmentAnnotation.java
patch
|
blob
|
history
diff --git
a/src/jalview/datamodel/AlignmentAnnotation.java
b/src/jalview/datamodel/AlignmentAnnotation.java
index
ef9632b
..
27ccd4c
100755
(executable)
--- a/
src/jalview/datamodel/AlignmentAnnotation.java
+++ b/
src/jalview/datamodel/AlignmentAnnotation.java
@@
-331,7
+331,10
@@
public class AlignmentAnnotation
public void restrict(int startRes, int endRes)
{
Annotation[] temp = new Annotation[endRes-startRes+1];
public void restrict(int startRes, int endRes)
{
Annotation[] temp = new Annotation[endRes-startRes+1];
- System.arraycopy(annotations, startRes, temp, 0, endRes-startRes+1);
+ if (startRes<annotations.length)
+ {
+ System.arraycopy(annotations, startRes, temp, 0, Math.min(endRes, annotations.length-1)-startRes+1);
+ }
if (sequenceRef!=null) {
// Clip the mapping, if it exists.
int spos = sequenceRef.findPosition(startRes);
if (sequenceRef!=null) {
// Clip the mapping, if it exists.
int spos = sequenceRef.findPosition(startRes);