Program: 123587
Project: 123587
Buggy source:
private void expandRoot(RepositoryNode node){
  ERepositoryObjectType objectType=node.getObjectType();
  if (ERepositoryObjectType.FOLDER.equals(objectType)) {
    RepositoryNode rootNode=getParentNodeNotFolder(node);
    objectType=rootNode.getContentType();
  }
  if (objectType == null) {
    objectType=node.getContentType();
  }
  if (objectType != null) {
    if (objectType == ERepositoryObjectType.METADATA_CON_TABLE || objectType == ERepositoryObjectType.METADATA_CON_VIEW || objectType == ERepositoryObjectType.METADATA_CON_SYNONYM || objectType == ERepositoryObjectType.METADATA_CON_QUERY || objectType == ERepositoryObjectType.METADATA_CONNECTIONS || objectType == ERepositoryObjectType.METADATA_FILE_DELIMITED || objectType == ERepositoryObjectType.METADATA_FILE_POSITIONAL || objectType == ERepositoryObjectType.METADATA_FILE_REGEXP || objectType == ERepositoryObjectType.METADATA_FILE_XML || objectType == ERepositoryObjectType.METADATA_FILE_LDIF || objectType == ERepositoryObjectType.METADATA_FILE_EXCEL || objectType == ERepositoryObjectType.METADATA_GENERIC_SCHEMA || objectType == ERepositoryObjectType.METADATA_LDAP_SCHEMA || objectType == ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA || objectType == ERepositoryObjectType.METADATA_WSDL_SCHEMA || objectType == ERepositoryObjectType.METADATA_FILE_EBCDIC || objectType == ERepositoryObjectType.METADATA_FILE_HL7 || objectType == ERepositoryObjectType.METADATA_MDMCONNECTION || objectType == ERepositoryObjectType.METADATA_FILE_RULES || objectType == ERepositoryObjectType.METADATA_SAPCONNECTIONS || objectType == ERepositoryObjectType.METADATA_SAP_FUNCTION || objectType == ERepositoryObjectType.METADATA_SAP_IDOC || objectType == ERepositoryObjectType.METADATA_HEADER_FOOTER) {
      objectType=ERepositoryObjectType.METADATA;
    }
 else     if (objectType == ERepositoryObjectType.ROUTINES || objectType == ERepositoryObjectType.SNIPPETS) {
      objectType=ERepositoryObjectType.ROUTINES;
    }
 else     if (objectType == ERepositoryObjectType.DOCUMENTATION || objectType == ERepositoryObjectType.JOB_DOC || objectType == ERepositoryObjectType.JOBLET_DOC) {
      objectType=ERepositoryObjectType.DOCUMENTATION;
    }
  }
  if (objectType != null) {
    CheckboxTreeViewer exportItemsTreeViewer=getItemsTreeViewer();
    final IContentProvider contentProvider=exportItemsTreeViewer.getContentProvider();
    if (contentProvider instanceof RepositoryContentProvider) {
      ProjectRepositoryNode root=((RepositoryContentProvider)contentProvider).getRoot();
      RepositoryNode rootRepositoryNode=root.getRootRepositoryNode(objectType);
      if (rootRepositoryNode != null && (objectType == ERepositoryObjectType.METADATA || objectType == ERepositoryObjectType.ROUTINES || objectType == ERepositoryObjectType.DOCUMENTATION)) {
        exportItemsTreeViewer.expandToLevel(rootRepositoryNode,2);
      }
    }
  }
}

Fixed version (ground truth):
private void expandRoot(RepositoryNode node){
  ERepositoryObjectType objectType=node.getObjectType();
  if (ERepositoryObjectType.FOLDER.equals(objectType)) {
    RepositoryNode rootNode=getParentNodeNotFolder(node);
    objectType=rootNode.getContentType();
  }
  if (objectType == null) {
    objectType=node.getContentType();
  }
  if (objectType != null) {
    if (objectType == ERepositoryObjectType.METADATA_CON_TABLE || objectType == ERepositoryObjectType.METADATA_CON_VIEW || objectType == ERepositoryObjectType.METADATA_CON_SYNONYM || objectType == ERepositoryObjectType.METADATA_CON_QUERY || objectType == ERepositoryObjectType.METADATA_CONNECTIONS || objectType == ERepositoryObjectType.METADATA_FILE_DELIMITED || objectType == ERepositoryObjectType.METADATA_FILE_POSITIONAL || objectType == ERepositoryObjectType.METADATA_FILE_REGEXP || objectType == ERepositoryObjectType.METADATA_FILE_XML || objectType == ERepositoryObjectType.METADATA_FILE_LDIF || objectType == ERepositoryObjectType.METADATA_FILE_EXCEL || objectType == ERepositoryObjectType.METADATA_GENERIC_SCHEMA || objectType == ERepositoryObjectType.METADATA_LDAP_SCHEMA || objectType == ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA || objectType == ERepositoryObjectType.METADATA_WSDL_SCHEMA || objectType == ERepositoryObjectType.METADATA_FILE_EBCDIC || objectType == ERepositoryObjectType.METADATA_FILE_HL7 || objectType == ERepositoryObjectType.METADATA_MDMCONNECTION || objectType == ERepositoryObjectType.METADATA_FILE_RULES || objectType == ERepositoryObjectType.METADATA_SAPCONNECTIONS || objectType == ERepositoryObjectType.METADATA_SAP_FUNCTION || objectType == ERepositoryObjectType.METADATA_SAP_IDOC || objectType == ERepositoryObjectType.METADATA_HEADER_FOOTER) {
      objectType=ERepositoryObjectType.METADATA;
    }
 else     if (objectType == ERepositoryObjectType.ROUTINES || objectType == ERepositoryObjectType.SNIPPETS) {
      objectType=ERepositoryObjectType.ROUTINES;
    }
 else     if (objectType == ERepositoryObjectType.DOCUMENTATION || objectType == ERepositoryObjectType.JOB_DOC || objectType == ERepositoryObjectType.JOBLET_DOC) {
      objectType=ERepositoryObjectType.DOCUMENTATION;
    }
  }
  if (objectType != null) {
    CheckboxTreeViewer exportItemsTreeViewer=getItemsTreeViewer();
    if (objectType == ERepositoryObjectType.METADATA || objectType == ERepositoryObjectType.ROUTINES || objectType == ERepositoryObjectType.DOCUMENTATION) {
      RepositoryNode rootRepositoryNode=ProjectRepositoryNode.getInstance().getRootRepositoryNode(objectType);
      if (rootRepositoryNode != null) {
        exportItemsTreeViewer.expandToLevel(rootRepositoryNode,2);
      }
    }
  }
}