Program: 125399
Project: 125399
Buggy source:
@Override public void deleteObjectPhysical(Project project,IRepositoryViewObject objToDelete,String version,boolean fromEmptyRecycleBin) throws PersistenceException {
  if ("String_Node_Str".equals(version)) {
    version=null;
  }
  List<IRepositoryViewObject> allVersionToDelete=getAllVersion(project,objToDelete.getId(),false);
  for (  IRepositoryViewObject currentVersion : allVersionToDelete) {
    String currentVersionValue=currentVersion.getVersion();
    if (version == null || currentVersionValue.equals(version)) {
      if (currentVersion.getRepositoryObjectType() == ERepositoryObjectType.PROCESS || currentVersion.getRepositoryObjectType() == ERepositoryObjectType.JOBLET || currentVersion.getRepositoryObjectType() == ERepositoryObjectType.SPARK_JOBLET || currentVersion.getRepositoryObjectType() == ERepositoryObjectType.SPARK_STREAMING_JOBLET) {
        if (coreSerivce.isAlreadyBuilt(project)) {
          if (currentVersion.getProperty() != null) {
            coreSerivce.removeItemRelations(currentVersion.getProperty().getItem());
          }
        }
      }
      Property currentProperty=currentVersion.getProperty();
      Item currentItem=currentProperty.getItem();
      if (currentItem.getParent() instanceof FolderItem) {
        ((FolderItem)currentItem.getParent()).getChildren().remove(currentItem);
      }
      currentItem.setParent(null);
      List<Resource> affectedResources=xmiResourceManager.getAffectedResources(currentProperty);
      for (      Resource resource : affectedResources) {
        deleteResource(resource);
      }
      EList<EObject> eCrossReferences=currentItem.eCrossReferences();
      if (eCrossReferences != null) {
        Iterator<EObject> i=eCrossReferences.iterator();
        while (i.hasNext()) {
          EObject object=i.next();
          if (object != null) {
            Resource currentResource=object.eResource();
            if (currentResource == null) {
              if (object.eIsProxy()) {
                URI uri=((InternalEObject)object).eProxyURI().trimFragment();
                ResourceUtils.deleteFile(URIHelper.getFile(uri));
              }
            }
          }
        }
      }
    }
  }
  if (!allVersionToDelete.isEmpty()) {
    RecycleBinManager.getInstance().removeFromRecycleBin(project,allVersionToDelete.get(0).getProperty().getItem());
  }
  if (!fromEmptyRecycleBin) {
    saveProject(project);
  }
}

Fixed version (ground truth):
@Override public void deleteObjectPhysical(Project project,IRepositoryViewObject objToDelete,String version,boolean fromEmptyRecycleBin,boolean isDeleteOnRemote) throws PersistenceException {
  if ("String_Node_Str".equals(version)) {
    version=null;
  }
  List<IRepositoryViewObject> allVersionToDelete=getAllVersion(project,objToDelete.getId(),false);
  for (  IRepositoryViewObject currentVersion : allVersionToDelete) {
    String currentVersionValue=currentVersion.getVersion();
    if (version == null || currentVersionValue.equals(version)) {
      if (currentVersion.getRepositoryObjectType() == ERepositoryObjectType.PROCESS || currentVersion.getRepositoryObjectType() == ERepositoryObjectType.JOBLET || currentVersion.getRepositoryObjectType() == ERepositoryObjectType.SPARK_JOBLET || currentVersion.getRepositoryObjectType() == ERepositoryObjectType.SPARK_STREAMING_JOBLET) {
        if (coreSerivce.isAlreadyBuilt(project)) {
          if (currentVersion.getProperty() != null) {
            coreSerivce.removeItemRelations(currentVersion.getProperty().getItem());
          }
        }
      }
      Property currentProperty=currentVersion.getProperty();
      Item currentItem=currentProperty.getItem();
      if (currentItem.getParent() instanceof FolderItem) {
        ((FolderItem)currentItem.getParent()).getChildren().remove(currentItem);
      }
      currentItem.setParent(null);
      List<Resource> affectedResources=xmiResourceManager.getAffectedResources(currentProperty);
      for (      Resource resource : affectedResources) {
        deleteResource(resource,isDeleteOnRemote);
      }
      EList<EObject> eCrossReferences=currentItem.eCrossReferences();
      if (eCrossReferences != null) {
        Iterator<EObject> i=eCrossReferences.iterator();
        while (i.hasNext()) {
          EObject object=i.next();
          if (object != null) {
            Resource currentResource=object.eResource();
            if (currentResource == null) {
              if (object.eIsProxy()) {
                URI uri=((InternalEObject)object).eProxyURI().trimFragment();
                ResourceUtils.deleteFile(URIHelper.getFile(uri));
              }
            }
          }
        }
      }
    }
  }
  if (!allVersionToDelete.isEmpty()) {
    RecycleBinManager.getInstance().removeFromRecycleBin(project,allVersionToDelete.get(0).getProperty().getItem());
  }
  if (!fromEmptyRecycleBin) {
    saveProject(project);
  }
}