Program: 128182
Project: 128182
Buggy source:
/** 
 * DOC YeXiaowei Comment method "addGeneralDbFieldsListeners".
 */
private void addGeneralDbFieldsListeners(){
  generalJdbcClassNameText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        if (validText(generalJdbcClassNameText.getText())) {
          getConnection().setDriverClass(generalJdbcClassNameText.getText());
        }
        checkFieldsValue();
      }
    }
  }
);
  generalJdbcDriverjarText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        if (validText(generalJdbcDriverjarText.getText())) {
          getConnection().setDriverJarPath(generalJdbcDriverjarText.getText());
        }
        checkFieldsValue();
      }
    }
  }
);
  generalJdbcUrlText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        if (validText(generalJdbcUrlText.getText())) {
          getConnection().setURL(generalJdbcUrlText.getText());
        }
        checkFieldsValue();
      }
    }
  }
);
  generalJdbcPasswordText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        if (validText(generalJdbcPasswordText.getText())) {
          try {
            String password=PasswordEncryptUtil.encryptPassword(generalJdbcPasswordText.getText());
            getConnection().setPassword(password);
          }
 catch (          Exception ex) {
            ExceptionHandler.process(ex);
          }
        }
        checkFieldsValue();
      }
    }
  }
);
  generalJdbcUserText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        if (validText(generalJdbcUserText.getText())) {
          getConnection().setUsername(generalJdbcUserText.getText());
        }
        checkFieldsValue();
      }
    }
  }
);
  jDBCschemaText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        String text=jDBCschemaText.getText();
        schemaText.setText(text);
        if (validText(schemaText.getText())) {
          getConnection().setUiSchema(schemaText.getText());
          checkFieldsValue();
        }
      }
    }
  }
);
  generalMappingFileText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        if (validText(generalMappingFileText.getText())) {
          getConnection().setDbmsId(generalMappingFileText.getText());
        }
        checkFieldsValue();
      }
    }
  }
);
  mappingFileText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        if (validText(mappingFileText.getText())) {
          getConnection().setDbmsId(mappingFileText.getText());
          checkFieldsValue();
        }
      }
    }
  }
);
  browseJarFilesButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      SelectDatabaseJarDialog dialog=new SelectDatabaseJarDialog(getShell(),generalJdbcDriverjarText.getText());
      if (dialog.open() == Window.OK) {
        generalJdbcDriverjarText.setText(dialog.getJarsString());
      }
    }
  }
);
  browseClassButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      generalJdbcClassNameText.removeAll();
      for (      String stringToFile : generalJdbcDriverjarText.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) {
              generalJdbcClassNameText.add(classes[i].getName());
            }
          }
 catch (          Exception ex) {
            ExceptionHandler.process(ex);
          }
        }
      }
      if (generalJdbcClassNameText.getItemCount() > 0) {
        String driverClassName=generalJdbcClassNameText.getItem(0);
        generalJdbcClassNameText.setText(driverClassName);
      }
    }
  }
);
  generalMappingSelectButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      MappingFileSelectDialog dialog=new MappingFileSelectDialog(getShell());
      dialog.open();
      generalMappingFileText.setText(dialog.getSelectId());
    }
  }
);
  mappingSelectButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      MappingFileSelectDialog dialog=new MappingFileSelectDialog(getShell());
      dialog.open();
      mappingFileText.setText(dialog.getSelectId());
    }
  }
);
}

Fixed version (ground truth):
/** 
 * DOC YeXiaowei Comment method "addGeneralDbFieldsListeners".
 */
private void addGeneralDbFieldsListeners(){
  generalJdbcClassNameText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        if (validText(generalJdbcClassNameText.getText())) {
          getConnection().setDriverClass(generalJdbcClassNameText.getText());
        }
        checkFieldsValue();
      }
    }
  }
);
  generalJdbcDriverjarText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        if (validText(generalJdbcDriverjarText.getText())) {
          getConnection().setDriverJarPath(generalJdbcDriverjarText.getText());
        }
        checkFieldsValue();
      }
    }
  }
);
  generalJdbcUrlText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        if (validText(generalJdbcUrlText.getText())) {
          getConnection().setURL(generalJdbcUrlText.getText());
        }
        checkFieldsValue();
      }
    }
  }
);
  generalJdbcPasswordText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        if (generalJdbcPasswordText.getText() != null) {
          try {
            String password=PasswordEncryptUtil.encryptPassword(generalJdbcPasswordText.getText());
            getConnection().setPassword(password);
          }
 catch (          Exception ex) {
            ExceptionHandler.process(ex);
          }
        }
        checkFieldsValue();
      }
    }
  }
);
  generalJdbcUserText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        if (validText(generalJdbcUserText.getText())) {
          getConnection().setUsername(generalJdbcUserText.getText());
        }
        checkFieldsValue();
      }
    }
  }
);
  jDBCschemaText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        String text=jDBCschemaText.getText();
        schemaText.setText(text);
        if (validText(schemaText.getText())) {
          getConnection().setUiSchema(schemaText.getText());
          checkFieldsValue();
        }
      }
    }
  }
);
  generalMappingFileText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        if (validText(generalMappingFileText.getText())) {
          getConnection().setDbmsId(generalMappingFileText.getText());
        }
        checkFieldsValue();
      }
    }
  }
);
  mappingFileText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        if (validText(mappingFileText.getText())) {
          getConnection().setDbmsId(mappingFileText.getText());
          checkFieldsValue();
        }
      }
    }
  }
);
  browseJarFilesButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      SelectDatabaseJarDialog dialog=new SelectDatabaseJarDialog(getShell(),generalJdbcDriverjarText.getText());
      if (dialog.open() == Window.OK) {
        generalJdbcDriverjarText.setText(dialog.getJarsString());
      }
    }
  }
);
  browseClassButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      generalJdbcClassNameText.removeAll();
      for (      String stringToFile : generalJdbcDriverjarText.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) {
              generalJdbcClassNameText.add(classes[i].getName());
            }
          }
 catch (          Exception ex) {
            ExceptionHandler.process(ex);
          }
        }
      }
      if (generalJdbcClassNameText.getItemCount() > 0) {
        String driverClassName=generalJdbcClassNameText.getItem(0);
        generalJdbcClassNameText.setText(driverClassName);
      }
    }
  }
);
  generalMappingSelectButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      MappingFileSelectDialog dialog=new MappingFileSelectDialog(getShell());
      dialog.open();
      generalMappingFileText.setText(dialog.getSelectId());
    }
  }
);
  mappingSelectButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      MappingFileSelectDialog dialog=new MappingFileSelectDialog(getShell());
      dialog.open();
      mappingFileText.setText(dialog.getSelectId());
    }
  }
);
}