Program: 123610
Project: 123610
Buggy source:
@Override public void run(){
  SaveAsRoutineWizard processWizard=new SaveAsRoutineWizard(editorPart);
  WizardDialog dlg=new WizardDialog(Display.getCurrent().getActiveShell(),processWizard);
  if (dlg.open() == Window.OK) {
    try {
      RepositoryManager.refreshCreatedNode(ERepositoryObjectType.ROUTINES);
      RoutineItem routineItem=processWizard.getRoutineItem();
      ICodeGeneratorService service=(ICodeGeneratorService)GlobalServiceRegister.getDefault().getService(ICodeGeneratorService.class);
      ITalendSynchronizer routineSynchronizer=null;
switch (LanguageManager.getCurrentLanguage()) {
case JAVA:
        routineSynchronizer=service.createJavaRoutineSynchronizer();
      break;
case PERL:
    routineSynchronizer=service.createPerlRoutineSynchronizer();
  break;
default :
}
IFile file=routineSynchronizer.getFile(routineItem);
RoutineEditorInput routineEditorInput=new RoutineEditorInput(file,routineItem);
IWorkbenchPage page=getActivePage();
IRepositoryNode repositoryNode=RepositoryNodeUtilities.getRepositoryNode(routineEditorInput.getItem().getProperty().getId(),false);
routineEditorInput.setRepositoryNode(repositoryNode);
IDocumentProvider provider=((AbstractTextEditor)this.editorPart).getDocumentProvider();
provider.aboutToChange(routineEditorInput);
provider.saveDocument(null,routineEditorInput,provider.getDocument(this.editorPart.getEditorInput()),true);
provider.changed(routineEditorInput);
ByteArray byteArray=routineItem.getContent();
byteArray.setInnerContentFromFile(routineEditorInput.getFile());
IProxyRepositoryFactory repFactory=DesignerPlugin.getDefault().getRepositoryService().getProxyRepositoryFactory();
repFactory.save(routineItem);
page.closeEditor(this.editorPart,false);
switch (LanguageManager.getCurrentLanguage()) {
case JAVA:
page.openEditor(routineEditorInput,StandAloneTalendJavaEditor.ID,true);
break;
case PERL:
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerPerlService.class)) {
IDesignerPerlService perlService=(IDesignerPerlService)GlobalServiceRegister.getDefault().getService(IDesignerPerlService.class);
page.openEditor(routineEditorInput,perlService.getStandAloneTalendPerlEditorID(),true);
}
break;
default :
}
}
 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(){
  SaveAsRoutineWizard processWizard=new SaveAsRoutineWizard(editorPart);
  WizardDialog dlg=new WizardDialog(Display.getCurrent().getActiveShell(),processWizard);
  if (dlg.open() == Window.OK) {
    try {
      RoutineItem routineItem=processWizard.getRoutineItem();
      ICodeGeneratorService service=(ICodeGeneratorService)GlobalServiceRegister.getDefault().getService(ICodeGeneratorService.class);
      ITalendSynchronizer routineSynchronizer=null;
switch (LanguageManager.getCurrentLanguage()) {
case JAVA:
        routineSynchronizer=service.createJavaRoutineSynchronizer();
      break;
case PERL:
    routineSynchronizer=service.createPerlRoutineSynchronizer();
  break;
default :
}
IFile file=routineSynchronizer.getFile(routineItem);
RoutineEditorInput routineEditorInput=new RoutineEditorInput(file,routineItem);
IWorkbenchPage page=getActivePage();
IRepositoryNode repositoryNode=RepositoryNodeUtilities.getRepositoryNode(routineEditorInput.getItem().getProperty().getId(),false);
routineEditorInput.setRepositoryNode(repositoryNode);
IDocumentProvider provider=((AbstractTextEditor)this.editorPart).getDocumentProvider();
provider.aboutToChange(routineEditorInput);
provider.saveDocument(null,routineEditorInput,provider.getDocument(this.editorPart.getEditorInput()),true);
provider.changed(routineEditorInput);
ByteArray byteArray=routineItem.getContent();
byteArray.setInnerContentFromFile(routineEditorInput.getFile());
IProxyRepositoryFactory repFactory=DesignerPlugin.getDefault().getRepositoryService().getProxyRepositoryFactory();
repFactory.save(routineItem);
page.closeEditor(this.editorPart,false);
switch (LanguageManager.getCurrentLanguage()) {
case JAVA:
page.openEditor(routineEditorInput,StandAloneTalendJavaEditor.ID,true);
break;
case PERL:
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerPerlService.class)) {
IDesignerPerlService perlService=(IDesignerPerlService)GlobalServiceRegister.getDefault().getService(IDesignerPerlService.class);
page.openEditor(routineEditorInput,perlService.getStandAloneTalendPerlEditorID(),true);
}
break;
default :
}
}
 catch (Exception e) {
MessageDialog.openError(Display.getCurrent().getActiveShell(),"String_Node_Str","String_Node_Str" + "String_Node_Str" + e.getMessage());
ExceptionHandler.process(e);
}
}
}