Program: 69711
Project: 69711
Buggy source:
/** 
 * Opens an editor on the specified library file, and refresh the specified library explorer page.
 * @param viewer the library explorer page
 * @param file the specified library to open.
 */
public static void openLibrary(final LibraryExplorerTreeViewPage viewer,final File file,final boolean forceRefresh){
  if (file == null || !file.exists() || !file.isFile()) {
    return;
  }
  Display display;
  if (viewer != null) {
    display=viewer.getSite().getShell().getDisplay();
  }
 else {
    display=Display.getCurrent();
  }
  display.asyncExec(new Runnable(){
    public void run(){
      try {
        IWorkbench workbench=PlatformUI.getWorkbench();
        IWorkbenchWindow window=workbench == null ? null : workbench.getActiveWorkbenchWindow();
        IWorkbenchPage page=window == null ? null : window.getActivePage();
        if (page != null) {
          IEditorInput input=null;
          Object adapter=Platform.getAdapterManager().getAdapter(viewer,IPathEditorInputFactory.class);
          if (adapter instanceof IPathEditorInputFactory) {
            input=((IPathEditorInputFactory)adapter).create(new Path(file.getAbsolutePath()));
          }
          if (input == null) {
            input=new ReportEditorInput(file);
          }
          page.openEditor(input,IReportEditorContants.LIBRARY_EDITOR_ID,true);
        }
      }
 catch (      PartInitException e) {
        ExceptionHandler.handle(e);
      }
 finally {
        viewer.selectPath(new String[]{file.getAbsolutePath()},forceRefresh);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Opens an editor on the specified library file, and refresh the specified library explorer page.
 * @param viewer the library explorer page
 * @param file the specified library to open.
 */
public static void openLibrary(final LibraryExplorerTreeViewPage viewer,final File file,final boolean forceRefresh){
  if (file == null || !file.exists() || !file.isFile()) {
    return;
  }
  Display display;
  if (viewer != null) {
    display=viewer.getSite().getShell().getDisplay();
  }
 else {
    display=Display.getCurrent();
  }
  display.asyncExec(new Runnable(){
    public void run(){
      try {
        IWorkbench workbench=PlatformUI.getWorkbench();
        IWorkbenchWindow window=workbench == null ? null : workbench.getActiveWorkbenchWindow();
        IWorkbenchPage page=window == null ? null : window.getActivePage();
        if (page != null) {
          IEditorInput input=null;
          Object adapter=Platform.getAdapterManager().getAdapter(viewer,IPathEditorInputFactory.class);
          if (adapter instanceof IPathEditorInputFactory) {
            input=((IPathEditorInputFactory)adapter).create(new Path(file.getAbsolutePath()));
            IFile file=(IFile)input.getAdapter(IFile.class);
            if (file != null) {
              try {
                file.refreshLocal(IResource.DEPTH_INFINITE,null);
              }
 catch (              CoreException e) {
              }
            }
          }
          if (input == null) {
            input=new ReportEditorInput(file);
          }
          page.openEditor(input,IReportEditorContants.LIBRARY_EDITOR_ID,true);
        }
      }
 catch (      PartInitException e) {
        ExceptionHandler.handle(e);
      }
 finally {
        viewer.selectPath(new String[]{file.getAbsolutePath()},forceRefresh);
      }
    }
  }
);
}