Program: 127411
Project: 127411
Buggy source:
private void testProcesspropagateFileName(IProject project,XmiResourceManager xrm) throws PersistenceException {
  ProcessItem processItem=createTempProcessItem();
  Resource processItemResource=xrm.createItemResource(project,processItem,new Path("String_Node_Str"),ERepositoryObjectType.PROCESS,false);
  Resource propertyResource=xrm.createPropertyResource(processItemResource);
  propertyResource.getContents().add(processItem.getProperty());
  propertyResource.getContents().add(processItem.getState());
  propertyResource.getContents().add(processItem);
  processItemResource.getContents().add(processItem.getProcess());
  Resource screenshotsResource=xrm.createScreenshotResource(project,processItem,new Path("String_Node_Str"),ERepositoryObjectType.PROCESS,false);
  screenshotsResource.getContents().addAll(processItem.getProcess().getScreenshots());
  xrm.saveResource(processItemResource);
  xrm.saveResource(propertyResource);
  xrm.saveResource(screenshotsResource);
  processItem.getProperty().setLabel("String_Node_Str");
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  xrm.propagateFileName(processItem.getProperty(),processItem.getProperty());
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileNotExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  processItem.getProperty().setVersion("String_Node_Str");
  ((NodeType)processItem.getProcess().getNode().get(0)).setComponentVersion("String_Node_Str");
  xrm.propagateFileName(processItem.getProperty(),processItem.getProperty());
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  IFile file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  Property oldProperty=xrm.loadProperty(file);
  assertTrue(((NodeType)((ProcessItem)oldProperty.getItem()).getProcess().getNode().get(0)).getComponentVersion().equals("String_Node_Str"));
  processItem.getProperty().setLabel("String_Node_Str");
  xrm.propagateFileName(processItem.getProperty(),processItem.getProperty());
  xrm.propagateFileName(processItem.getProperty(),oldProperty);
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileNotExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileNotExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  processItem.getProperty().setVersion("String_Node_Str");
  ((NodeType)processItem.getProcess().getNode().get(0)).setComponentVersion("String_Node_Str");
  xrm.propagateFileName(processItem.getProperty(),processItem.getProperty());
  file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  xrm.propagateFileName(processItem.getProperty(),xrm.loadProperty(file));
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  oldProperty=xrm.loadProperty(file);
  assertTrue(((NodeType)((ProcessItem)oldProperty.getItem()).getProcess().getNode().get(0)).getComponentVersion().equals("String_Node_Str"));
  file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  oldProperty=xrm.loadProperty(file);
  assertTrue(((NodeType)((ProcessItem)oldProperty.getItem()).getProcess().getNode().get(0)).getComponentVersion().equals("String_Node_Str"));
  assertTrue(((NodeType)processItem.getProcess().getNode().get(0)).getComponentVersion().equals("String_Node_Str"));
  processItem.getProperty().setVersion("String_Node_Str");
  processItem.getProperty().setLabel("String_Node_Str");
  ((NodeType)processItem.getProcess().getNode().get(0)).setComponentVersion("String_Node_Str");
  xrm.propagateFileName(processItem.getProperty(),processItem.getProperty());
  file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  xrm.propagateFileName(processItem.getProperty(),xrm.loadProperty(file));
  file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  xrm.propagateFileName(processItem.getProperty(),xrm.loadProperty(file));
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileNotExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileNotExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileNotExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  oldProperty=xrm.loadProperty(file);
  assertTrue(((NodeType)((ProcessItem)oldProperty.getItem()).getProcess().getNode().get(0)).getComponentVersion().equals("String_Node_Str"));
  List<Resource> resources=xrm.getAffectedResources(oldProperty);
  for (  Resource resource : resources) {
    xrm.deleteResource(resource);
  }
  file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  oldProperty=xrm.loadProperty(file);
  assertTrue(((NodeType)((ProcessItem)oldProperty.getItem()).getProcess().getNode().get(0)).getComponentVersion().equals("String_Node_Str"));
  resources=xrm.getAffectedResources(oldProperty);
  for (  Resource resource : resources) {
    xrm.deleteResource(resource);
  }
  file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  oldProperty=xrm.loadProperty(file);
  assertTrue(((NodeType)((ProcessItem)oldProperty.getItem()).getProcess().getNode().get(0)).getComponentVersion().equals("String_Node_Str"));
  resources=xrm.getAffectedResources(oldProperty);
  for (  Resource resource : resources) {
    xrm.deleteResource(resource);
  }
  assertTrue(((NodeType)processItem.getProcess().getNode().get(0)).getComponentVersion().equals("String_Node_Str"));
  Property property=xrm.forceReloadProperty(processItem.getProperty());
  resources=xrm.getAffectedResources(property);
  for (  Resource resource : resources) {
    xrm.deleteResource(resource);
  }
}

