Program: 95008
Project: 95008
Buggy source:
protected void testReceive(String url) throws Exception {
  final File srcFile=new File(url);
  IRetrieveFileTransferContainerAdapter retrieveAdapter=(IRetrieveFileTransferContainerAdapter)getClients()[0].getAdapter(IRetrieveFileTransferContainerAdapter.class);
  assertNotNull(retrieveAdapter);
  IFileTransferListener listener=new IFileTransferListener(){
    File targetFile=null;
    BufferedOutputStream bufferedStream=null;
    public void handleTransferEvent(    IFileTransferEvent event){
      if (event instanceof IIncomingFileTransferReceiveStartEvent) {
        IIncomingFileTransferReceiveStartEvent rse=(IIncomingFileTransferReceiveStartEvent)event;
        targetFile=new File(TESTTARGETPATH,rse.getFileID().getFilename());
        printFileInfo("String_Node_Str",event,targetFile);
        try {
          bufferedStream=new BufferedOutputStream(new FileOutputStream(targetFile));
          rse.receive(bufferedStream);
        }
 catch (        IOException e) {
          e.printStackTrace();
          fail(e.getLocalizedMessage());
        }
      }
 else       if (event instanceof IIncomingFileTransferReceiveDataEvent) {
        printFileInfo("String_Node_Str",event,targetFile);
      }
 else       if (event instanceof IIncomingFileTransferReceiveDoneEvent) {
        printFileInfo("String_Node_Str",event,targetFile);
        assertTrue(srcFile.length() == targetFile.length());
      }
 else {
        printFileInfo("String_Node_Str",event,targetFile);
      }
    }
  }
;
  retrieveAdapter.sendRetrieveRequest(FileIDFactory.getDefault().createFileID(retrieveAdapter.getRetrieveNamespace(),url),listener,null);
}

Fixed version (ground truth):
protected void testReceive(String url) throws Exception {
  final File srcFile=new File(url);
  IRetrieveFileTransferContainerAdapter retrieveAdapter=(IRetrieveFileTransferContainerAdapter)getClients()[0].getAdapter(IRetrieveFileTransferContainerAdapter.class);
  assertNotNull(retrieveAdapter);
  IFileTransferListener listener=new IFileTransferListener(){
    File targetFile=null;
    BufferedOutputStream bufferedStream=null;
    public void handleTransferEvent(    IFileTransferEvent event){
      if (event instanceof IIncomingFileTransferReceiveStartEvent) {
        IIncomingFileTransferReceiveStartEvent rse=(IIncomingFileTransferReceiveStartEvent)event;
        targetFile=new File(TESTTARGETPATH,rse.getFileID().getFilename());
        printFileInfo("String_Node_Str",event,targetFile);
        try {
          bufferedStream=new BufferedOutputStream(new FileOutputStream(targetFile));
          rse.receive(bufferedStream);
        }
 catch (        IOException e) {
          e.printStackTrace();
          fail(e.getLocalizedMessage());
        }
      }
 else       if (event instanceof IIncomingFileTransferReceiveDataEvent) {
        printFileInfo("String_Node_Str",event,targetFile);
      }
 else       if (event instanceof IIncomingFileTransferReceiveDoneEvent) {
        try {
          bufferedStream.flush();
          printFileInfo("String_Node_Str",event,targetFile);
          assertTrue(srcFile.length() == targetFile.length());
        }
 catch (        IOException e) {
          e.printStackTrace();
          fail(e.getLocalizedMessage());
        }
      }
 else {
        printFileInfo("String_Node_Str",event,targetFile);
      }
    }
  }
;
  retrieveAdapter.sendRetrieveRequest(FileIDFactory.getDefault().createFileID(retrieveAdapter.getRetrieveNamespace(),url),listener,null);
}