Program: 94687
Project: 94687
Buggy source:
protected void testReceiveHttp(final long start,final long end,String url) throws Exception {
  assertNotNull(transferInstance);
  final IFileTransferListener listener=new IFileTransferListener(){
    public void handleTransferEvent(    IFileTransferEvent event){
      if (event instanceof IIncomingFileTransferReceiveResumedEvent) {
        try {
          IIncomingFileTransferReceiveResumedEvent rse=(IIncomingFileTransferReceiveResumedEvent)event;
          session=rse.receive(outs);
        }
 catch (        Exception e) {
          fail(e.getLocalizedMessage());
        }
      }
 else       if (event instanceof IIncomingFileTransferReceiveStartEvent) {
        IIncomingFileTransferReceiveStartEvent rse=(IIncomingFileTransferReceiveStartEvent)event;
        try {
          outs=new FileOutputStream(FILENAME);
          session=rse.receive(outs);
          pausable=(IFileTransferPausable)session.getAdapter(IFileTransferPausable.class);
          if (pausable == null)           fail("String_Node_Str");
        }
 catch (        IOException e) {
          fail(e.getLocalizedMessage());
        }
      }
 else       if (event instanceof IIncomingFileTransferReceiveDataEvent) {
        System.out.println("String_Node_Str" + event);
      }
 else       if (event instanceof IIncomingFileTransferReceivePausedEvent) {
        System.out.println("String_Node_Str" + event);
      }
 else       if (event instanceof IIncomingFileTransferReceiveDoneEvent) {
        closeOutputStream();
        System.out.println("String_Node_Str" + event);
synchronized (notify) {
          isDone=true;
          notify.notify();
        }
      }
    }
  }
;
  final IFileID fileID=FileIDFactory.getDefault().createFileID(transferInstance.getRetrieveNamespace(),url);
  IFileRangeSpecification rangeSpecification=null;
  if (start != -1) {
    rangeSpecification=new IFileRangeSpecification(){
      public long getEndPosition(){
        return end;
      }
      public long getStartPosition(){
        return start;
      }
    }
;
  }
  transferInstance.sendRetrieveRequest(fileID,rangeSpecification,listener,null);
  if (!isDone) {
synchronized (notify) {
      notify.wait();
    }
  }
  final Exception e=session.getException();
  if (e != null)   throw e;
  incomingFile=new File(FILENAME);
  final long fileLength=incomingFile.length();
  final long bytesReceived=session.getBytesReceived();
  System.out.println("String_Node_Str" + start);
  System.out.println("String_Node_Str" + end);
  System.out.println("String_Node_Str" + bytesReceived);
  System.out.println("String_Node_Str" + fileLength);
  if (start != -1) {
    assertTrue(fileLength == bytesReceived);
    if (end != -1) {
      assertTrue(fileLength == (end - start + 1));
    }
  }
}

Fixed version (ground truth):
protected void testReceiveHttp(final long start,final long end,String url) throws Exception {
  assertNotNull(transferInstance);
  final IFileTransferListener listener=new IFileTransferListener(){
    public void handleTransferEvent(    IFileTransferEvent event){
      if (event instanceof IIncomingFileTransferReceiveResumedEvent) {
        try {
          final IIncomingFileTransferReceiveResumedEvent rse=(IIncomingFileTransferReceiveResumedEvent)event;
          session=rse.receive(outs);
        }
 catch (        final Exception e) {
          fail(e.getLocalizedMessage());
        }
      }
 else       if (event instanceof IIncomingFileTransferReceiveStartEvent) {
        final IIncomingFileTransferReceiveStartEvent rse=(IIncomingFileTransferReceiveStartEvent)event;
        try {
          outs=new FileOutputStream(FILENAME);
          session=rse.receive(outs);
          pausable=(IFileTransferPausable)session.getAdapter(IFileTransferPausable.class);
          if (pausable == null)           fail("String_Node_Str");
        }
 catch (        final IOException e) {
          fail(e.getLocalizedMessage());
        }
      }
 else       if (event instanceof IIncomingFileTransferReceiveDataEvent) {
        System.out.println("String_Node_Str" + event);
      }
 else       if (event instanceof IIncomingFileTransferReceivePausedEvent) {
        System.out.println("String_Node_Str" + event);
      }
 else       if (event instanceof IIncomingFileTransferReceiveDoneEvent) {
        closeOutputStream();
        System.out.println("String_Node_Str" + event);
synchronized (notify) {
          isDone=true;
          notify.notify();
        }
      }
    }
  }
;
  final IFileID fileID=FileIDFactory.getDefault().createFileID(transferInstance.getRetrieveNamespace(),url);
  IFileRangeSpecification rangeSpecification=null;
  if (start != -1) {
    rangeSpecification=new IFileRangeSpecification(){
      public long getEndPosition(){
        return end;
      }
      public long getStartPosition(){
        return start;
      }
    }
;
  }
  transferInstance.sendRetrieveRequest(fileID,rangeSpecification,listener,null);
  if (!isDone) {
synchronized (notify) {
      notify.wait();
    }
  }
  final Exception e=session.getException();
  if (e != null)   throw e;
  incomingFile=new File(FILENAME);
  final long fileLength=incomingFile.length();
  final long bytesReceived=session.getBytesReceived();
  System.out.println("String_Node_Str" + start);
  System.out.println("String_Node_Str" + end);
  System.out.println("String_Node_Str" + bytesReceived);
  System.out.println("String_Node_Str" + fileLength);
  if (start != -1) {
    assertTrue(fileLength == bytesReceived);
    if (end != -1) {
      assertTrue(fileLength == (end - start + 1));
    }
  }
}