Program: 18299
Project: 18299
Buggy source:
@Override public void run(){
  LoginContext loginContext=null;
  HttpDownloaderService downloaderService=Framework.getLocalService(HttpDownloaderService.class);
  while (true) {
    boolean empty;
synchronized (parsingPool) {
      empty=parsingPool.isEmpty();
    }
    if (empty) {
      try {
synchronized (this) {
          wait();
        }
      }
 catch (      InterruptedException e) {
      }
    }
    WebFileParsingPoolEntry entry=null;
synchronized (parsingPool) {
      if (!parsingPool.isEmpty()) {
        entry=parsingPool.pop();
      }
    }
    if (entry != null) {
      try {
        HttpDownloader httpDownloader=downloaderService.createHttpDownloader(entry.getUrl());
        Blob blob=httpDownloader.download().getBlob();
        DocumentModel targetModel=entry.getTargetModel();
        String storageProp=entry.getStorageProp();
        if (storageProp != null) {
          targetModel.getProperty(storageProp).setValue(blob);
        }
        loginContext=Framework.login();
        RepositoryManager mgr=Framework.getService(RepositoryManager.class);
        Repository repository=mgr.getDefaultRepository();
        TransactionHelper.startTransaction();
        CoreSession coreSession=null;
        try {
          if (repository != null) {
            coreSession=repository.open();
          }
          if (coreSession != null) {
            for (            WebFileParser parser : parsers.values()) {
              parser.parse(coreSession,blob,targetModel,entry.getOptions());
            }
            coreSession.saveDocument(targetModel);
            coreSession.save();
          }
 else {
            throw new ClientException("String_Node_Str");
          }
        }
 catch (        Throwable t) {
          log.warn("String_Node_Str" + t.getMessage());
          TransactionHelper.setTransactionRollbackOnly();
        }
 finally {
          TransactionHelper.commitOrRollbackTransaction();
          CoreInstance.getInstance().close(coreSession);
          loginContext.logout();
        }
      }
 catch (      Exception e) {
        log.warn("String_Node_Str",e);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  HttpDownloaderService downloaderService=Framework.getLocalService(HttpDownloaderService.class);
  while (true) {
    boolean empty;
synchronized (parsingPool) {
      empty=parsingPool.isEmpty();
    }
    if (empty) {
      try {
synchronized (this) {
          wait();
        }
      }
 catch (      InterruptedException e) {
      }
    }
    WebFileParsingPoolEntry entry=null;
synchronized (parsingPool) {
      if (!parsingPool.isEmpty()) {
        entry=parsingPool.pop();
      }
    }
    if (entry != null) {
      try {
        HttpDownloader httpDownloader=downloaderService.createHttpDownloader(entry.getUrl());
        Blob blob=httpDownloader.download().getBlob();
        DocumentModel targetModel=entry.getTargetModel();
        String storageProp=entry.getStorageProp();
        if (storageProp != null) {
          targetModel.getProperty(storageProp).setValue(blob);
        }
        try {
          loginContext=Framework.login();
          RepositoryManager mgr=Framework.getService(RepositoryManager.class);
          Repository repository=mgr.getDefaultRepository();
          TransactionHelper.startTransaction();
          coreSession=null;
          if (repository != null) {
            coreSession=repository.open();
          }
          if (coreSession != null) {
            for (            WebFileParser parser : parsers.values()) {
              parser.parse(coreSession,blob,targetModel,entry.getOptions());
            }
            coreSession.saveDocument(targetModel);
            coreSession.save();
          }
 else {
            throw new ClientException("String_Node_Str");
          }
        }
 catch (        Throwable t) {
          log.warn("String_Node_Str" + t.getMessage());
          TransactionHelper.setTransactionRollbackOnly();
        }
 finally {
          TransactionHelper.commitOrRollbackTransaction();
          if (coreSession != null) {
            CoreInstance.getInstance().close(coreSession);
          }
          if (loginContext != null) {
            loginContext.logout();
          }
        }
      }
 catch (      Exception e) {
        log.warn("String_Node_Str" + e.getMessage());
      }
    }
  }
}