Program: 58169
Project: 58169
Buggy source:
private void saveDataDomains(String dirName){
  SerializationManager serializationManager=GeneralManager.get().getSerializationManager();
  JAXBContext projectContext=serializationManager.getProjectContext();
  try {
    Marshaller marshaller=projectContext.createMarshaller();
    File dataDomainFile=new File(dirName + DATA_DOMAIN_FILE_NAME);
    ArrayList<ADataDomain> dataDomains=new ArrayList<ADataDomain>();
    for (    IDataDomain dataDomain : DataDomainManager.get().getDataDomains()) {
      dataDomains.add((ADataDomain)dataDomain);
    }
    DataDomainList dataDomainList=new DataDomainList();
    dataDomainList.setDataDomains(dataDomains);
    marshaller.marshal(dataDomainList,dataDomainFile);
    for (    IDataDomain dataDomain : DataDomainManager.get().getDataDomains()) {
      if (dataDomain instanceof ASetBasedDataDomain) {
        LoadDataParameters parameters=dataDomain.getLoadDataParameters();
        try {
          FileOperations.writeInputStreamToFile(dirName + SET_DATA_FILE_NAME,GeneralManager.get().getResourceLoader().getResource(parameters.getFileName()));
        }
 catch (        FileNotFoundException e) {
          throw new IllegalStateException("String_Node_Str",e);
        }
        ASetBasedDataDomain setBasedDataDomain=(ASetBasedDataDomain)dataDomain;
        for (        ContentVAType type : ContentVAType.getRegisteredVATypes()) {
          saveContentVA(marshaller,dirName,setBasedDataDomain,type);
        }
        for (        StorageVAType type : StorageVAType.getRegisteredVATypes()) {
          saveStorageVA(marshaller,dirName,setBasedDataDomain,type);
        }
        TreePorter treePorter=new TreePorter();
        Tree<ClusterNode> geneTree=setBasedDataDomain.getSet().getContentData(ContentVAType.CONTENT).getContentTree();
        if (geneTree != null) {
          treePorter.exportTree(dirName + GENE_TREE_FILE_NAME,geneTree);
        }
        treePorter=new TreePorter();
        Tree<ClusterNode> expTree=setBasedDataDomain.getSet().getStorageData(StorageVAType.STORAGE).getStorageTree();
        if (expTree != null) {
          treePorter.exportTree(dirName + EXP_TREE_FILE_NAME,expTree);
        }
      }
    }
  }
 catch (  JAXBException ex) {
    throw new RuntimeException("String_Node_Str",ex);
  }
catch (  IOException ex) {
    throw new RuntimeException("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
private void saveDataDomains(String dirName){
  SerializationManager serializationManager=GeneralManager.get().getSerializationManager();
  JAXBContext projectContext=serializationManager.getProjectContext();
  try {
    Marshaller marshaller=projectContext.createMarshaller();
    File dataDomainFile=new File(dirName + DATA_DOMAIN_FILE_NAME);
    ArrayList<ADataDomain> dataDomains=new ArrayList<ADataDomain>();
    for (    IDataDomain dataDomain : DataDomainManager.get().getDataDomains()) {
      dataDomains.add((ADataDomain)dataDomain);
    }
    DataDomainList dataDomainList=new DataDomainList();
    dataDomainList.setDataDomains(dataDomains);
    marshaller.marshal(dataDomainList,dataDomainFile);
    for (    IDataDomain dataDomain : DataDomainManager.get().getDataDomains()) {
      if (dataDomain instanceof ASetBasedDataDomain) {
        LoadDataParameters parameters=dataDomain.getLoadDataParameters();
        String sourceFileName=parameters.getFileName();
        if (sourceFileName.contains(RECENT_PROJECT_DIR_NAME))         sourceFileName=sourceFileName.replace(RECENT_PROJECT_DIR_NAME,RECENT_PROJECT_DIR_NAME_TMP);
        try {
          FileOperations.writeInputStreamToFile(dirName + SET_DATA_FILE_NAME,GeneralManager.get().getResourceLoader().getResource(sourceFileName));
        }
 catch (        FileNotFoundException e) {
          throw new IllegalStateException("String_Node_Str",e);
        }
        ASetBasedDataDomain setBasedDataDomain=(ASetBasedDataDomain)dataDomain;
        for (        ContentVAType type : ContentVAType.getRegisteredVATypes()) {
          saveContentVA(marshaller,dirName,setBasedDataDomain,type);
        }
        for (        StorageVAType type : StorageVAType.getRegisteredVATypes()) {
          saveStorageVA(marshaller,dirName,setBasedDataDomain,type);
        }
        TreePorter treePorter=new TreePorter();
        Tree<ClusterNode> geneTree=setBasedDataDomain.getSet().getContentData(ContentVAType.CONTENT).getContentTree();
        if (geneTree != null) {
          treePorter.exportTree(dirName + GENE_TREE_FILE_NAME,geneTree);
        }
        treePorter=new TreePorter();
        Tree<ClusterNode> expTree=setBasedDataDomain.getSet().getStorageData(StorageVAType.STORAGE).getStorageTree();
        if (expTree != null) {
          treePorter.exportTree(dirName + EXP_TREE_FILE_NAME,expTree);
        }
      }
    }
  }
 catch (  JAXBException ex) {
    throw new RuntimeException("String_Node_Str",ex);
  }
catch (  IOException ex) {
    throw new RuntimeException("String_Node_Str",ex);
  }
}