Program: 138601
Project: 138601
Buggy source:
/** 
 * DOC bZhou Comment method "iteratedProperties".Move the method from DeleteObjectsAction.java to this class(-qiongli).
 * @param obj
 * @param propList
 * @throws Exception
 */
public void getPropertiesByObject(Object obj,Set<Property> propList) throws Exception {
  if (obj instanceof IFile) {
    IFile file=(IFile)obj;
    Property property=PropertyHelper.getProperty(file);
    if (property == null) {
      property=PropertyHelper.createTDQItemProperty();
      property.setLabel(file.getName());
      ((TDQItem)property.getItem()).setFilename(file.getFullPath().toString());
    }
    if (!property.getItem().getState().isDeleted()) {
      propList.add(property);
    }
  }
 else   if (obj instanceof IFolder) {
    IFolder folder=(IFolder)obj;
    IPath path=folder.getFullPath();
    List<IRepositoryViewObject> conList=null;
    if (ResourceManager.getConnectionFolder().getFullPath().isPrefixOf(path)) {
      path=path.makeRelativeTo(ResourceManager.getConnectionFolder().getFullPath());
      conList=ProxyRepositoryViewObject.fetchRepositoryViewObjectsByFolder(true,ERepositoryObjectType.METADATA_CONNECTIONS,path,true);
    }
 else     if (ResourceManager.getMDMConnectionFolder().getFullPath().isPrefixOf(path)) {
      path=path.makeRelativeTo(ResourceManager.getMDMConnectionFolder().getFullPath());
      conList=ProxyRepositoryViewObject.fetchRepositoryViewObjectsByFolder(true,ERepositoryObjectType.METADATA_MDMCONNECTION,path,true);
    }
    if (conList != null) {
      for (      IRepositoryViewObject repViewObj : conList) {
        Property prop=repViewObj.getProperty();
        if (!prop.getItem().getState().isDeleted())         propList.add(prop);
      }
    }
 else {
      if (!existChildFolder(propList,folder)) {
        Property property=PropertyHelper.createFolderItemProperty();
        property.getItem().getState().setPath(folder.getFullPath().toOSString());
        propList.add(property);
      }
      for (      IResource rersource : folder.members()) {
        getPropertiesByObject(rersource,propList);
      }
    }
  }
 else   if (obj instanceof IRepositoryViewObject) {
    propList.add(((IRepositoryViewObject)obj).getProperty());
  }
 else   if (obj instanceof DQRecycleBinNode) {
    Object o=((DQRecycleBinNode)obj).getObject();
    if (o instanceof Property) {
      propList.add((Property)o);
    }
 else {
      String pathStr=o.toString();
      IPath path=new Path(pathStr).removeFirstSegments(1);
      Property property=PropertyHelper.createFolderItemProperty();
      property.getItem().getState().setPath(path.toOSString());
      propList.add(property);
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "iteratedProperties".Move the method from DeleteObjectsAction.java to this class(-qiongli).
 * @param obj
 * @param propList
 * @throws Exception
 */
public void getPropertiesByObject(Object obj,Set<Property> propList) throws Exception {
  if (obj instanceof IFile) {
    IFile file=(IFile)obj;
    Property property=PropertyHelper.getProperty(file);
    if (property == null) {
      property=PropertyHelper.createTDQItemProperty();
      property.setLabel(file.getName());
      ((TDQItem)property.getItem()).setFilename(file.getFullPath().toString());
    }
    if (!property.getItem().getState().isDeleted()) {
      propList.add(property);
    }
  }
 else   if (obj instanceof IFolder) {
    IFolder folder=(IFolder)obj;
    IPath path=folder.getFullPath();
    List<IRepositoryViewObject> conList=null;
    boolean hasChild=true;
    if (folder.members().length == 0) {
      hasChild=false;
    }
    if (hasChild && ResourceManager.getConnectionFolder().getFullPath().isPrefixOf(path)) {
      path=path.makeRelativeTo(ResourceManager.getConnectionFolder().getFullPath());
      conList=ProxyRepositoryViewObject.fetchRepositoryViewObjectsByFolder(true,ERepositoryObjectType.METADATA_CONNECTIONS,path,true);
    }
 else     if (hasChild && ResourceManager.getMDMConnectionFolder().getFullPath().isPrefixOf(path)) {
      path=path.makeRelativeTo(ResourceManager.getMDMConnectionFolder().getFullPath());
      conList=ProxyRepositoryViewObject.fetchRepositoryViewObjectsByFolder(true,ERepositoryObjectType.METADATA_MDMCONNECTION,path,true);
    }
    if (conList != null) {
      for (      IRepositoryViewObject repViewObj : conList) {
        Property prop=repViewObj.getProperty();
        if (!prop.getItem().getState().isDeleted())         propList.add(prop);
      }
    }
 else {
      if (!existChildFolder(propList,folder)) {
        Property property=PropertyHelper.createFolderItemProperty();
        property.getItem().getState().setPath(folder.getFullPath().toOSString());
        propList.add(property);
      }
      for (      IResource rersource : folder.members()) {
        getPropertiesByObject(rersource,propList);
      }
    }
  }
 else   if (obj instanceof IRepositoryViewObject) {
    propList.add(((IRepositoryViewObject)obj).getProperty());
  }
 else   if (obj instanceof DQRecycleBinNode) {
    Object o=((DQRecycleBinNode)obj).getObject();
    if (o instanceof Property) {
      propList.add((Property)o);
    }
 else {
      String pathStr=o.toString();
      IPath path=new Path(pathStr).removeFirstSegments(1);
      Property property=PropertyHelper.createFolderItemProperty();
      property.getItem().getState().setPath(path.toOSString());
      propList.add(property);
    }
  }
}