Program: 139826
Project: 139826
Buggy source:
@SuppressWarnings("String_Node_Str") public static TypedReturnCode<TableNode> findSqlExplorerTableNode(TdProviderConnection providerConnection,Package parentPackageElement,String tableName,String activeTabName){
  ChangePerspectiveAction perspectiveAction=new ChangePerspectiveAction(PluginConstant.SE_ID);
  perspectiveAction.run();
  SQLExplorerPlugin default1=SQLExplorerPlugin.getDefault();
  Collection<Alias> aliases=default1.getAliasManager().getAliases();
  String url=providerConnection.getConnectionString();
  User currentUser=null;
  for (  Alias alias : aliases) {
    if (alias.getUrl().equals(url)) {
      currentUser=alias.getDefaultUser();
      OpenPasswordConnectDialogAction openDlgAction=new OpenPasswordConnectDialogAction(alias,alias.getDefaultUser(),false);
      openDlgAction.run();
      break;
    }
  }
  if (currentUser == null) {
    return new TypedReturnCode<TableNode>(DefaultMessagesImpl.getString("String_Node_Str",tableName),false);
  }
  DatabaseNode root=currentUser.getMetaDataSession().getRoot();
  root.load();
  List<INode> catalogs=root.getCatalogs();
  List<INode> schemas=root.getSchemas();
  TdCatalog doSwitch=SwitchHelpers.CATALOG_SWITCH.doSwitch(parentPackageElement);
  INode catalogOrSchemaNode=null;
  if (doSwitch != null) {
    for (    INode catalogNode : catalogs) {
      if (parentPackageElement.getName().equalsIgnoreCase(catalogNode.getName())) {
        catalogOrSchemaNode=catalogNode;
        break;
      }
    }
  }
 else {
    for (    INode schemaNode : schemas) {
      if (parentPackageElement.getName().equalsIgnoreCase(schemaNode.getName())) {
        catalogOrSchemaNode=schemaNode;
      }
    }
  }
  INode[] childNodes=catalogOrSchemaNode.getChildNodes();
  TableFolderNode tableFolderNode=null;
  for (  INode node : childNodes) {
    if ("String_Node_Str".equals(node.getQualifiedName())) {
      tableFolderNode=(TableFolderNode)node;
      break;
    }
  }
  INode[] tableNodes=tableFolderNode.getChildNodes();
  for (  INode node : tableNodes) {
    if (tableName.equalsIgnoreCase(node.getName())) {
      TypedReturnCode<TableNode> typedReturnCode=new TypedReturnCode<TableNode>(null,true);
      typedReturnCode.setObject((TableNode)node);
      DatabaseStructureView dsView=SQLExplorerPlugin.getDefault().getDatabaseStructureView();
      dsView.setSessionSelectionNode(currentUser.getMetaDataSession(),new StructuredSelection(node));
      DetailTabManager.setActiveTabName(activeTabName);
      return typedReturnCode;
    }
  }
  return new TypedReturnCode<TableNode>(DefaultMessagesImpl.getString("String_Node_Str",tableName),false);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static TypedReturnCode<TableNode> findSqlExplorerTableNode(TdProviderConnection providerConnection,Package parentPackageElement,String tableName,String activeTabName){
  new ChangePerspectiveAction(PluginConstant.SE_ID).run();
  SQLExplorerPlugin default1=SQLExplorerPlugin.getDefault();
  Collection<Alias> aliases=default1.getAliasManager().getAliases();
  String url=providerConnection.getConnectionString();
  User currentUser=null;
  for (  Alias alias : aliases) {
    if (alias.getUrl().equals(url)) {
      currentUser=alias.getDefaultUser();
      OpenPasswordConnectDialogAction openDlgAction=new OpenPasswordConnectDialogAction(alias,alias.getDefaultUser(),false);
      openDlgAction.run();
      break;
    }
  }
  if (currentUser == null) {
    return new TypedReturnCode<TableNode>(DefaultMessagesImpl.getString("String_Node_Str",tableName),false);
  }
  DatabaseNode root=currentUser.getMetaDataSession().getRoot();
  root.load();
  List<INode> catalogs=root.getCatalogs();
  List<INode> schemas=root.getSchemas();
  TdCatalog doSwitch=SwitchHelpers.CATALOG_SWITCH.doSwitch(parentPackageElement);
  INode catalogOrSchemaNode=null;
  if (doSwitch != null) {
    for (    INode catalogNode : catalogs) {
      if (parentPackageElement.getName().equalsIgnoreCase(catalogNode.getName())) {
        catalogOrSchemaNode=catalogNode;
        break;
      }
    }
  }
 else {
    for (    INode schemaNode : schemas) {
      if (parentPackageElement.getName().equalsIgnoreCase(schemaNode.getName())) {
        catalogOrSchemaNode=schemaNode;
      }
    }
  }
  INode[] childNodes=catalogOrSchemaNode.getChildNodes();
  TableFolderNode tableFolderNode=null;
  for (  INode node : childNodes) {
    if ("String_Node_Str".equals(node.getQualifiedName())) {
      tableFolderNode=(TableFolderNode)node;
      break;
    }
  }
  INode[] tableNodes=tableFolderNode.getChildNodes();
  for (  INode node : tableNodes) {
    if (tableName.equalsIgnoreCase(node.getName())) {
      TypedReturnCode<TableNode> typedReturnCode=new TypedReturnCode<TableNode>(null,true);
      typedReturnCode.setObject((TableNode)node);
      DatabaseStructureView dsView=SQLExplorerPlugin.getDefault().getDatabaseStructureView();
      dsView.setSessionSelectionNode(currentUser.getMetaDataSession(),new StructuredSelection(node));
      DetailTabManager.setActiveTabName(activeTabName);
      return typedReturnCode;
    }
  }
  return new TypedReturnCode<TableNode>(DefaultMessagesImpl.getString("String_Node_Str",tableName),false);
}