git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
debug dialog
[jalview.git]
/
src
/
jalview
/
datamodel
/
Sequence.java
diff --git
a/src/jalview/datamodel/Sequence.java
b/src/jalview/datamodel/Sequence.java
index
13f928c
..
22929f5
100755
(executable)
--- a/
src/jalview/datamodel/Sequence.java
+++ b/
src/jalview/datamodel/Sequence.java
@@
-116,7
+116,7
@@
public class Sequence implements SequenceI
void checkValidRange()
{
void checkValidRange()
{
- if (end < 1)
+ // Note: JAL-774 : http://issues.jalview.org/browse/JAL-774?focusedCommentId=11239&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-11239
{
int endRes = 0;
for (int j = 0; j < sequence.length; j++)
{
int endRes = 0;
for (int j = 0; j < sequence.length; j++)
@@
-131,7
+131,9
@@
public class Sequence implements SequenceI
endRes += start - 1;
}
endRes += start - 1;
}
- this.end = endRes;
+ if (end<endRes) {
+ end = endRes;
+ }
}
}
}
}
@@
-582,7
+584,7
@@
public class Sequence implements SequenceI
// returns the alignment position for a residue
int j = start;
int i = 0;
// returns the alignment position for a residue
int j = start;
int i = 0;
-
+ // Rely on end being at least as long as the length of the sequence.
while ((i < sequence.length) && (j <= end) && (j <= pos))
{
if (!jalview.util.Comparison.isGap(sequence[i]))
while ((i < sequence.length) && (j <= end) && (j <= pos))
{
if (!jalview.util.Comparison.isGap(sequence[i]))