Program: 125856
Project: 125856
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 (generalJdbcPasswordText.getText() != null) {
          getConnection().setRawPassword(generalJdbcPasswordText.getText());
        }
        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){
      String value=generalJdbcDriverjarText.getText();
      if (value != null && value.length() > 0) {
        IPath path=Path.fromOSString(value);
        if (path.lastSegment() != null) {
          value=path.lastSegment();
        }
      }
      ModuleListDialog dialog=new ModuleListDialog(getShell(),value,null,true);
      if (dialog.open() == Window.OK) {
        if (dialog.getSelecteModuleArray() != null) {
          String[] moduleArray=dialog.getSelecteModuleArray();
          StringBuffer modeleList=new StringBuffer();
          for (int i=0; i < moduleArray.length; i++) {
            String module=moduleArray[i];
            modeleList.append(module);
            if (i < moduleArray.length - 1) {
              modeleList.append("String_Node_Str");
            }
          }
          generalJdbcDriverjarText.setText(modeleList.toString());
        }
 else         if (dialog.getSelecteModule() != null) {
          String selecteModule=dialog.getSelecteModule();
          generalJdbcDriverjarText.setText(selecteModule);
        }
      }
    }
  }
);
  browseClassButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      generalJdbcClassNameText.removeAll();
      for (      String jarName : generalJdbcDriverjarText.getText().trim().split("String_Node_Str")) {
        String stringToFile=getselecteModulePath(jarName);
        if (stringToFile == null) {
          stringToFile=jarName;
        }
        File file=new File(stringToFile);
        if (file != null) {
          try {
            MyURLClassLoader cl=new MyURLClassLoader(file.toURL());
            Class[] classes=cl.getAssignableClasses(Driver.class);
            for (            Class classe : classes) {
              generalJdbcClassNameText.add(classe.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())) {
          String jarPath=generalJdbcDriverjarText.getText();
          String[] jarNames=jarPath.split("String_Node_Str");
          StringBuffer buffer=new StringBuffer();
          for (int i=0; i < jarNames.length; i++) {
            if (i != 0) {
              buffer.append("String_Node_Str");
            }
            String path=jarNames[i];
            IPath ipath=Path.fromOSString(path);
            String lastSegment=ipath.lastSegment();
            buffer.append(lastSegment);
          }
          getConnection().setDriverJarPath(buffer.toString());
        }
        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) {
          getConnection().setRawPassword(generalJdbcPasswordText.getText());
        }
        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){
      String value=generalJdbcDriverjarText.getText();
      if (value != null && value.length() > 0) {
        IPath path=Path.fromOSString(value);
        if (path.lastSegment() != null) {
          value=path.lastSegment();
        }
      }
      ModuleListDialog dialog=new ModuleListDialog(getShell(),value,null,true);
      if (dialog.open() == Window.OK) {
        if (dialog.getSelecteModuleArray() != null) {
          String[] moduleArray=dialog.getSelecteModuleArray();
          StringBuffer modeleList=new StringBuffer();
          for (int i=0; i < moduleArray.length; i++) {
            String module=moduleArray[i];
            modeleList.append(module);
            if (i < moduleArray.length - 1) {
              modeleList.append("String_Node_Str");
            }
          }
          generalJdbcDriverjarText.setText(modeleList.toString());
        }
 else         if (dialog.getSelecteModule() != null) {
          String selecteModule=dialog.getSelecteModule();
          generalJdbcDriverjarText.setText(selecteModule);
        }
      }
    }
  }
);
  browseClassButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      generalJdbcClassNameText.removeAll();
      for (      String jarName : generalJdbcDriverjarText.getText().trim().split("String_Node_Str")) {
        String stringToFile=getselecteModulePath(jarName);
        if (stringToFile == null) {
          stringToFile=jarName;
        }
        File file=new File(stringToFile);
        if (file != null) {
          try {
            MyURLClassLoader cl=new MyURLClassLoader(file.toURL());
            Class[] classes=cl.getAssignableClasses(Driver.class);
            for (            Class classe : classes) {
              generalJdbcClassNameText.add(classe.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());
    }
  }
);
}