Program: 138867
Project: 138867
Buggy source:
@SuppressWarnings("String_Node_Str") public static TypedReturnCode<TableNode> findSqlExplorerTableNode(Connection providerConnection,Package parentPackageElement,String tableName,String activeTabName){
  new ChangePerspectiveAction(PluginConstant.SE_ID).run();
  Collection<Alias> aliases=SQLExplorerPlugin.getDefault().getAliasManager().getAliases();
  String url=ConnectionUtils.getURL(providerConnection);
  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;
    }
  }
  Shell shell=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
  if (currentUser == null) {
    MessageDialog.openWarning(shell,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str") + tableName);
    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();
  Catalog doSwitch=SwitchHelpers.CATALOG_SWITCH.doSwitch(parentPackageElement);
  INode catalogOrSchemaNode=null;
  if (doSwitch != null) {
    if (catalogs.size() != 0) {
      for (      INode catalogNode : catalogs) {
        if (parentPackageElement.getName().equalsIgnoreCase(catalogNode.getName())) {
          catalogOrSchemaNode=catalogNode;
          break;
        }
      }
    }
 else     catalogOrSchemaNode=root;
  }
 else {
    for (    INode schemaNode : schemas) {
      if (parentPackageElement.getName().equalsIgnoreCase(schemaNode.getName())) {
        catalogOrSchemaNode=schemaNode;
        break;
      }
    }
  }
  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);
      DetailTabManager.setActiveTabName(activeTabName);
      DatabaseStructureView dsView=SQLExplorerPlugin.getDefault().getDatabaseStructureView();
      dsView.setSessionSelectionNode(currentUser.getMetaDataSession(),new StructuredSelection(node));
      SQLExplorerPlugin.getDefault().getConnectionsView().getTreeViewer().setSelection(new StructuredSelection(currentUser));
      return typedReturnCode;
    }
  }
  MessageDialog.openWarning(shell,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str") + tableName);
  return new TypedReturnCode<TableNode>(DefaultMessagesImpl.getString("String_Node_Str",tableName),false);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static TypedReturnCode<TableNode> findSqlExplorerTableNode(Connection providerConnection,Package parentPackageElement,String tableName,String activeTabName){
  new ChangePerspectiveAction(PluginConstant.SE_ID).run();
  Collection<Alias> aliases=SQLExplorerPlugin.getDefault().getAliasManager().getAliases();
  String url=ConnectionUtils.getURL(providerConnection);
  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;
    }
  }
  Shell shell=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
  if (currentUser == null) {
    MessageDialog.openWarning(shell,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str") + tableName);
    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();
  Catalog doSwitch=SwitchHelpers.CATALOG_SWITCH.doSwitch(parentPackageElement);
  INode catalogOrSchemaNode=null;
  if (doSwitch != null) {
    if (catalogs.size() != 0) {
      for (      INode catalogNode : catalogs) {
        if (parentPackageElement.getName().equalsIgnoreCase(catalogNode.getName())) {
          catalogOrSchemaNode=catalogNode;
          break;
        }
      }
    }
 else     catalogOrSchemaNode=root;
  }
 else {
    for (    INode schemaNode : schemas) {
      if (parentPackageElement.getName().equalsIgnoreCase(schemaNode.getName())) {
        catalogOrSchemaNode=schemaNode;
        break;
      }
    }
  }
  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);
      DetailTabManager.setActiveTabName(activeTabName);
      DatabaseStructureView dsView=SQLExplorerPlugin.getDefault().getDatabaseStructureView();
      dsView.setSessionSelectionNode(currentUser.getMetaDataSession(),new StructuredSelection(node));
      SQLExplorerPlugin.getDefault().getConnectionsView().getTreeViewer().setSelection(new StructuredSelection(currentUser));
      return typedReturnCode;
    }
  }
  MessageDialog.openWarning(shell,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str",tableName));
  return new TypedReturnCode<TableNode>(DefaultMessagesImpl.getString("String_Node_Str",tableName),false);
}