Skip to content

Commit

Permalink
Fix bug where in UNIX environments, the StringTokenizer would deliver an
Browse files Browse the repository at this point in the history
empty String
  • Loading branch information
Alex Aiezza authored and Alex Aiezza committed Apr 28, 2016
1 parent 290e5d9 commit c51bdd7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/edu/rit/flick/genetics/FastFileInflator.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,14 @@ protected void getNextNs()
final StringTokenizer ns;
if ( nfile.hasNext() )
{
ns = new StringTokenizer( nfile.next(), RANGE );
nStart = Long.parseLong( ns.nextToken(), 16 );
nEnd = Long.parseLong( ns.nextToken(), 16 );
consecNs = nEnd - nStart;
final String line = nfile.next().trim();
if ( !line.isEmpty() )
{
ns = new StringTokenizer( line, RANGE );
nStart = Long.parseLong( ns.nextToken(), 16 );
nEnd = Long.parseLong( ns.nextToken(), 16 );
consecNs = nEnd - nStart;
}
}
// Check for nStart index
if ( fastOut.position() > 0 && dnaPosition.longValue() == nStart )
Expand Down

0 comments on commit c51bdd7

Please sign in to comment.