Skip to content

Commit

Permalink
Added reader.next() to extractFromSDFile
Browse files Browse the repository at this point in the history
solves bug 3462
  • Loading branch information
goglepox committed Feb 8, 2013
1 parent fa0e891 commit 3bc9609
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -2670,10 +2670,9 @@ public List<ICDKMolecule> extractFromSDFile( IFile file, int startenty,
throws BioclipseException,
InvocationTargetException {

int ticks = 10000;

try {
monitor.beginTask( "Writing file", ticks );
monitor.beginTask( "Writing file",(endentry-startenty)*10 );
IteratingBioclipseMDLReader reader
= new IteratingBioclipseMDLReader(
file.getContents(),
Expand All @@ -2682,14 +2681,15 @@ public List<ICDKMolecule> extractFromSDFile( IFile file, int startenty,
int i = 0;
List<ICDKMolecule> result=new RecordableList<ICDKMolecule>();
while (reader.hasNext()) {
ICDKMolecule molecule = reader.next();
if (i>=startenty && i<=endentry) {
result.add( reader.next() );
result.add( molecule );
monitor.worked( 10 );
}
i++;
if(i>endentry)
break;
}
monitor.worked(ticks);
return result;
}
catch (Exception e) {
Expand Down

0 comments on commit 3bc9609

Please sign in to comment.