Program: 121290
Project: 121290
Buggy source:
private void openXtextEditor(RepositoryNode repositoryNode,IProject fsProject,boolean readonly){
  try {
    if (ProjectManager.getInstance().isInCurrentMainProject(repositoryNode)) {
      IFile linkedFile=createWorkspaceLink(fsProject,fsProject.getFolder(ERepositoryObjectType.getFolderName(ERepositoryObjectType.JOB_SCRIPT)).getFolder(repositoryNode.getParent().toString()).getFile(repositoryNode.getObject().getProperty().getLabel()).getLocation(),repositoryNode.getObject().getProperty().getVersion());
      IWorkbenchPage page=getActivePage();
      IEditorPart editor=IDE.openEditor(page,linkedFile);
      if (readonly) {
        IDocumentProvider provider=((AbstractDecoratedTextEditor)editor).getDocumentProvider();
        Class p=provider.getClass();
        Class[] type=new Class[1];
        type[0]=Boolean.TYPE;
        Object[] para=new Object[1];
        para[0]=Boolean.TRUE;
        Method method=p.getMethod("String_Node_Str",type);
        method.invoke(provider,para);
      }
    }
 else {
      JobScriptItem jobScriptItem=(JobScriptItem)repositoryNode.getObject().getProperty().getItem();
      IFile file=ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(jobScriptItem.eResource().getURI().path()).removeFirstSegments(1).removeFileExtension());
      IFile linkedFile=createWorkspaceLink(fsProject,file.getLocation(),"String_Node_Str");
      IWorkbenchPage page=getActivePage();
      IEditorPart editor=IDE.openEditor(page,linkedFile);
      if (readonly) {
        IDocumentProvider provider=((AbstractDecoratedTextEditor)editor).getDocumentProvider();
        Class p=provider.getClass();
        Class[] type=new Class[1];
        type[0]=Boolean.TYPE;
        Object[] para=new Object[1];
        para[0]=Boolean.TRUE;
        Method method=p.getMethod("String_Node_Str",type);
        method.invoke(provider,para);
      }
    }
  }
 catch (  CoreException e) {
    ExceptionHandler.process(e);
  }
catch (  SecurityException e) {
    ExceptionHandler.process(e);
  }
catch (  NoSuchMethodException e) {
    ExceptionHandler.process(e);
  }
catch (  IllegalArgumentException e) {
    ExceptionHandler.process(e);
  }
catch (  IllegalAccessException e) {
    ExceptionHandler.process(e);
  }
catch (  InvocationTargetException e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
private void openXtextEditor(RepositoryNode repositoryNode,IProject fsProject,boolean readonly){
  try {
    if (ProjectManager.getInstance().isInCurrentMainProject(repositoryNode)) {
      IFile linkedFile=createWorkspaceLink(fsProject,fsProject.getFolder(ERepositoryObjectType.getFolderName(ERepositoryObjectType.JOB_SCRIPT)).getFolder(repositoryNode.getParent().getRepositoryPath()).getFile(repositoryNode.getObject().getProperty().getLabel()).getLocation(),repositoryNode.getObject().getProperty().getVersion());
      IWorkbenchPage page=getActivePage();
      IEditorPart editor=IDE.openEditor(page,linkedFile);
      if (readonly) {
        IDocumentProvider provider=((AbstractDecoratedTextEditor)editor).getDocumentProvider();
        Class p=provider.getClass();
        Class[] type=new Class[1];
        type[0]=Boolean.TYPE;
        Object[] para=new Object[1];
        para[0]=Boolean.TRUE;
        Method method=p.getMethod("String_Node_Str",type);
        method.invoke(provider,para);
      }
    }
 else {
      JobScriptItem jobScriptItem=(JobScriptItem)repositoryNode.getObject().getProperty().getItem();
      IFile file=ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(jobScriptItem.eResource().getURI().path()).removeFirstSegments(1).removeFileExtension());
      IFile linkedFile=createWorkspaceLink(fsProject,file.getLocation(),"String_Node_Str");
      IWorkbenchPage page=getActivePage();
      IEditorPart editor=IDE.openEditor(page,linkedFile);
      if (readonly) {
        IDocumentProvider provider=((AbstractDecoratedTextEditor)editor).getDocumentProvider();
        Class p=provider.getClass();
        Class[] type=new Class[1];
        type[0]=Boolean.TYPE;
        Object[] para=new Object[1];
        para[0]=Boolean.TRUE;
        Method method=p.getMethod("String_Node_Str",type);
        method.invoke(provider,para);
      }
    }
  }
 catch (  CoreException e) {
    ExceptionHandler.process(e);
  }
catch (  SecurityException e) {
    ExceptionHandler.process(e);
  }
catch (  NoSuchMethodException e) {
    ExceptionHandler.process(e);
  }
catch (  IllegalArgumentException e) {
    ExceptionHandler.process(e);
  }
catch (  IllegalAccessException e) {
    ExceptionHandler.process(e);
  }
catch (  InvocationTargetException e) {
    ExceptionHandler.process(e);
  }
}