Program: 123611
Project: 123611
Buggy source:
@Override public void run(){
  SaveAsSQLPatternWizard processWizard=new SaveAsSQLPatternWizard(editorPart);
  WizardDialog dlg=new WizardDialog(Display.getCurrent().getActiveShell(),processWizard);
  if (dlg.open() == Window.OK) {
    try {
      RepositoryManager.refreshCreatedNode(ERepositoryObjectType.SQLPATTERNS);
      SQLPatternItem sqlpatternItem=processWizard.getSQLPatternItem();
      ICodeGeneratorService service=(ICodeGeneratorService)GlobalServiceRegister.getDefault().getService(ICodeGeneratorService.class);
      ISQLPatternSynchronizer sqlPatternSynchronizer=service.getSQLPatternSynchronizer();
      IFile file=sqlPatternSynchronizer.getSQLPatternFile(sqlpatternItem);
      RepositoryEditorInput repositoryEditorInput=new RepositoryEditorInput(file,sqlpatternItem);
      IWorkbenchPage page=getActivePage();
      IRepositoryNode repositoryNode=RepositoryNodeUtilities.getRepositoryNode(repositoryEditorInput.getItem().getProperty().getId(),false);
      repositoryEditorInput.setRepositoryNode(repositoryNode);
      IDocumentProvider provider=((StandAloneTalendJavaEditor)this.editorPart).getDocumentProvider();
      provider.aboutToChange(repositoryEditorInput);
      provider.saveDocument(null,repositoryEditorInput,provider.getDocument(this.editorPart.getEditorInput()),true);
      provider.changed(repositoryEditorInput);
      ByteArray byteArray=sqlpatternItem.getContent();
      byteArray.setInnerContentFromFile(repositoryEditorInput.getFile());
      IProxyRepositoryFactory repFactory=DesignerPlugin.getDefault().getRepositoryService().getProxyRepositoryFactory();
      repFactory.save(sqlpatternItem);
      page.closeEditor(this.editorPart,false);
      page.openEditor(repositoryEditorInput,StandAloneTalendJavaEditor.ID,true);
    }
 catch (    Exception e) {
      MessageDialog.openError(Display.getCurrent().getActiveShell(),"String_Node_Str","String_Node_Str" + "String_Node_Str" + e.getMessage());
      ExceptionHandler.process(e);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  SaveAsSQLPatternWizard processWizard=new SaveAsSQLPatternWizard(editorPart);
  WizardDialog dlg=new WizardDialog(Display.getCurrent().getActiveShell(),processWizard);
  if (dlg.open() == Window.OK) {
    try {
      SQLPatternItem sqlpatternItem=processWizard.getSQLPatternItem();
      ICodeGeneratorService service=(ICodeGeneratorService)GlobalServiceRegister.getDefault().getService(ICodeGeneratorService.class);
      ISQLPatternSynchronizer sqlPatternSynchronizer=service.getSQLPatternSynchronizer();
      IFile file=sqlPatternSynchronizer.getSQLPatternFile(sqlpatternItem);
      RepositoryEditorInput repositoryEditorInput=new RepositoryEditorInput(file,sqlpatternItem);
      IWorkbenchPage page=getActivePage();
      IRepositoryNode repositoryNode=RepositoryNodeUtilities.getRepositoryNode(repositoryEditorInput.getItem().getProperty().getId(),false);
      repositoryEditorInput.setRepositoryNode(repositoryNode);
      IDocumentProvider provider=((StandAloneTalendJavaEditor)this.editorPart).getDocumentProvider();
      provider.aboutToChange(repositoryEditorInput);
      provider.saveDocument(null,repositoryEditorInput,provider.getDocument(this.editorPart.getEditorInput()),true);
      provider.changed(repositoryEditorInput);
      ByteArray byteArray=sqlpatternItem.getContent();
      byteArray.setInnerContentFromFile(repositoryEditorInput.getFile());
      IProxyRepositoryFactory repFactory=DesignerPlugin.getDefault().getRepositoryService().getProxyRepositoryFactory();
      repFactory.save(sqlpatternItem);
      page.closeEditor(this.editorPart,false);
      page.openEditor(repositoryEditorInput,StandAloneTalendJavaEditor.ID,true);
    }
 catch (    Exception e) {
      MessageDialog.openError(Display.getCurrent().getActiveShell(),"String_Node_Str","String_Node_Str" + "String_Node_Str" + e.getMessage());
      ExceptionHandler.process(e);
    }
  }
}