Program: 57518
Project: 57518
Buggy source:
/** 
 * Saves the project to the directory with the given name. The directory is created before saving.
 * @param dirName directory to save the project-files into
 */
private void saveData(String dirName) throws JAXBException, IOException {
  SerializationManager serializationManager=GeneralManager.get().getSerializationManager();
  JAXBContext projectContext=serializationManager.getProjectContext();
  Marshaller marshaller=projectContext.createMarshaller();
  File dataDomainFile=new File(dirName + DATA_DOMAIN_FILE);
  List<ADataDomain> dataDomains=new ArrayList<ADataDomain>();
  for (  IDataDomain dataDomain : DataDomainManager.get().getDataDomains()) {
    if (!dataDomain.isSerializeable())     continue;
    dataDomains.add((ADataDomain)dataDomain);
    if (dataDomain instanceof ATableBasedDataDomain) {
      String extendedDirName=dirName + dataDomain.getDataDomainID() + "String_Node_Str";
      String dataDomainFileName=extendedDirName + DATA_TABLE_FILE;
      DataSetDescription dataSetDescription=dataDomain.getDataSetDescription();
      String sourceFileName=dataSetDescription.getDataSourcePath();
      if (sourceFileName.contains(RECENT_PROJECT_FOLDER))       sourceFileName=sourceFileName.replace(RECENT_PROJECT_FOLDER,RECENT_PROJECT_FOLDER_TMP);
      try {
        FileOperations.writeInputStreamToFile(dataDomainFileName,GeneralManager.get().getResourceLoader().getResource(sourceFileName));
      }
 catch (      FileNotFoundException e) {
        throw new IllegalStateException("String_Node_Str",e);
      }
      ATableBasedDataDomain tableBasedDataDomain=(ATableBasedDataDomain)dataDomain;
      for (      String recordPerspectiveID : tableBasedDataDomain.getTable().getRecordPerspectiveIDs()) {
        saveDataPerspective(marshaller,extendedDirName,recordPerspectiveID,tableBasedDataDomain.getTable().getRecordPerspective(recordPerspectiveID));
      }
      for (      String dimensionPerspectiveID : tableBasedDataDomain.getTable().getDimensionPerspectiveIDs()) {
        saveDataPerspective(marshaller,extendedDirName,dimensionPerspectiveID,tableBasedDataDomain.getTable().getDimensionPerspective(dimensionPerspectiveID));
      }
    }
    String fileName=dirName + BASIC_INFORMATION_FILE;
    marshaller.marshal(GeneralManager.get().getBasicInfo(),new File(fileName));
  }
  DataDomainList dataDomainList=new DataDomainList();
  dataDomainList.setDataDomains(dataDomains);
  marshaller.marshal(dataDomainList,dataDomainFile);
}

Fixed version (ground truth):
/** 
 * Saves the project to the directory with the given name. The directory is created before saving.
 * @param dirName directory to save the project-files into
 */
private void saveData(String dirName) throws JAXBException, IOException {
  SerializationManager serializationManager=GeneralManager.get().getSerializationManager();
  JAXBContext projectContext=serializationManager.getProjectContext();
  Marshaller marshaller=projectContext.createMarshaller();
  File dataDomainFile=new File(dirName + DATA_DOMAIN_FILE);
  List<ADataDomain> dataDomains=new ArrayList<ADataDomain>();
  for (  IDataDomain dataDomain : DataDomainManager.get().getDataDomains()) {
    if (!dataDomain.isSerializeable())     continue;
    dataDomains.add((ADataDomain)dataDomain);
    if (dataDomain instanceof ATableBasedDataDomain) {
      String extendedDirName=dirName + dataDomain.getDataDomainID() + "String_Node_Str";
      String dataDomainFileName=extendedDirName + DATA_TABLE_FILE;
      DataSetDescription dataSetDescription=dataDomain.getDataSetDescription();
      String sourceFileName=dataSetDescription.getDataSourcePath();
      if (sourceFileName.contains(RECENT_PROJECT_FOLDER))       sourceFileName=sourceFileName.replace(RECENT_PROJECT_FOLDER,RECENT_PROJECT_FOLDER_TMP);
      try {
        FileOperations.writeInputStreamToFile(dataDomainFileName,GeneralManager.get().getResourceLoader().getResource(sourceFileName));
      }
 catch (      FileNotFoundException e) {
        e.printStackTrace();
        throw new IllegalStateException("String_Node_Str",e);
      }
      ATableBasedDataDomain tableBasedDataDomain=(ATableBasedDataDomain)dataDomain;
      for (      String recordPerspectiveID : tableBasedDataDomain.getTable().getRecordPerspectiveIDs()) {
        saveDataPerspective(marshaller,extendedDirName,recordPerspectiveID,tableBasedDataDomain.getTable().getRecordPerspective(recordPerspectiveID));
      }
      for (      String dimensionPerspectiveID : tableBasedDataDomain.getTable().getDimensionPerspectiveIDs()) {
        saveDataPerspective(marshaller,extendedDirName,dimensionPerspectiveID,tableBasedDataDomain.getTable().getDimensionPerspective(dimensionPerspectiveID));
      }
    }
    String fileName=dirName + BASIC_INFORMATION_FILE;
    marshaller.marshal(GeneralManager.get().getBasicInfo(),new File(fileName));
  }
  DataDomainList dataDomainList=new DataDomainList();
  dataDomainList.setDataDomains(dataDomains);
  marshaller.marshal(dataDomainList,dataDomainFile);
}