Program: 127413
Project: 127413
Buggy source:
public void propagateFileName(Property lastVersionProperty,Property resourceProperty) throws PersistenceException {
  ResourceFilenameHelper.FileName fileNameTest=ResourceFilenameHelper.create(resourceProperty.eResource(),resourceProperty,lastVersionProperty);
  if (!ResourceFilenameHelper.mustChangeVersion(fileNameTest) && !ResourceFilenameHelper.mustChangeLabel(fileNameTest)) {
    return;
  }
  List<Resource> affectedResources=getAffectedResources(resourceProperty);
  List<Resource> resourcesToSave=new ArrayList<Resource>();
  Property previousVersionProperty=null;
  IFile propertyFile=null;
  for (  Resource resource : affectedResources) {
    ResourceFilenameHelper.FileName fileName=ResourceFilenameHelper.create(resource,resourceProperty,lastVersionProperty);
    if (ResourceFilenameHelper.mustChangeVersion(fileName)) {
      IPath path=URIHelper.convert(resource.getURI());
      IPath bakPath=path.addFileExtension("String_Node_Str");
      copyResource(resource,bakPath);
      IFile file=ResourcesPlugin.getWorkspace().getRoot().getFile(bakPath);
      moveResource(resource,ResourceFilenameHelper.getExpectedFilePath(fileName,false));
      resourcesToSave.add(resource);
      ResourceUtils.moveResource(file,path);
      file=ResourcesPlugin.getWorkspace().getRoot().getFile(path);
      if (isPropertyFile(file)) {
        propertyFile=file;
      }
    }
 else     if (ResourceFilenameHelper.mustChangeLabel(fileName)) {
      resourceProperty.setLabel(lastVersionProperty.getLabel());
      resourceProperty.setDisplayName(lastVersionProperty.getDisplayName());
      if (!ResourceFilenameHelper.hasSameNameButDifferentCase(fileName)) {
        moveResource(resource,ResourceFilenameHelper.getExpectedFilePath(fileName,false));
      }
      resourcesToSave.add(resource);
    }
  }
  if (propertyFile != null) {
    previousVersionProperty=loadProperty(propertyFile);
  }
  if (previousVersionProperty != null) {
    List<Resource> previousVersionResources=getAffectedResources(previousVersionProperty);
    for (    Resource resource : previousVersionResources) {
      FileName fileName=ResourceFilenameHelper.create(resource,previousVersionProperty,lastVersionProperty);
      if (ResourceFilenameHelper.mustChangeLabel(fileName)) {
        IPath expectedFilePath=ResourceFilenameHelper.getExpectedFilePath(fileName,true);
        previousVersionProperty.setLabel(lastVersionProperty.getLabel());
        previousVersionProperty.setDisplayName(lastVersionProperty.getDisplayName());
        if (!ResourceFilenameHelper.hasSameNameButDifferentCase(fileName)) {
          moveResource(resource,expectedFilePath);
        }
      }
      resourcesToSave.add(resource);
    }
    if (lastVersionProperty.getItem().getParent() instanceof FolderItem) {
      FolderItem folderItem=(FolderItem)lastVersionProperty.getItem().getParent();
      folderItem.getChildren().add(previousVersionProperty.getItem());
    }
  }
  for (  Resource resource : resourcesToSave) {
    saveResource(resource);
  }
  if (!resourceProperty.equals(lastVersionProperty)) {
    Item item=resourceProperty.getItem();
    if (item.getParent() != null && item.getParent() instanceof FolderItem) {
      ((FolderItem)item.getParent()).getChildren().remove(item);
      item.setParent(null);
    }
  }
}

Fixed version (ground truth):
public void propagateFileName(Property lastVersionProperty,Property resourceProperty) throws PersistenceException {
  ResourceFilenameHelper.FileName fileNameTest=ResourceFilenameHelper.create(resourceProperty.eResource(),resourceProperty,lastVersionProperty);
  if (!ResourceFilenameHelper.mustChangeVersion(fileNameTest) && ResourceFilenameHelper.hasSameNameButDifferentCase(fileNameTest)) {
    throw new PersistenceException("String_Node_Str");
  }
  if (!ResourceFilenameHelper.mustChangeVersion(fileNameTest) && !ResourceFilenameHelper.mustChangeLabel(fileNameTest)) {
    return;
  }
  List<Resource> affectedResources=getAffectedResources(resourceProperty);
  List<Resource> resourcesToSave=new ArrayList<Resource>();
  for (  Resource resource : affectedResources) {
    ResourceFilenameHelper.FileName fileName=ResourceFilenameHelper.create(resource,resourceProperty,lastVersionProperty);
    if (ResourceFilenameHelper.mustChangeVersion(fileName)) {
      IPath path=ResourceFilenameHelper.getExpectedFilePath(fileName,false);
      resource.setURI(URIHelper.convert(path));
      resourcesToSave.add(resource);
    }
 else     if (ResourceFilenameHelper.mustChangeLabel(fileName)) {
      resourceProperty.setLabel(lastVersionProperty.getLabel());
      resourceProperty.setDisplayName(lastVersionProperty.getDisplayName());
      moveResource(resource,ResourceFilenameHelper.getExpectedFilePath(fileName,false));
      resourcesToSave.add(resource);
    }
  }
  for (  Resource resource : resourcesToSave) {
    saveResource(resource);
    getResourceSet().getResources().remove(resource);
  }
  if (!resourceProperty.equals(lastVersionProperty)) {
    Item item=resourceProperty.getItem();
    if (item.getParent() != null && item.getParent() instanceof FolderItem) {
      ((FolderItem)item.getParent()).getChildren().remove(item);
      item.setParent(null);
    }
  }
}