Program: 128953
Project: 128953
Buggy source:
protected boolean isLastVersion(RepositoryNode repositoryObject){
  if (repositoryObject.getObject() instanceof RepositoryViewObject) {
    return true;
  }
  try {
    if (repositoryObject.getObject() != null) {
      Property property=repositoryObject.getObject().getProperty();
      Item item=repositoryObject.getObject().getProperty().getItem();
      if (item instanceof ConnectionItem) {
        return true;
      }
      List<IRepositoryViewObject> allVersion=null;
      ItemState state=property.getItem().getState();
      boolean pathExist=false;
      if (state != null) {
        String path=state.getPath();
        if (path != null) {
          File f=new File(path);
          if (f.exists()) {
            pathExist=true;
          }
        }
      }
      if (pathExist) {
        allVersion=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory().getAllVersion(property.getId(),state.getPath(),repositoryObject.getObject().getRepositoryObjectType());
      }
 else {
        allVersion=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory().getAllVersion(property.getId());
      }
      if (allVersion == null || allVersion.isEmpty()) {
        return false;
      }
      String lastVersion=VersionUtils.DEFAULT_VERSION;
      for (      IRepositoryViewObject object : allVersion) {
        if (VersionUtils.compareTo(object.getVersion(),lastVersion) > 0) {
          lastVersion=object.getVersion();
        }
      }
      if (VersionUtils.compareTo(property.getVersion(),lastVersion) == 0) {
        return true;
      }
    }
  }
 catch (  PersistenceException e) {
  }
  return false;
}

Fixed version (ground truth):
protected boolean isLastVersion(RepositoryNode repositoryObject){
  if (repositoryObject.getObject() instanceof RepositoryViewObject) {
    return true;
  }
  try {
    if (repositoryObject.getObject() != null) {
      Property property=repositoryObject.getObject().getProperty();
      Item item=repositoryObject.getObject().getProperty().getItem();
      if (item instanceof ConnectionItem) {
        if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
          IESBService service=(IESBService)GlobalServiceRegister.getDefault().getService(IESBService.class);
          if (service != null) {
            boolean flag=service.isServiceItem(item.eClass().getClassifierID());
            if (!flag) {
              return true;
            }
          }
        }
      }
      List<IRepositoryViewObject> allVersion=null;
      ItemState state=property.getItem().getState();
      boolean pathExist=false;
      if (state != null) {
        String path=state.getPath();
        if (path != null) {
          File f=new File(path);
          if (f.exists()) {
            pathExist=true;
          }
        }
      }
      if (pathExist) {
        allVersion=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory().getAllVersion(property.getId(),state.getPath(),repositoryObject.getObject().getRepositoryObjectType());
      }
 else {
        allVersion=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory().getAllVersion(property.getId());
      }
      if (allVersion == null || allVersion.isEmpty()) {
        return false;
      }
      String lastVersion=VersionUtils.DEFAULT_VERSION;
      for (      IRepositoryViewObject object : allVersion) {
        if (VersionUtils.compareTo(object.getVersion(),lastVersion) > 0) {
          lastVersion=object.getVersion();
        }
      }
      if (VersionUtils.compareTo(property.getVersion(),lastVersion) == 0) {
        return true;
      }
    }
  }
 catch (  PersistenceException e) {
  }
  return false;
}