Program: 123758
Project: 123758
Buggy source:
/** 
 * Install a context parameter extracter on a text field associated with a given process.
 * @param text Component on wich extractor is installed.
 * @param process Process on wich context parameter is added.
 */
public static void installOn(final Control text,final IProcess2 process,final String parameterName,final IElement elem){
  text.addKeyListener(new KeyAdapter(){
    @SuppressWarnings("String_Node_Str") @Override public void keyPressed(    KeyEvent e){
      if (e.keyCode == SWT.F5) {
        IContextParameter parameter=buildParameterFrom(text,process.getContextManager(),parameterName);
        if (parameter == null) {
          return;
        }
        ContextParameterWizard prmWizard=new ContextParameterWizard(process.getContextManager(),parameter);
        WizardDialog dlg=new WizardDialog(text.getShell(),prmWizard);
        if (dlg.open() == WizardDialog.OK) {
          ECodeLanguage curLanguage=LanguageManager.getCurrentLanguage();
          String replaceCode="String_Node_Str";
          if (curLanguage == ECodeLanguage.PERL) {
            replaceCode=ContextParameterUtils.getScriptCode(parameter,((RepositoryContext)CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getProject().getLanguage());
          }
 else {
            replaceCode=ContextParameterUtils.getNewScriptCode(parameter.getName(),curLanguage);
          }
          if (text instanceof Text) {
            if (((Text)text).getSelectionCount() == 0) {
              ((Text)text).setText(replaceCode);
            }
 else {
              ((Text)text).insert(replaceCode);
            }
            saveContext(parameterName,elem,((Text)text).getText(),process);
          }
 else {
            if (text instanceof StyledText) {
              if (((StyledText)text).getSelectionCount() == 0) {
                ((StyledText)text).setText(replaceCode);
              }
 else {
                ((StyledText)text).insert(replaceCode);
              }
              saveContext(parameterName,elem,((StyledText)text).getText(),process);
            }
          }
        }
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Install a context parameter extracter on a text field associated with a given process.
 * @param text Component on wich extractor is installed.
 * @param process Process on wich context parameter is added.
 */
public static void installOn(final Control text,final IProcess2 process,final String parameterName,final IElement elem){
  text.addKeyListener(new KeyAdapter(){
    @SuppressWarnings("String_Node_Str") @Override public void keyPressed(    KeyEvent e){
      if (e.keyCode == SWT.F5) {
        if (process == null) {
          return;
        }
        IContextParameter parameter=buildParameterFrom(text,process.getContextManager(),parameterName);
        if (parameter == null) {
          return;
        }
        ContextParameterWizard prmWizard=new ContextParameterWizard(process.getContextManager(),parameter);
        WizardDialog dlg=new WizardDialog(text.getShell(),prmWizard);
        if (dlg.open() == WizardDialog.OK) {
          ECodeLanguage curLanguage=LanguageManager.getCurrentLanguage();
          String replaceCode="String_Node_Str";
          if (curLanguage == ECodeLanguage.PERL) {
            replaceCode=ContextParameterUtils.getScriptCode(parameter,((RepositoryContext)CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getProject().getLanguage());
          }
 else {
            replaceCode=ContextParameterUtils.getNewScriptCode(parameter.getName(),curLanguage);
          }
          if (text instanceof Text) {
            if (((Text)text).getSelectionCount() == 0) {
              ((Text)text).setText(replaceCode);
            }
 else {
              ((Text)text).insert(replaceCode);
            }
            saveContext(parameterName,elem,((Text)text).getText(),process);
          }
 else {
            if (text instanceof StyledText) {
              if (((StyledText)text).getSelectionCount() == 0) {
                ((StyledText)text).setText(replaceCode);
              }
 else {
                ((StyledText)text).insert(replaceCode);
              }
              saveContext(parameterName,elem,((StyledText)text).getText(),process);
            }
          }
        }
      }
    }
  }
);
}