Program: 138992
Project: 138992
Buggy source:
/** 
 * DOC bZhou Comment method "addListeners".
 */
private void addListeners(){
  dirBTN.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      setDirState(dirBTN.getSelection());
    }
  }
);
  archBTN.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      setArchState(archBTN.getSelection());
    }
  }
);
  browseDirBTN.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String result=openDirectoryDialog();
      if (result != null) {
        dirTxt.setText(result);
      }
    }
    private String openDirectoryDialog(){
      DirectoryDialog dialog=new DirectoryDialog(Display.getDefault().getActiveShell());
      if (dirTxt.getText() != null) {
        dialog.setFilterPath(dirTxt.getText());
      }
      return dialog.open();
    }
  }
);
  browseArchBTN.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String result=openFileDialog();
      if (result != null) {
        archTxt.setText(result);
      }
    }
    private String openFileDialog(){
      FileDialog dialog=new FileDialog(Display.getDefault().getActiveShell());
      dialog.setFilterExtensions(FILE_EXPORT_MASK);
      if (archTxt.getText() != null) {
        dialog.setFileName(archTxt.getText());
      }
      return dialog.open();
    }
  }
);
  repositoryTree.getTree().addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      TreeItem item=(TreeItem)e.item;
      File sfile=(File)item.getData();
      IFile sIFile=ResourceService.file2IFile(sfile);
      if (sIFile != null) {
        File[] dependencies=computeDependencies(sIFile);
        for (        File file : dependencies) {
          repositoryTree.setChecked(file,item.getChecked());
        }
        repositoryTree.refresh();
      }
      checkForErrors();
    }
  }
);
  dirTxt.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      writer.setBasePath(dirTxt.getText());
      checkForErrors();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "addListeners".
 */
private void addListeners(){
  dirBTN.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      setDirState(dirBTN.getSelection());
    }
  }
);
  archBTN.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      setArchState(archBTN.getSelection());
    }
  }
);
  browseDirBTN.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String result=openDirectoryDialog();
      if (result != null) {
        dirTxt.setText(result);
      }
    }
    private String openDirectoryDialog(){
      DirectoryDialog dialog=new DirectoryDialog(Display.getDefault().getActiveShell());
      if (dirTxt.getText() != null) {
        dialog.setFilterPath(dirTxt.getText());
      }
      return dialog.open();
    }
  }
);
  browseArchBTN.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String result=openFileDialog();
      if (result != null) {
        archTxt.setText(result);
      }
    }
    private String openFileDialog(){
      FileDialog dialog=new FileDialog(Display.getDefault().getActiveShell());
      dialog.setFilterExtensions(FILE_EXPORT_MASK);
      if (archTxt.getText() != null) {
        dialog.setFileName(archTxt.getText());
      }
      return dialog.open();
    }
  }
);
  repositoryTree.getTree().addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      TreeItem item=(TreeItem)e.item;
      ItemRecord record=(ItemRecord)item.getData();
      if (record.getFile().isFile()) {
        for (        File file : record.getDependencyMap().keySet()) {
          repositoryTree.setChecked(ItemRecord.findRecord(file),item.getChecked());
        }
        repositoryTree.refresh();
        checkForErrors();
      }
    }
  }
);
  dirTxt.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      writer.setBasePath(dirTxt.getText());
      checkForErrors();
    }
  }
);
}