Program: 133336
Project: 133336
Buggy source:
/** 
 * Updates the Resource Page's widgets to render the specified Resource. <p> <b>Note:</b> This method assumes it is called from the UI thread. </p>
 * @param resource The resource to render. Assumed not to be  {@code null}.
 * @throws PartInitException
 */
public void showResource(ICEResource resource) throws PartInitException {
  if (resource == null) {
    Control topControl=stackLayout.topControl;
    if (topControl != browser) {
      browser.setText("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
      stackLayout.topControl=browser;
      pageComposite.layout();
      if (topControl != null && !topControl.isDisposed()) {
        topControl.dispose();
      }
    }
    return;
  }
  boolean useBrowser=!(resource instanceof VizResource);
  if (!useBrowser) {
    try {
      if (plotGridComposite.addPlot(resource.getPath()) != -1) {
        stackLayout.topControl=plotGridComposite;
        pageComposite.layout();
        activateEditor();
        return;
      }
    }
 catch (    Exception e) {
      logger.error(getClass().getName() + "String_Node_Str",e);
    }
  }
  String path=resource.getPath().toString();
  int extIndex=path.lastIndexOf("String_Node_Str");
  String fileExtension=path.substring(extIndex + 1);
  boolean useEditor=textFileExtensions.contains(fileExtension);
  if (useEditor) {
    IFileStore fileOnLocalDisk=EFS.getLocalFileSystem().getStore(resource.getPath());
    FileStoreEditorInput editorInput=new FileStoreEditorInput(fileOnLocalDisk);
    IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    IWorkbenchPage page=window.getActivePage();
    page.openEditor(editorInput,"String_Node_Str");
  }
  if (useBrowser && !useEditor && browser != null && !browser.isDisposed()) {
    browser.setUrl(path);
    stackLayout.topControl=browser;
    pageComposite.layout();
    activateEditor();
  }
  return;
}

Fixed version (ground truth):
/** 
 * Updates the Resource Page's widgets to render the specified Resource. <p> <b>Note:</b> This method assumes it is called from the UI thread. </p>
 * @param resource The resource to render. Assumed not to be  {@code null}.
 * @throws PartInitException
 */
public void showResource(ICEResource resource) throws PartInitException {
  if (resource == null) {
    Control topControl=stackLayout.topControl;
    if (topControl != browser) {
      if (browser != null && !browser.isDisposed()) {
        browser.setText("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
        stackLayout.topControl=browser;
        pageComposite.layout();
      }
 else {
        Label label=new Label(pageComposite,SWT.CENTER);
        label.setText("String_Node_Str");
        stackLayout.topControl=label;
      }
      if (topControl != null && !topControl.isDisposed()) {
        topControl.dispose();
      }
    }
    return;
  }
  boolean useBrowser=!(resource instanceof VizResource);
  if (!useBrowser) {
    try {
      if (plotGridComposite.addPlot(resource.getPath()) != -1) {
        stackLayout.topControl=plotGridComposite;
        pageComposite.layout();
        activateEditor();
        return;
      }
    }
 catch (    Exception e) {
      logger.error(getClass().getName() + "String_Node_Str",e);
    }
  }
  String path=resource.getPath().toString();
  int extIndex=path.lastIndexOf("String_Node_Str");
  String fileExtension=path.substring(extIndex + 1);
  boolean useEditor=textFileExtensions.contains(fileExtension);
  if (useEditor) {
    IFileStore fileOnLocalDisk=EFS.getLocalFileSystem().getStore(resource.getPath());
    FileStoreEditorInput editorInput=new FileStoreEditorInput(fileOnLocalDisk);
    IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    IWorkbenchPage page=window.getActivePage();
    page.openEditor(editorInput,"String_Node_Str");
  }
  if (useBrowser && !useEditor && browser != null && !browser.isDisposed()) {
    browser.setUrl(path);
    stackLayout.topControl=browser;
    pageComposite.layout();
    activateEditor();
  }
  return;
}