Fixed version (ground truth):
private void testProcesspropagateFileName(IProject project,XmiResourceManager xrm) throws PersistenceException {
  ProcessItem processItem=createTempProcessItem();
  Resource processItemResource=xrm.createItemResource(project,processItem,new Path("String_Node_Str"),ERepositoryObjectType.PROCESS,false);
  Resource propertyResource=xrm.createPropertyResource(processItemResource);
  propertyResource.getContents().add(processItem.getProperty());
  propertyResource.getContents().add(processItem.getState());
  propertyResource.getContents().add(processItem);
  processItemResource.getContents().add(processItem.getProcess());
  Resource screenshotsResource=xrm.createScreenshotResource(project,processItem,new Path("String_Node_Str"),ERepositoryObjectType.PROCESS,false);
  screenshotsResource.getContents().addAll(processItem.getProcess().getScreenshots());
  xrm.saveResource(processItemResource);
  xrm.saveResource(propertyResource);
  xrm.saveResource(screenshotsResource);
  processItem.getProperty().setLabel("String_Node_Str");
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  xrm.propagateFileName(processItem.getProperty(),processItem.getProperty());
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileNotExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  processItem.getProperty().setVersion("String_Node_Str");
  ((NodeType)processItem.getProcess().getNode().get(0)).setComponentVersion("String_Node_Str");
  xrm.propagateFileName(processItem.getProperty(),processItem.getProperty());
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  IFile file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  Property oldProperty=xrm.loadProperty(file);
  assertTrue(((NodeType)((ProcessItem)oldProperty.getItem()).getProcess().getNode().get(0)).getComponentVersion().equals("String_Node_Str"));
  processItem.getProperty().setLabel("String_Node_Str");
  xrm.propagateFileName(processItem.getProperty(),processItem.getProperty());
  xrm.propagateFileName(processItem.getProperty(),oldProperty);
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileNotExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileNotExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  processItem.getProperty().setVersion("String_Node_Str");
  ((NodeType)processItem.getProcess().getNode().get(0)).setComponentVersion("String_Node_Str");
  xrm.propagateFileName(processItem.getProperty(),processItem.getProperty());
  file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  xrm.propagateFileName(processItem.getProperty(),xrm.loadProperty(file));
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  oldProperty=xrm.loadProperty(file);
  assertTrue(((NodeType)((ProcessItem)oldProperty.getItem()).getProcess().getNode().get(0)).getComponentVersion().equals("String_Node_Str"));
  file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  oldProperty=xrm.loadProperty(file);
  assertTrue(((NodeType)((ProcessItem)oldProperty.getItem()).getProcess().getNode().get(0)).getComponentVersion().equals("String_Node_Str"));
  assertTrue(((NodeType)processItem.getProcess().getNode().get(0)).getComponentVersion().equals("String_Node_Str"));
  processItem.getProperty().setVersion("String_Node_Str");
  processItem.getProperty().setLabel("String_Node_Str");
  ((NodeType)processItem.getProcess().getNode().get(0)).setComponentVersion("String_Node_Str");
  xrm.propagateFileName(processItem.getProperty(),processItem.getProperty());
  file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  xrm.propagateFileName(processItem.getProperty(),xrm.loadProperty(file));
  file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  xrm.propagateFileName(processItem.getProperty(),xrm.loadProperty(file));
  file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  xrm.propagateFileName(processItem.getProperty(),xrm.loadProperty(file));
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileNotExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileNotExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  checkFileNotExists(project,ERepositoryObjectType.PROCESS,"String_Node_Str","String_Node_Str");
  file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  oldProperty=xrm.loadProperty(file);
  assertTrue(((NodeType)((ProcessItem)oldProperty.getItem()).getProcess().getNode().get(0)).getComponentVersion().equals("String_Node_Str"));
  List<Resource> resources=xrm.getAffectedResources(oldProperty);
  for (  Resource resource : resources) {
    xrm.deleteResource(resource);
  }
  file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  oldProperty=xrm.loadProperty(file);
  assertTrue(((NodeType)((ProcessItem)oldProperty.getItem()).getProcess().getNode().get(0)).getComponentVersion().equals("String_Node_Str"));
  resources=xrm.getAffectedResources(oldProperty);
  for (  Resource resource : resources) {
    xrm.deleteResource(resource);
  }
  file=project.getFile(new Path(ERepositoryObjectType.getFolderName(ERepositoryObjectType.PROCESS) + "String_Node_Str"));
  oldProperty=xrm.loadProperty(file);
  assertTrue(((NodeType)((ProcessItem)oldProperty.getItem()).getProcess().getNode().get(0)).getComponentVersion().equals("String_Node_Str"));
  resources=xrm.getAffectedResources(oldProperty);
  for (  Resource resource : resources) {
    xrm.deleteResource(resource);
  }
  assertTrue(((NodeType)processItem.getProcess().getNode().get(0)).getComponentVersion().equals("String_Node_Str"));
  Property property=xrm.forceReloadProperty(processItem.getProperty());
  resources=xrm.getAffectedResources(property);
  for (  Resource resource : resources) {
    xrm.deleteResource(resource);
  }
}