Program: 140050
Project: 140050
Buggy source:
protected void createPart(Composite parent,String dbLiteral,final DBConnectionParameter connectionParam){
  if (dbLiteral.trim().equals("String_Node_Str")) {
    GridLayout layout=new GridLayout();
    layout.numColumns=3;
    parent.setLayout(layout);
    Label labelJar=new Label(parent,SWT.NONE);
    labelJar.setText("String_Node_Str");
    final Text jarText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    jarText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    jarText.setEditable(false);
    jarText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent e){
        connectionParam.setDriverPath(jarText.getText());
      }
    }
);
    final Button selectJar=new Button(parent,SWT.PUSH);
    final StringBuilder filenameAll=new StringBuilder();
    selectJar.setText("String_Node_Str");
    selectJar.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent event){
        FileDialog dialog=new FileDialog(Display.getCurrent().getActiveShell());
        String filename=dialog.open();
        if (filename != null) {
          filenameAll.append(filename + "String_Node_Str");
          jarText.setText(filenameAll.toString());
        }
 else {
          jarText.setText("String_Node_Str");
        }
      }
    }
);
    Label labelDriver=new Label(parent,SWT.NONE);
    labelDriver.setText("String_Node_Str");
    final Combo comboDriver=new Combo(parent,SWT.READ_ONLY);
    comboDriver.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    comboDriver.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        connectionParam.setDriverClassName(comboDriver.getText());
      }
    }
);
    Button listDriverBtn=new Button(parent,SWT.PUSH);
    listDriverBtn.setText("String_Node_Str");
    listDriverBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        comboDriver.removeAll();
        for (        String stringToFile : jarText.getText().trim().split("String_Node_Str")) {
          File file=new File(stringToFile);
          if (file != null) {
            try {
              MyURLClassLoader cl=new MyURLClassLoader(file.toURL());
              Class[] classes=cl.getAssignableClasses(Driver.class);
              for (int i=0; i < classes.length; ++i) {
                comboDriver.add(classes[i].getName());
              }
            }
 catch (            MalformedURLException ex) {
              ex.printStackTrace();
            }
catch (            IOException ex) {
              ex.printStackTrace();
            }
          }
        }
        if (comboDriver.getItemCount() > 0) {
          comboDriver.setText(comboDriver.getItem(0));
        }
      }
    }
);
    Label labelUrl=new Label(parent,SWT.NONE);
    labelUrl.setText("String_Node_Str");
    final Text urlText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    urlText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    urlText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent e){
        connectionParam.setJdbcUrl(urlText.getText());
      }
    }
);
  }
 else   if (dbLiteral.trim().equals("String_Node_Str")) {
    GridLayout layout=new GridLayout();
    layout.numColumns=3;
    parent.setLayout(layout);
    Label labelfile=new Label(parent,SWT.NONE);
    final Text fileText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    final Button selectFile=new Button(parent,SWT.PUSH);
    Label labelUrl=new Label(parent,SWT.NONE);
    final Text urlText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    labelfile.setText("String_Node_Str");
    fileText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fileText.setEditable(false);
    fileText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent e){
        connectionParam.setFilePath(fileText.getText());
      }
    }
);
    selectFile.setText("String_Node_Str");
    labelUrl.setText("String_Node_Str");
    urlText.setEditable(false);
    urlText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    setConnectionURL(SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),"String_Node_Str","String_Node_Str",fileText.getText(),"String_Node_Str","String_Node_Str"));
    urlText.setText(getConnectionURL());
    urlText.setEditable(false);
    urlText.addKeyListener(new KeyAdapter(){
      public void keyReleased(      KeyEvent e){
        setConnectionURL(urlText.getText());
      }
    }
);
    urlText.addFocusListener(new FocusAdapter(){
      public void focusGained(      FocusEvent e){
        urlText.setEditable(true);
      }
      public void focusLost(      FocusEvent e){
        urlText.setEditable(false);
      }
    }
);
    selectFile.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent event){
        FileDialog dialog=new FileDialog(Display.getCurrent().getActiveShell());
        String filename=dialog.open();
        if (filename != null) {
          fileText.setText(filename);
        }
 else {
          fileText.setText("String_Node_Str");
        }
        String url=SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),"String_Node_Str","String_Node_Str",fileText.getText(),"String_Node_Str","String_Node_Str");
        String validURL=getValidURL(url);
        setConnectionURL(validURL);
        urlText.setText(getConnectionURL());
      }
      private String getValidURL(      String url){
        if (url.indexOf("String_Node_Str") != 0) {
          url=url.replace("String_Node_Str","String_Node_Str");
        }
        return url;
      }
    }
);
  }
 else {
    GridLayout layout=new GridLayout();
    layout.numColumns=2;
    parent.setLayout(layout);
    boolean compositeEnable=!(dbType.getHostName() == null);
    Label label=new Label(parent,SWT.NONE);
    label.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    final Text hostNameText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    hostNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if (compositeEnable) {
      hostNameText.setText(dbType.getHostName());
    }
    label.setEnabled(compositeEnable);
    hostNameText.setEnabled(compositeEnable);
    compositeEnable=!(dbType.getPort() == null);
    label=new Label(parent,SWT.NONE);
    label.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    final Text portText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    portText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if (compositeEnable) {
      portText.setText(dbType.getPort());
    }
    label.setEnabled(compositeEnable);
    portText.setEnabled(compositeEnable);
    compositeEnable=!(dbType.getDBName() == null);
    label=new Label(parent,SWT.NONE);
    if (dbType == SupportDBUrlType.ORACLEWITHSIDDEFAULTURL) {
      label.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    }
 else     if (dbType == SupportDBUrlType.ORACLEWITHSERVICENAMEDEFAULTURL) {
      label.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    }
 else {
      label.setText("String_Node_Str");
    }
    final Text databaseNameText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    databaseNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if (compositeEnable) {
      databaseNameText.setText(dbType.getDBName());
    }
    label.setEnabled(compositeEnable);
    databaseNameText.setEnabled(compositeEnable);
    compositeEnable=!(dbType.getParamSeprator() == null);
    label=new Label(parent,SWT.NONE);
    label.setText("String_Node_Str");
    final Text parameterText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    parameterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if (dbType.getParamSeprator() != null) {
      parameterText.setText(org.talend.dq.PluginConstant.DEFAULT_PARAMETERS);
    }
 else {
      parameterText.setText(PluginConstant.EMPTY_STRING);
    }
    parameterText.setEnabled(compositeEnable);
    label.setEnabled(compositeEnable);
    parameterText.setEnabled(compositeEnable);
    compositeEnable=!(dbType.getDataSource() == null);
    label=new Label(parent,SWT.NONE);
    label.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    final Text dataSourceText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    dataSourceText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if (compositeEnable) {
      dataSourceText.setText(dbType.getDataSource());
    }
    label.setEnabled(compositeEnable);
    dataSourceText.setEnabled(compositeEnable);
    label=new Label(parent,SWT.NONE);
    label.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    urlText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    urlText.setEditable(false);
    urlText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    urlText.addFocusListener(new FocusAdapter(){
      public void focusGained(      FocusEvent e){
        urlText.setEditable(true);
      }
      public void focusLost(      FocusEvent e){
        urlText.setEditable(false);
      }
    }
);
    urlText.setText(getConnectionURL());
    urlText.addKeyListener(new KeyAdapter(){
      public void keyReleased(      KeyEvent e){
        setConnectionURL(urlText.getText());
      }
    }
);
    dataSourceText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent event){
        setConnectionURL(SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),hostNameText.getText(),portText.getText(),databaseNameText.getText(),dataSourceText.getText(),parameterText.getText()));
        urlText.setText(getConnectionURL());
      }
    }
);
    hostNameText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent event){
        setConnectionURL(SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),hostNameText.getText(),portText.getText(),databaseNameText.getText(),dataSourceText.getText(),parameterText.getText()));
        urlText.setText(getConnectionURL());
      }
    }
);
    portText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent event){
        setConnectionURL(SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),hostNameText.getText(),portText.getText(),databaseNameText.getText(),dataSourceText.getText(),parameterText.getText()));
        urlText.setText(getConnectionURL());
      }
    }
);
    portText.addKeyListener(new KeyAdapter(){
      public void keyReleased(      KeyEvent e){
        Long portValue=null;
        try {
          portValue=new Long(portText.getText());
        }
 catch (        NumberFormatException e1) {
        }
        if (portValue == null || portValue <= 0) {
          portText.setText(PluginConstant.EMPTY_STRING);
        }
      }
    }
);
    databaseNameText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent event){
        setConnectionURL(SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),hostNameText.getText(),portText.getText(),databaseNameText.getText(),dataSourceText.getText(),parameterText.getText()));
        urlText.setText(getConnectionURL());
        SupportDBUrlStore.getInstance().changeAllDBNmae(databaseNameText.getText());
      }
    }
);
    parameterText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent e){
        setConnectionURL(SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),hostNameText.getText(),portText.getText(),databaseNameText.getText(),dataSourceText.getText(),parameterText.getText()));
        urlText.setText(getConnectionURL());
      }
    }
);
  }
}

