Program: 148021
Project: 148021
Buggy source:
private void findFromContainer(IRepositoryViewObject viewObj,Set<IRepositoryViewObject> viewObjs){
  if (viewObj instanceof FolderRepositoryObject) {
    List<Object> selectedObjectCon=getSelectedObject();
    boolean existCon=false;
    for (    Object obj : selectedObjectCon) {
      if (obj instanceof IRepositoryViewObject) {
        IRepositoryViewObject vobject=(IRepositoryViewObject)obj;
        if (viewObj == vobject) {
          existCon=true;
        }
      }
    }
    if (existCon) {
      if (viewObj instanceof FolderRepositoryObject) {
        for (        IRepositoryViewObject vobject : ((FolderRepositoryObject)viewObj).getChildren()) {
          Item itm=vobject.getProperty().getItem();
          if (itm instanceof MDMServerObjectItem) {
            MDMServerObject serverObject=((MDMServerObjectItem)itm).getMDMServerObject();
            if (serverObject.getLastServerDef() == null || serverObject.isChanged() || serverObject.isCreated()) {
              if (serverObject.getLastServerDef() != null) {
                defNames.add(serverObject.getLastServerDef().getName());
              }
              viewObjs.add(vobject);
            }
          }
        }
      }
    }
    for (    IRepositoryViewObject child : ((FolderRepositoryObject)viewObj).getChildren()) {
      if (child instanceof FolderRepositoryObject) {
        findFromContainer(child,viewObjs);
      }
 else {
        Item item=child.getProperty().getItem();
        if (!isButton) {
          List<Object> selectedObject=getSelectedObject();
          boolean exist=false;
          for (          Object obj : selectedObject) {
            if (obj instanceof IRepositoryViewObject) {
              IRepositoryViewObject vobject=(IRepositoryViewObject)obj;
              if (child == vobject) {
                exist=true;
              }
            }
          }
          if (!exist)           continue;
        }
        if (item instanceof MDMServerObjectItem) {
          MDMServerObject serverObject=((MDMServerObjectItem)item).getMDMServerObject();
          if (serverObject.getLastServerDef() == null || serverObject.isChanged() || serverObject.isCreated()) {
            if (serverObject.getLastServerDef() != null) {
              defNames.add(serverObject.getLastServerDef().getName());
            }
            viewObjs.add(child);
          }
        }
      }
    }
  }
  IS_DEPLOYALL_FLAG=true;
}

Fixed version (ground truth):
private void findFromContainer(IRepositoryViewObject viewObj,Set<IRepositoryViewObject> viewObjs){
  if (viewObj instanceof FolderRepositoryObject || viewObj instanceof WSRootRepositoryObject) {
    List<Object> selectedObjectCon=getSelectedObject();
    boolean existCon=false;
    for (    Object obj : selectedObjectCon) {
      if (obj instanceof IRepositoryViewObject) {
        IRepositoryViewObject vobject=(IRepositoryViewObject)obj;
        if (viewObj == vobject) {
          existCon=true;
        }
      }
    }
    if (existCon) {
      if (viewObj instanceof FolderRepositoryObject || viewObj instanceof WSRootRepositoryObject) {
        List<IRepositoryViewObject> objList=null;
        if (viewObj instanceof FolderRepositoryObject) {
          objList=((FolderRepositoryObject)viewObj).getChildren();
        }
        if (viewObj instanceof WSRootRepositoryObject) {
          objList=((WSRootRepositoryObject)viewObj).getChildren();
        }
        for (        IRepositoryViewObject vobject : objList) {
          Item itm=vobject.getProperty().getItem();
          if (itm instanceof MDMServerObjectItem) {
            MDMServerObject serverObject=((MDMServerObjectItem)itm).getMDMServerObject();
            if (serverObject.getLastServerDef() == null || serverObject.isChanged() || serverObject.isCreated()) {
              if (serverObject.getLastServerDef() != null) {
                defNames.add(serverObject.getLastServerDef().getName());
              }
              viewObjs.add(vobject);
            }
          }
        }
      }
    }
    List<IRepositoryViewObject> objList=null;
    if (viewObj instanceof FolderRepositoryObject) {
      objList=((FolderRepositoryObject)viewObj).getChildren();
    }
    if (viewObj instanceof WSRootRepositoryObject) {
      objList=((WSRootRepositoryObject)viewObj).getChildren();
    }
    for (    IRepositoryViewObject child : objList) {
      if (child instanceof FolderRepositoryObject || child instanceof WSRootRepositoryObject) {
        findFromContainer(child,viewObjs);
      }
 else {
        Item item=child.getProperty().getItem();
        if (!isButton) {
          List<Object> selectedObject=getSelectedObject();
          boolean exist=false;
          for (          Object obj : selectedObject) {
            if (obj instanceof IRepositoryViewObject) {
              IRepositoryViewObject vobject=(IRepositoryViewObject)obj;
              if (child == vobject) {
                exist=true;
              }
            }
          }
          if (!exist)           continue;
        }
        if (item instanceof MDMServerObjectItem) {
          MDMServerObject serverObject=((MDMServerObjectItem)item).getMDMServerObject();
          if (serverObject.getLastServerDef() == null || serverObject.isChanged() || serverObject.isCreated()) {
            if (serverObject.getLastServerDef() != null) {
              defNames.add(serverObject.getLastServerDef().getName());
            }
            viewObjs.add(child);
          }
        }
      }
    }
  }
  IS_DEPLOYALL_FLAG=true;
}