Program: 122773
Project: 122773
Buggy source:
private void useMockJob(){
  final IElementParameter switchParam=elem.getElementParameter(EParameterName.REPOSITORY_ALLOW_AUTO_SWITCH.getName());
  final Shell parentShell=this.composite.getShell();
  final Node inputNode=(Node)this.curParameter.getElement();
  if (connParameters == null) {
    initConnectionParameters();
  }
  final String tmpMemoSql=this.memoSQL;
  final DatabaseConnection connt=TracesConnectionUtils.createConnection(connParameters);
  IMetadataConnection iMetadataConnection=null;
  boolean isStatus=false;
  try {
    if (connt != null) {
      iMetadataConnection=ConvertionHelper.convert(connt);
      isStatus=checkConnection(iMetadataConnection);
    }
    if (isStatus) {
      if (EDatabaseTypeName.GENERAL_JDBC.getDisplayName().equals(iMetadataConnection.getDbType())) {
        info=new DbInfo(iMetadataConnection.getDbType(),iMetadataConnection.getUsername(),iMetadataConnection.getPassword(),iMetadataConnection.getDbVersionString(),iMetadataConnection.getUrl(),iMetadataConnection.getDriverClass(),iMetadataConnection.getDriverJarPath(),iMetadataConnection.getAdditionalParams());
      }
 else {
        info=new DbInfo(iMetadataConnection.getDbType(),iMetadataConnection.getUsername(),iMetadataConnection.getPassword(),iMetadataConnection.getDbVersionString(),iMetadataConnection.getUrl(),iMetadataConnection.getDriverJarPath());
      }
      final Property property=(Property)GuessSchemaProcess.getNewmockProperty();
      List<IContext> allcontexts=inputNode.getProcess().getContextManager().getListContext();
      OpenContextChooseComboDialog dialog=new OpenContextChooseComboDialog(parentShell,allcontexts);
      dialog.create();
      dialog.getShell().setText(CONTEXT_CHOOSE_DIALOG_TITLE);
      IContext selectContext=null;
      if (allcontexts.size() == 1 || TalendTextUtils.isCommonString(tmpMemoSql)) {
        selectContext=inputNode.getProcess().getContextManager().getDefaultContext();
      }
 else       if (Window.OK == dialog.open()) {
        selectContext=dialog.getSelectedContext();
      }
      final IContext context=selectContext;
      if (context != null) {
        final ProgressMonitorDialog pmd=new ProgressMonitorDialog(this.composite.getShell());
        pmd.run(true,true,new IRunnableWithProgress(){
          public void run(          IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
            Display.getDefault().asyncExec(new Runnable(){
              public void run(){
                runShadowProcess(property,inputNode,context,switchParam);
              }
            }
);
          }
        }
);
      }
    }
 else {
      Display.getDefault().asyncExec(new Runnable(){
        public void run(){
          String pid="String_Node_Str";
          String mainMsg=Messages.getString("String_Node_Str");
          ErrorDialogWithDetailAreaAndContinueButton dialog=new ErrorDialogWithDetailAreaAndContinueButton(composite.getShell(),pid,mainMsg,connParameters.getConnectionComment());
          if (dialog.getCodeOfButton() == Window.OK) {
            openParamemerDialog(composite.getShell(),part.getProcess().getContextManager());
          }
        }
      }
);
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
private void useMockJob(){
  final IElementParameter switchParam=elem.getElementParameter(EParameterName.REPOSITORY_ALLOW_AUTO_SWITCH.getName());
  final Shell parentShell=this.composite.getShell();
  final Node inputNode=(Node)this.curParameter.getElement();
  if (connParameters == null) {
    initConnectionParameters();
  }
  final String tmpMemoSql=this.memoSQL;
  final DatabaseConnection connt=TracesConnectionUtils.createConnection(connParameters);
  IMetadataConnection iMetadataConnection=null;
  boolean isStatus=false;
  try {
    if (connt != null) {
      iMetadataConnection=ConvertionHelper.convert(connt);
      isStatus=checkConnection(iMetadataConnection);
    }
    if (isStatus) {
      if (EDatabaseTypeName.GENERAL_JDBC.getDisplayName().equals(iMetadataConnection.getDbType())) {
        info=new DbInfo(iMetadataConnection.getDbType(),iMetadataConnection.getUsername(),iMetadataConnection.getPassword(),iMetadataConnection.getDbVersionString(),iMetadataConnection.getUrl(),iMetadataConnection.getDriverClass(),iMetadataConnection.getDriverJarPath(),iMetadataConnection.getAdditionalParams());
      }
 else {
        info=new DbInfo(iMetadataConnection.getDbType(),iMetadataConnection.getUsername(),iMetadataConnection.getPassword(),iMetadataConnection.getDbVersionString(),iMetadataConnection.getUrl(),iMetadataConnection.getDriverJarPath());
      }
      final Property property=GuessSchemaProcess.getNewmockProperty();
      List<IContext> allcontexts=inputNode.getProcess().getContextManager().getListContext();
      OpenContextChooseComboDialog dialog=new OpenContextChooseComboDialog(parentShell,allcontexts);
      dialog.create();
      dialog.getShell().setText(CONTEXT_CHOOSE_DIALOG_TITLE);
      IContext selectContext=null;
      if (allcontexts.size() == 1 || TalendTextUtils.isCommonString(tmpMemoSql)) {
        selectContext=inputNode.getProcess().getContextManager().getDefaultContext();
      }
 else       if (Window.OK == dialog.open()) {
        selectContext=dialog.getSelectedContext();
      }
      final IContext context=selectContext;
      if (context != null) {
        final ProgressMonitorDialog pmd=new ProgressMonitorDialog(this.composite.getShell());
        pmd.run(true,true,new IRunnableWithProgress(){
          @Override public void run(          IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
            Display.getDefault().asyncExec(new Runnable(){
              @Override public void run(){
                runShadowProcess(property,inputNode,context,switchParam);
              }
            }
);
          }
        }
);
      }
    }
 else {
      Display.getDefault().asyncExec(new Runnable(){
        @Override public void run(){
          String pid="String_Node_Str";
          String mainMsg=Messages.getString("String_Node_Str");
          ErrorDialogWithDetailAreaAndContinueButton dialog=new ErrorDialogWithDetailAreaAndContinueButton(composite.getShell(),pid,mainMsg,connParameters.getConnectionComment());
          if (dialog.getCodeOfButton() == Window.OK) {
            openParamemerDialog(composite.getShell(),part.getProcess().getContextManager());
          }
        }
      }
);
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}