Fixed version (ground truth):
protected void createPart(Composite parent,String dbLiteral,final DBConnectionParameter connectionParam){
  if (dbLiteral.trim().equals("String_Node_Str")) {
    GridLayout layout=new GridLayout();
    layout.numColumns=3;
    parent.setLayout(layout);
    Label labelJar=new Label(parent,SWT.NONE);
    labelJar.setText("String_Node_Str");
    final Text jarText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    jarText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    jarText.setEditable(false);
    jarText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent e){
        connectionParam.setDriverPath(jarText.getText());
      }
    }
);
    final Button selectJar=new Button(parent,SWT.PUSH);
    final StringBuilder filenameAll=new StringBuilder();
    selectJar.setText("String_Node_Str");
    selectJar.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent event){
        FileDialog dialog=new FileDialog(Display.getCurrent().getActiveShell());
        String filename=dialog.open();
        if (filename != null) {
          filenameAll.append(filename + "String_Node_Str");
          jarText.setText(filenameAll.toString());
        }
 else {
          jarText.setText("String_Node_Str");
        }
      }
    }
);
    Label labelDriver=new Label(parent,SWT.NONE);
    labelDriver.setText("String_Node_Str");
    final Combo comboDriver=new Combo(parent,SWT.READ_ONLY);
    comboDriver.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    comboDriver.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        connectionParam.setDriverClassName(comboDriver.getText());
      }
    }
);
    Button listDriverBtn=new Button(parent,SWT.PUSH);
    listDriverBtn.setText("String_Node_Str");
    listDriverBtn.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        comboDriver.removeAll();
        for (        String stringToFile : jarText.getText().trim().split("String_Node_Str")) {
          File file=new File(stringToFile);
          if (file != null) {
            try {
              MyURLClassLoader cl=new MyURLClassLoader(file.toURL());
              Class[] classes=cl.getAssignableClasses(Driver.class);
              for (int i=0; i < classes.length; ++i) {
                comboDriver.add(classes[i].getName());
              }
            }
 catch (            MalformedURLException ex) {
              ex.printStackTrace();
            }
catch (            IOException ex) {
              ex.printStackTrace();
            }
          }
        }
        if (comboDriver.getItemCount() > 0) {
          comboDriver.setText(comboDriver.getItem(0));
        }
      }
    }
);
    Label labelUrl=new Label(parent,SWT.NONE);
    labelUrl.setText("String_Node_Str");
    final Text urlText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    urlText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    urlText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent e){
        connectionParam.setJdbcUrl(urlText.getText());
      }
    }
);
  }
 else   if (dbLiteral.trim().equals("String_Node_Str")) {
    GridLayout layout=new GridLayout();
    layout.numColumns=3;
    parent.setLayout(layout);
    Label labelfile=new Label(parent,SWT.NONE);
    final Text fileText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    final Button selectFile=new Button(parent,SWT.PUSH);
    Label labelUrl=new Label(parent,SWT.NONE);
    final Text urlText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    labelfile.setText("String_Node_Str");
    fileText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fileText.setEditable(false);
    fileText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent e){
        connectionParam.setFilePath(fileText.getText());
      }
    }
);
    selectFile.setText("String_Node_Str");
    labelUrl.setText("String_Node_Str");
    urlText.setEditable(false);
    urlText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    setConnectionURL(SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),"String_Node_Str","String_Node_Str",fileText.getText(),"String_Node_Str","String_Node_Str"));
    urlText.setText(getConnectionURL());
    urlText.setEditable(false);
    urlText.addKeyListener(new KeyAdapter(){
      public void keyReleased(      KeyEvent e){
        setConnectionURL(urlText.getText());
      }
    }
);
    urlText.addFocusListener(new FocusAdapter(){
      public void focusGained(      FocusEvent e){
        urlText.setEditable(true);
      }
      public void focusLost(      FocusEvent e){
        urlText.setEditable(false);
      }
    }
);
    selectFile.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent event){
        FileDialog dialog=new FileDialog(Display.getCurrent().getActiveShell());
        String filename=dialog.open();
        if (filename != null) {
          fileText.setText(filename);
        }
 else {
          fileText.setText("String_Node_Str");
        }
        String url=SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),"String_Node_Str","String_Node_Str",fileText.getText(),"String_Node_Str","String_Node_Str");
        if (log.isInfoEnabled()) {
          log.info("String_Node_Str" + url);
        }
        setConnectionURL(url);
        urlText.setText(getConnectionURL());
      }
    }
);
  }
 else {
    GridLayout layout=new GridLayout();
    layout.numColumns=2;
    parent.setLayout(layout);
    boolean compositeEnable=!(dbType.getHostName() == null);
    Label label=new Label(parent,SWT.NONE);
    label.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    final Text hostNameText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    hostNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if (compositeEnable) {
      hostNameText.setText(dbType.getHostName());
    }
    label.setEnabled(compositeEnable);
    hostNameText.setEnabled(compositeEnable);
    compositeEnable=!(dbType.getPort() == null);
    label=new Label(parent,SWT.NONE);
    label.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    final Text portText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    portText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if (compositeEnable) {
      portText.setText(dbType.getPort());
    }
    label.setEnabled(compositeEnable);
    portText.setEnabled(compositeEnable);
    compositeEnable=!(dbType.getDBName() == null);
    label=new Label(parent,SWT.NONE);
    if (dbType == SupportDBUrlType.ORACLEWITHSIDDEFAULTURL) {
      label.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    }
 else     if (dbType == SupportDBUrlType.ORACLEWITHSERVICENAMEDEFAULTURL) {
      label.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    }
 else {
      label.setText("String_Node_Str");
    }
    final Text databaseNameText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    databaseNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if (compositeEnable) {
      databaseNameText.setText(dbType.getDBName());
    }
    label.setEnabled(compositeEnable);
    databaseNameText.setEnabled(compositeEnable);
    compositeEnable=!(dbType.getParamSeprator() == null);
    label=new Label(parent,SWT.NONE);
    label.setText("String_Node_Str");
    final Text parameterText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    parameterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if (dbType.getParamSeprator() != null) {
      parameterText.setText(org.talend.dq.PluginConstant.DEFAULT_PARAMETERS);
    }
 else {
      parameterText.setText(PluginConstant.EMPTY_STRING);
    }
    parameterText.setEnabled(compositeEnable);
    label.setEnabled(compositeEnable);
    parameterText.setEnabled(compositeEnable);
    compositeEnable=!(dbType.getDataSource() == null);
    label=new Label(parent,SWT.NONE);
    label.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    final Text dataSourceText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    dataSourceText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if (compositeEnable) {
      dataSourceText.setText(dbType.getDataSource());
    }
    label.setEnabled(compositeEnable);
    dataSourceText.setEnabled(compositeEnable);
    label=new Label(parent,SWT.NONE);
    label.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    urlText=new Text(parent,SWT.BORDER | SWT.SINGLE);
    urlText.setEditable(false);
    urlText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    urlText.addFocusListener(new FocusAdapter(){
      public void focusGained(      FocusEvent e){
        urlText.setEditable(true);
      }
      public void focusLost(      FocusEvent e){
        urlText.setEditable(false);
      }
    }
);
    urlText.setText(getConnectionURL());
    urlText.addKeyListener(new KeyAdapter(){
      public void keyReleased(      KeyEvent e){
        setConnectionURL(urlText.getText());
      }
    }
);
    dataSourceText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent event){
        setConnectionURL(SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),hostNameText.getText(),portText.getText(),databaseNameText.getText(),dataSourceText.getText(),parameterText.getText()));
        urlText.setText(getConnectionURL());
      }
    }
);
    hostNameText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent event){
        setConnectionURL(SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),hostNameText.getText(),portText.getText(),databaseNameText.getText(),dataSourceText.getText(),parameterText.getText()));
        urlText.setText(getConnectionURL());
      }
    }
);
    portText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent event){
        setConnectionURL(SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),hostNameText.getText(),portText.getText(),databaseNameText.getText(),dataSourceText.getText(),parameterText.getText()));
        urlText.setText(getConnectionURL());
      }
    }
);
    portText.addKeyListener(new KeyAdapter(){
      public void keyReleased(      KeyEvent e){
        Long portValue=null;
        try {
          portValue=new Long(portText.getText());
        }
 catch (        NumberFormatException e1) {
        }
        if (portValue == null || portValue <= 0) {
          portText.setText(PluginConstant.EMPTY_STRING);
        }
      }
    }
);
    databaseNameText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent event){
        setConnectionURL(SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),hostNameText.getText(),portText.getText(),databaseNameText.getText(),dataSourceText.getText(),parameterText.getText()));
        urlText.setText(getConnectionURL());
        SupportDBUrlStore.getInstance().changeAllDBNmae(databaseNameText.getText());
      }
    }
);
    parameterText.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent e){
        setConnectionURL(SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),hostNameText.getText(),portText.getText(),databaseNameText.getText(),dataSourceText.getText(),parameterText.getText()));
        urlText.setText(getConnectionURL());
      }
    }
);
  }
}