Program: 44639
Project: 44639
Buggy source:
@Override public void endElement(String uri,String localName,String qName) throws SAXException {
  logger.debug("String_Node_Str",localName);
  ImportedEntity entityWhoseImportHasFinished=null;
  if (elementNameToBeIgnored != null) {
    entityWhoseImportHasFinished=checkIgnoredPartHasEnded(localName);
  }
 else   if (StringUtils.equals(CmsConstants.LOCALIZED_LABEL_ELEMENT_NAME,localName)) {
    addLocalizedLabelToImportedEntity(retrieveElementContentValue());
    clearElementContent();
    return;
  }
 else   if (StringUtils.equals(CmsConstants.CONTENT_ELEMENT_NAME,localName) && !cmsRepositoryEntityQueue.isEmpty() && cmsRepositoryEntityQueue.peek().getEntity() instanceof BinaryChannel) {
    addContentToBinaryChannel(retrieveElementContentValue());
    clearElementContent();
    return;
  }
 else   if (entityHasEnded(localName)) {
    entityWhoseImportHasFinished=removeEntityFromQueue();
  }
  if (entityWhoseImportHasFinished != null) {
    entityWhoseImportHasFinished.completeEntityImport((retrieveElementContentValue()));
    if (entityWhoseImportHasFinished.getEntity() instanceof CmsRepositoryEntity) {
      CmsRepositoryEntity cmsRepositoryEntity=(CmsRepositoryEntity)entityWhoseImportHasFinished.getEntity();
      if (!cmsRepositoryEntityQueue.isEmpty() && (cmsRepositoryEntityQueue.peek().getEntity() instanceof Repository || cmsRepositoryEntityQueue.peek().getEntity() instanceof List)) {
        cmsRepositoryEntity=deserializer.save(cmsRepositoryEntity);
      }
 else       if (cmsRepositoryEntity instanceof BinaryChannel) {
        deserializer.loadBinaryChannelContent((BinaryChannel)cmsRepositoryEntity);
      }
      importContext.cacheEntity(cmsRepositoryEntity);
    }
  }
  clearElementContent();
}

Fixed version (ground truth):
@Override public void endElement(String uri,String localName,String qName) throws SAXException {
  logger.debug("String_Node_Str",localName);
  ImportedEntity entityWhoseImportHasFinished=null;
  if (elementNameToBeIgnored != null) {
    entityWhoseImportHasFinished=checkIgnoredPartHasEnded(localName);
  }
 else   if (StringUtils.equals(CmsConstants.LOCALIZED_LABEL_ELEMENT_NAME,localName)) {
    addLocalizedLabelToImportedEntity(retrieveElementContentValue());
    clearElementContent();
    return;
  }
 else   if (StringUtils.equals(CmsConstants.CONTENT_ELEMENT_NAME,localName) && !cmsRepositoryEntityQueue.isEmpty() && cmsRepositoryEntityQueue.peek().entityIsABinaryChannelAndRawDataElementIsBeingProcessed()) {
    addContentToBinaryChannel(retrieveElementContentValue());
    clearElementContent();
    cmsRepositoryEntityQueue.peek().processingRawData(false);
    return;
  }
 else   if (entityHasEnded(localName)) {
    entityWhoseImportHasFinished=removeEntityFromQueue();
  }
  if (entityWhoseImportHasFinished != null) {
    entityWhoseImportHasFinished.completeEntityImport((retrieveElementContentValue()));
    if (entityWhoseImportHasFinished.getEntity() instanceof CmsRepositoryEntity) {
      CmsRepositoryEntity cmsRepositoryEntity=(CmsRepositoryEntity)entityWhoseImportHasFinished.getEntity();
      if (!cmsRepositoryEntityQueue.isEmpty() && (cmsRepositoryEntityQueue.peek().getEntity() instanceof Repository || cmsRepositoryEntityQueue.peek().getEntity() instanceof List)) {
        cmsRepositoryEntity=deserializer.save(cmsRepositoryEntity);
      }
 else       if (cmsRepositoryEntity instanceof BinaryChannel) {
        deserializer.loadBinaryChannelContent((BinaryChannel)cmsRepositoryEntity);
      }
      importContext.cacheEntity(cmsRepositoryEntity);
    }
  }
  clearElementContent();
}