[Biojava-l] Bug in FastaFormat.java

Thomas Down td2@sanger.ac.uk
Thu, 13 Dec 2001 23:01:01 +0000


On Thu, Dec 13, 2001 at 11:51:15AM -0500, Simon Foote wrote:
> There appears to be a bug in the writeSequence(Sequence seq, PrintStream os)
> method of FastaFormat.java
> 
> If you have a sequence whose length is exactly divisable by the 
> lineWidth (60), then you get an IndexOutOfBounds exception when writing 
> it out.
> 
> The problem occurs at line 207:
> 
> for(int pos = 1; pos <= seq.length() + 1; pos += lineWidth) {

Thanks for spotting this -- I've checked in your suggested
fix now.

    Thomas.