Program: 138762
Project: 138762
Buggy source:
/** 
 * DOC bZhou Comment method "update".
 * @param desFile
 * @throws IOException
 * @throws PersistenceException
 */
private void update(File desFile) throws IOException, PersistenceException {
  String curProjectLabel=ResourceManager.getRootProjectName();
  if (!StringUtils.equals(projectName,curProjectLabel)) {
    String content=FileUtils.readFileToString(desFile,"String_Node_Str");
    content=StringUtils.replace(content,"String_Node_Str" + projectName + "String_Node_Str","String_Node_Str" + curProjectLabel + "String_Node_Str");
    FileUtils.writeStringToFile(desFile,content,"String_Node_Str");
  }
  if (desFile.getName().endsWith(FactoriesUtil.PROPERTIES_EXTENSION)) {
    Property property=PropertyHelper.getProperty(desFile);
    User user=ReponsitoryContextBridge.getUser();
    if (user != null) {
      property.setAuthor(user);
    }
    EMFSharedResources.getInstance().saveResource(property.eResource());
  }
  if (desFile.getName().endsWith(FactoriesUtil.ITEM_EXTENSION)) {
    File propFile=new Path(desFile.getAbsolutePath()).removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION).toFile();
    Property property=PropertyHelper.getProperty(propFile);
    if (property.getItem() instanceof ConnectionItem) {
      Connection connection=((ConnectionItem)property.getItem()).getConnection();
      TdSoftwareSystem softwareSystem=SoftwareSystemManager.getInstance().getSoftwareSystem(connection);
      if (softwareSystem != null) {
        ConnectionHelper.setSoftwareSystem(connection,softwareSystem);
      }
      ProxyRepositoryFactory.getInstance().save(property.getItem(),true);
      IRepositoryViewObject object=new RepositoryViewObject(property);
      ProxyRepositoryViewObject.registerReposViewObj(connection,object);
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "update".
 * @param desFile
 * @throws IOException
 * @throws PersistenceException
 */
private void update(File desFile) throws IOException, PersistenceException {
  String curProjectLabel=ResourceManager.getRootProjectName();
  if (!StringUtils.equals(projectName,curProjectLabel)) {
    String content=FileUtils.readFileToString(desFile,"String_Node_Str");
    content=StringUtils.replace(content,"String_Node_Str" + projectName + "String_Node_Str","String_Node_Str" + curProjectLabel + "String_Node_Str");
    FileUtils.writeStringToFile(desFile,content,"String_Node_Str");
  }
  if (desFile.getName().endsWith(FactoriesUtil.PROPERTIES_EXTENSION)) {
    Property property=PropertyHelper.getProperty(desFile);
    User user=ReponsitoryContextBridge.getUser();
    if (user != null) {
      property.setAuthor(user);
    }
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + desFile + "String_Node_Str"+ property.getLabel());
    }
    EMFSharedResources.getInstance().saveResource(property.eResource());
  }
  if (desFile.getName().endsWith(FactoriesUtil.ITEM_EXTENSION)) {
    File propFile=new Path(desFile.getAbsolutePath()).removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION).toFile();
    Property property=PropertyHelper.getProperty(propFile);
    if (property != null && property.getItem() instanceof ConnectionItem) {
      Connection connection=((ConnectionItem)property.getItem()).getConnection();
      TdSoftwareSystem softwareSystem=SoftwareSystemManager.getInstance().getSoftwareSystem(connection);
      if (softwareSystem != null) {
        ConnectionHelper.setSoftwareSystem(connection,softwareSystem);
      }
      ProxyRepositoryFactory.getInstance().save(property.getItem(),true);
      IRepositoryViewObject object=new RepositoryViewObject(property);
      ProxyRepositoryViewObject.registerReposViewObj(connection,object);
    }
  }
}