Program: 124209
Project: 124209
Buggy source:
private void checkItemDependencies(Item item,List<IRepositoryViewObject> repositoryObjects){
  if (item == null) {
    return;
  }
  IProxyRepositoryFactory factory=CorePlugin.getDefault().getProxyRepositoryFactory();
  RelationshipItemBuilder builder=RelationshipItemBuilder.getInstance();
  List<RelationshipItemBuilder.Relation> relations;
  if (item instanceof JobletProcessItem) {
    relations=builder.getItemsRelatedTo(item.getProperty().getId(),item.getProperty().getVersion(),RelationshipItemBuilder.JOBLET_RELATION);
  }
 else {
    relations=builder.getItemsRelatedTo(item.getProperty().getId(),item.getProperty().getVersion(),RelationshipItemBuilder.JOB_RELATION);
  }
  for (  RelationshipItemBuilder.Relation relation : relations) {
    IRepositoryViewObject obj=null;
    try {
      if (RelationshipItemBuilder.ROUTINE_RELATION.equals(relation.getType())) {
        obj=RoutinesUtil.getRoutineFromName(relation.getId());
      }
 else {
        obj=factory.getLastVersion(relation.getId());
      }
      if (obj != null) {
        RepositoryNode repositoryNode=RepositoryNodeUtilities.getRepositoryNode(obj,false);
        if (repositoryNode != null) {
          if (!repositoryObjects.contains(obj)) {
            repositoryObjects.add(obj);
            checkAllVerSionLatest(repositoryObjects,obj);
            checkItemDependencies(obj.getProperty().getItem(),repositoryObjects);
          }
        }
      }
    }
 catch (    PersistenceException et) {
      ExceptionHandler.process(et);
    }
  }
}

Fixed version (ground truth):
private void checkItemDependencies(Item item,List<IRepositoryViewObject> repositoryObjects){
  if (item == null) {
    return;
  }
  IProxyRepositoryFactory factory=CorePlugin.getDefault().getProxyRepositoryFactory();
  RelationshipItemBuilder builder=RelationshipItemBuilder.getInstance();
  List<RelationshipItemBuilder.Relation> relations;
  if (item instanceof JobletProcessItem) {
    relations=builder.getItemsRelatedTo(item.getProperty().getId(),item.getProperty().getVersion(),RelationshipItemBuilder.JOBLET_RELATION);
  }
 else {
    relations=builder.getItemsRelatedTo(item.getProperty().getId(),item.getProperty().getVersion(),RelationshipItemBuilder.JOB_RELATION);
  }
  for (  RelationshipItemBuilder.Relation relation : relations) {
    IRepositoryViewObject obj=null;
    String id=relation.getId();
    try {
      if (RelationshipItemBuilder.ROUTINE_RELATION.equals(relation.getType())) {
        obj=RoutinesUtil.getRoutineFromName(id);
      }
 else {
        if (id != null && id.indexOf("String_Node_Str") != -1) {
          id=id.substring(0,id.lastIndexOf("String_Node_Str"));
        }
        obj=factory.getLastVersion(id);
      }
      if (obj != null) {
        RepositoryNode repositoryNode=RepositoryNodeUtilities.getRepositoryNode(obj,false);
        if (repositoryNode != null) {
          if (!repositoryObjects.contains(obj)) {
            repositoryObjects.add(obj);
            checkAllVerSionLatest(repositoryObjects,obj);
            checkItemDependencies(obj.getProperty().getItem(),repositoryObjects);
          }
        }
      }
    }
 catch (    PersistenceException et) {
      ExceptionHandler.process(et);
    }
  }
}