nus-yam/ex-repair huggingface dataset:
Program: 140675
Project: 140675
Buggy source:
public void partBroughtToTop(IWorkbenchPart part){
  if (part instanceof AnalysisEditor) {
    runAnalysisAction.setEnabled(true);
  }
 else {
    runAnalysisAction.setEnabled(false);
  }
}

Fixed version (ground truth):
public void partBroughtToTop(IWorkbenchPart part){
  if (part instanceof AnalysisEditor) {
    runAnalysisAction.setEnabled(true);
    refreshChartAction.setEnabled(true);
  }
 else {
    runAnalysisAction.setEnabled(false);
    refreshChartAction.setEnabled(false);
  }
}
Program: 140677
Project: 140677
Buggy source:
public void partActivated(IWorkbenchPart part){
  boolean isEnable=false;
  if (part instanceof AnalysisEditor) {
    isEnable=true;
  }
 else {
    IWorkbenchPage activePage=activeWorkbenchWindow.getActivePage();
    if (activePage != null) {
      IEditorPart activeEditor=activePage.getActiveEditor();
      if (activeEditor instanceof AnalysisEditor) {
        isEnable=true;
      }
    }
  }
  runAnalysisAction.setEnabled(isEnable);
}

Fixed version (ground truth):
public void partActivated(IWorkbenchPart part){
  boolean isEnable=false;
  if (part instanceof AnalysisEditor) {
    isEnable=true;
  }
 else {
    IWorkbenchPage activePage=activeWorkbenchWindow.getActivePage();
    if (activePage != null) {
      IEditorPart activeEditor=activePage.getActiveEditor();
      if (activeEditor instanceof AnalysisEditor) {
        isEnable=true;
      }
    }
  }
  runAnalysisAction.setEnabled(isEnable);
  refreshChartAction.setEnabled(isEnable);
}
Program: 140679
Project: 140679
Buggy source:
@Override public boolean performFinish(){
  Pattern pattern=PatternFactory.eINSTANCE.createPattern();
  String name=AbstractWizardPage.getConnectionParams().getName();
  pattern.setName(name);
  TaggedValueHelper.setAuthor(pattern,AbstractWizardPage.getConnectionParams().getAuthor());
  TaggedValueHelper.setDescription(AbstractWizardPage.getConnectionParams().getDescription(),pattern);
  TaggedValueHelper.setPurpose(AbstractWizardPage.getConnectionParams().getPurpose(),pattern);
  TaggedValueHelper.setDevStatus(pattern,DevelopmentStatus.get(AbstractWizardPage.getConnectionParams().getStatus()));
  RegularExpression regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  Expression expression=CoreFactory.eINSTANCE.createExpression();
  String expr=mPage2.getNameText().getText();
  expression.setBody(expr);
  String cl=mPage2.getComboLang();
  expression.setLanguage(cl);
  regularExpr.setExpression(expression);
  pattern.getComponents().add(regularExpr);
  EMFUtil util=EMFSharedResources.getSharedEmfUtil();
  IPath location=folder.getLocation();
  String fname=DqRepositoryViewService.createFilename(folder.getName(),name,NewSourcePatternActionProvider.EXTENSION_PATTERN);
  location=location.removeLastSegments(1);
  location=location.append(fname);
  util.addPoolToResourceSet(new File(location.toPortableString()),pattern);
  util.saveLastResource();
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  Pattern pattern=PatternFactory.eINSTANCE.createPattern();
  String name=AbstractWizardPage.getConnectionParams().getName();
  pattern.setName(name);
  TaggedValueHelper.setAuthor(pattern,AbstractWizardPage.getConnectionParams().getAuthor());
  TaggedValueHelper.setDescription(AbstractWizardPage.getConnectionParams().getDescription(),pattern);
  TaggedValueHelper.setPurpose(AbstractWizardPage.getConnectionParams().getPurpose(),pattern);
  TaggedValueHelper.setDevStatus(pattern,DevelopmentStatus.get(AbstractWizardPage.getConnectionParams().getStatus()));
  RegularExpression regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  Expression expression=CoreFactory.eINSTANCE.createExpression();
  String expr=mPage2.getNameText().getText();
  expression.setBody(expr);
  String cl=mPage2.getComboLang();
  expression.setLanguage(cl);
  regularExpr.setExpression(expression);
  pattern.getComponents().add(regularExpr);
  EMFUtil util=EMFSharedResources.getSharedEmfUtil();
  location=folder.getLocation();
  String fname=DqRepositoryViewService.createFilename(folder.getName(),name,NewSourcePatternActionProvider.EXTENSION_PATTERN);
  location=location.removeLastSegments(1);
  location=location.append(fname);
  util.addPoolToResourceSet(new File(location.toPortableString()),pattern);
  util.saveLastResource();
  return true;
}
Program: 140681
Project: 140681
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  new RunAnalysisAction().run();
  refreshChart(form);
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  new RunAnalysisAction().run();
  while (!RunAnalysisAction.finishFlag) {
    try {
      Thread.sleep(3000);
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
  }
  refreshChart(form);
}
Program: 140682
Project: 140682
Buggy source:
@Override protected void createFormContent(IManagedForm managedForm){
  super.createFormContent(managedForm);
  final ScrolledForm form=managedForm.getForm();
  form.setText("String_Node_Str");
  metadataSection.setText("String_Node_Str");
  metadataSection.setDescription("String_Node_Str");
  createAnalysisColumnsSection(form,topComp);
  createDataFilterSection(form,topComp);
  Composite body=form.getBody();
  Composite previewComp=toolkit.createComposite(body);
  GridData previewData=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  previewComp.setLayoutData(previewData);
  previewComp.setLayout(new GridLayout());
  createPreviewSection(form,previewComp);
  GridData gdBtn=new GridData();
  gdBtn.horizontalAlignment=SWT.CENTER;
  gdBtn.horizontalSpan=2;
  gdBtn.widthHint=120;
  Button runBtn=toolkit.createButton(form.getBody(),"String_Node_Str",SWT.NONE);
  runBtn.setLayoutData(gdBtn);
  runBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      new RunAnalysisAction().run();
      refreshChart(form);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void createFormContent(IManagedForm managedForm){
  super.createFormContent(managedForm);
  final ScrolledForm form=managedForm.getForm();
  form.setText("String_Node_Str");
  metadataSection.setText("String_Node_Str");
  metadataSection.setDescription("String_Node_Str");
  createAnalysisColumnsSection(form,topComp);
  createDataFilterSection(form,topComp);
  Composite body=form.getBody();
  Composite previewComp=toolkit.createComposite(body);
  GridData previewData=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  previewComp.setLayoutData(previewData);
  previewComp.setLayout(new GridLayout());
  createPreviewSection(form,previewComp);
  GridData gdBtn=new GridData();
  gdBtn.horizontalAlignment=SWT.CENTER;
  gdBtn.horizontalSpan=2;
  gdBtn.widthHint=120;
  Button runBtn=toolkit.createButton(form.getBody(),"String_Node_Str",SWT.NONE);
  runBtn.setLayoutData(gdBtn);
  runBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      new RunAnalysisAction().run();
      while (!RunAnalysisAction.finishFlag) {
        try {
          Thread.sleep(3000);
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
      }
      refreshChart(form);
    }
  }
);
}
Program: 140683
Project: 140683
Buggy source:
private static CategoryDataset createPatternMatchDataset(List<IndicatorUnit> indicatorUnitList,boolean isCreate){
  DefaultCategoryDataset dataset=new DefaultCategoryDataset();
  if (isCreate) {
    int i=0;
    for (    IndicatorUnit unit : indicatorUnitList) {
      IndicatorCommonUtil.compositeIndicatorMap(unit);
      String label=unit.getIndicatorName();
      if (unit.getValue() != null) {
        PatternMatchingExt patternExt=(PatternMatchingExt)unit.getValue();
        double notMathCount=patternExt.getNotMatchingValueCount();
        double machCount=patternExt.getMatchingValueCount();
        dataset.addValue(notMathCount / (notMathCount + machCount),"String_Node_Str",String.valueOf(label + i));
        dataset.addValue(machCount / (notMathCount + machCount),"String_Node_Str",String.valueOf(label + i));
      }
 else {
        dataset.addValue(0,"String_Node_Str","String_Node_Str");
        dataset.addValue(0,"String_Node_Str","String_Node_Str");
      }
      i++;
    }
  }
 else {
    dataset.addValue(0.23,"String_Node_Str","String_Node_Str");
    dataset.addValue(0.77,"String_Node_Str","String_Node_Str");
  }
  return dataset;
}

Fixed version (ground truth):
private static CategoryDataset createPatternMatchDataset(List<IndicatorUnit> indicatorUnitList,boolean isCreate){
  DefaultCategoryDataset dataset=new DefaultCategoryDataset();
  if (isCreate) {
    int i=0;
    for (    IndicatorUnit unit : indicatorUnitList) {
      IndicatorCommonUtil.compositeIndicatorMap(unit);
      String label=unit.getIndicatorName();
      if (unit.getValue() != null) {
        PatternMatchingExt patternExt=(PatternMatchingExt)unit.getValue();
        double notMathCount=patternExt.getNotMatchingValueCount();
        double machCount=patternExt.getMatchingValueCount();
        dataset.addValue(notMathCount / (notMathCount + machCount),"String_Node_Str",label);
        dataset.addValue(machCount / (notMathCount + machCount),"String_Node_Str",label);
      }
 else {
        dataset.addValue(0,"String_Node_Str","String_Node_Str");
        dataset.addValue(0,"String_Node_Str","String_Node_Str");
      }
      i++;
    }
  }
 else {
    dataset.addValue(0.23,"String_Node_Str","String_Node_Str");
    dataset.addValue(0.77,"String_Node_Str","String_Node_Str");
  }
  return dataset;
}
Program: 140684
Project: 140684
Buggy source:
public static IFolderNode[] getFolderNode(EObject eObject){
  IFolderNode[] folderNodes=catalogFolderNodeMap.get(eObject);
  if (folderNodes != null) {
    return folderNodes;
  }
 else   if (SwitchHelpers.CATALOG_SWITCH.doSwitch(eObject) != null) {
    return createTableViewNodes(eObject);
  }
 else   if (SwitchHelpers.SCHEMA_SWITCH.doSwitch(eObject) != null) {
    return createTableViewNodes(eObject);
  }
 else   if (SwitchHelpers.TABLE_SWITCH.doSwitch(eObject) != null) {
    return createColumFolderNodes(eObject);
  }
 else   if (SwitchHelpers.VIEW_SWITCH.doSwitch(eObject) != null) {
    return createColumFolderNodes(eObject);
  }
  return folderNodes;
}

Fixed version (ground truth):
public static IFolderNode getFolderNode(EObject eObject,ColumnSet columnSet){
  IFolderNode[] folderNodes=catalogFolderNodeMap.get(eObject);
  if (folderNodes == null) {
    folderNodes=createTableViewNodes(eObject);
  }
  TdTable doSwitch=SwitchHelpers.TABLE_SWITCH.doSwitch(columnSet);
  if (doSwitch != null) {
    return folderNodes[0];
  }
 else {
    return folderNodes[1];
  }
}
Program: 140685
Project: 140685
Buggy source:
private void initCheckedColumn(ColumnIndicator[] columnIndicators){
  for (int i=0; i < columnIndicators.length; i++) {
    columnIndicators[i].getTdColumn().eContainer();
    ColumnSet columnSetOwner=ColumnHelper.getColumnSetOwner(columnIndicators[i].getTdColumn());
    ColumnSetKey columnSetKey=new ColumnSetKey(columnSetOwner);
    ColumnCheckedMap columnCheckedMap=columnSetCheckedMap.get(columnSetKey);
    if (columnCheckedMap == null) {
      columnCheckedMap=new ColumnCheckedMap();
      this.columnSetCheckedMap.put(columnSetKey,columnCheckedMap);
    }
    columnCheckedMap.putColumnChecked(columnIndicators[i].getTdColumn(),Boolean.TRUE);
  }
}

Fixed version (ground truth):
private void initCheckedColumn(ColumnIndicator[] columnIndicators){
  List<ColumnSet> columnSetList=new ArrayList<ColumnSet>();
  for (int i=0; i < columnIndicators.length; i++) {
    columnIndicators[i].getTdColumn().eContainer();
    ColumnSet columnSetOwner=ColumnHelper.getColumnSetOwner(columnIndicators[i].getTdColumn());
    if (!columnSetList.contains(columnSetOwner)) {
      columnSetList.add(columnSetOwner);
    }
    ColumnSetKey columnSetKey=new ColumnSetKey(columnSetOwner);
    ColumnCheckedMap columnCheckedMap=columnSetCheckedMap.get(columnSetKey);
    if (columnCheckedMap == null) {
      columnCheckedMap=new ColumnCheckedMap();
      this.columnSetCheckedMap.put(columnSetKey,columnCheckedMap);
    }
    columnCheckedMap.putColumnChecked(columnIndicators[i].getTdColumn(),Boolean.TRUE);
  }
  this.setInitialElementSelections(columnSetList);
}
Program: 140686
Project: 140686
Buggy source:
public void run(){
  parentCreate();
  fViewer.setCheckedElements(getInitialElementSelections().toArray());
  if (fExpandedElements != null) {
    fViewer.setExpandedElements(fExpandedElements);
  }
  updateOKStatus();
}

Fixed version (ground truth):
public void run(){
  parentCreate();
  fViewer.setCheckedElements(getInitialElementSelections().toArray());
  updateOKStatus();
}
Program: 140687
Project: 140687
Buggy source:
public void create(){
  BusyIndicator.showWhile(null,new Runnable(){
    public void run(){
      parentCreate();
      fViewer.setCheckedElements(getInitialElementSelections().toArray());
      if (fExpandedElements != null) {
        fViewer.setExpandedElements(fExpandedElements);
      }
      updateOKStatus();
    }
  }
);
}

Fixed version (ground truth):
public void create(){
  BusyIndicator.showWhile(null,new Runnable(){
    public void run(){
      parentCreate();
      fViewer.setCheckedElements(getInitialElementSelections().toArray());
      updateOKStatus();
    }
  }
);
}
Program: 140688
Project: 140688
Buggy source:
/** 
 * Add the checked listener for treeviewer or tableviewer.
 */
protected void addCheckedListener(){
  fViewer.addCheckStateListener(new ICheckStateListener(){
    public void checkStateChanged(    CheckStateChangedEvent event){
      if (event.getChecked()) {
        fViewer.setSubtreeChecked(event.getElement(),true);
      }
 else {
        fViewer.setSubtreeChecked(event.getElement(),false);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Add the checked listener for treeviewer or tableviewer.
 */
protected void addCheckedListener(){
}
Program: 140689
Project: 140689
Buggy source:
/** 
 * Creates the tree viewer.
 * @param parent the parent composite
 * @return the tree viewer
 */
protected CheckboxTreeViewer createFirstPart(Composite parent){
  if (fContainerMode) {
    fViewer=new ContainerCheckedTreeViewer(parent,SWT.BORDER){
      protected void handleTreeExpand(      TreeEvent event){
        super.handleTreeExpand(event);
        checkElementChecked();
      }
    }
;
  }
 else {
    fViewer=new CheckboxTreeViewer(parent,SWT.BORDER){
      protected void handleTreeExpand(      TreeEvent event){
        super.handleTreeExpand(event);
        checkElementChecked();
      }
    }
;
  }
  fViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
  applyDialogFont(fViewer.getTree());
  fViewer.setContentProvider(fContentProvider);
  fViewer.setLabelProvider(fLabelProvider);
  fViewer.addCheckStateListener(new ICheckStateListener(){
    public void checkStateChanged(    CheckStateChangedEvent event){
      updateOKStatus();
    }
  }
);
  fViewer.setComparator(fComparator);
  if (fFilters != null) {
    for (int i=0; i != fFilters.size(); i++) {
      fViewer.addFilter((ViewerFilter)fFilters.get(i));
    }
  }
  fViewer.setInput(fInput);
  fViewer.addSelectionChangedListener(this);
  return fViewer;
}

Fixed version (ground truth):
/** 
 * Creates the tree viewer.
 * @param parent the parent composite
 * @return the tree viewer
 */
protected CheckboxTreeViewer createFirstPart(Composite parent){
  if (fContainerMode) {
    fViewer=new ContainerCheckedTreeViewer(parent,SWT.BORDER);
  }
 else {
    fViewer=new CheckboxTreeViewer(parent,SWT.BORDER){
      protected void handleTreeExpand(      TreeEvent event){
        super.handleTreeExpand(event);
      }
    }
;
  }
  fViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
  applyDialogFont(fViewer.getTree());
  fViewer.setContentProvider(fContentProvider);
  fViewer.setLabelProvider(fLabelProvider);
  fViewer.addCheckStateListener(new ICheckStateListener(){
    public void checkStateChanged(    CheckStateChangedEvent event){
      updateOKStatus();
    }
  }
);
  fViewer.setComparator(fComparator);
  if (fFilters != null) {
    for (int i=0; i != fFilters.size(); i++) {
      fViewer.addFilter((ViewerFilter)fFilters.get(i));
    }
  }
  fViewer.setInput(fInput);
  fViewer.addSelectionChangedListener(this);
  return fViewer;
}
Program: 140690
Project: 140690
Buggy source:
protected void handleTreeExpand(TreeEvent event){
  super.handleTreeExpand(event);
  checkElementChecked();
}

Fixed version (ground truth):
protected void handleTreeExpand(TreeEvent event){
  super.handleTreeExpand(event);
}
Program: 140691
Project: 140691
Buggy source:
/** 
 * Constructs an instance of <code>ElementTreeSelectionDialog</code>.
 * @param parent The shell to parent from.
 * @param labelProvider the label provider to render the entries
 * @param contentProvider the content provider to evaluate the tree structure
 */
@SuppressWarnings("String_Node_Str") public TwoPartCheckSelectionDialog(Shell parent,String message){
  super(parent);
  setResult(new ArrayList(0));
  setStatusLineAboveButtons(true);
  fContainerMode=false;
  fExpandedElements=null;
  int shellStyle=getShellStyle();
  setShellStyle(shellStyle | SWT.MAX | SWT.RESIZE);
  setMessage(message);
  initProvider();
}

Fixed version (ground truth):
/** 
 * Constructs an instance of <code>ElementTreeSelectionDialog</code>.
 * @param parent The shell to parent from.
 * @param labelProvider the label provider to render the entries
 * @param contentProvider the content provider to evaluate the tree structure
 */
@SuppressWarnings("String_Node_Str") public TwoPartCheckSelectionDialog(Shell parent,String message){
  super(parent);
  setResult(new ArrayList(0));
  setStatusLineAboveButtons(true);
  fContainerMode=true;
  fExpandedElements=null;
  int shellStyle=getShellStyle();
  setShellStyle(shellStyle | SWT.MAX | SWT.RESIZE);
  setMessage(message);
  initProvider();
}
Program: 140692
Project: 140692
Buggy source:
public Object[] getChildren(Object parentElement){
  if (parentElement instanceof IFile) {
    IFile file=(IFile)parentElement;
    if (file.getName().endsWith(PluginConstant.REP_SUFFIX)) {
      TdReport findReport=RepResourceFileHelper.getInstance().findReport(file);
      Object[] array=ReportHelper.getAnalyses(findReport).toArray();
      return ComparatorsFactory.sort(array,ComparatorsFactory.MODELELEMENT_COMPARATOR_ID);
    }
    parentElement=PrvResourceFileHelper.getInstance().getFileResource(file);
  }
 else   if (parentElement instanceof IFolderNode) {
    IFolderNode folerNode=(IFolderNode)parentElement;
    if (!(folerNode.isLoaded())) {
      folerNode.loadChildren();
    }
    return ComparatorsFactory.sort(folerNode.getChildren(),ComparatorsFactory.MODELELEMENT_COMPARATOR_ID);
  }
 else   if (SwitchHelpers.CATALOG_SWITCH.doSwitch((EObject)parentElement) != null) {
    if (CatalogHelper.getSchemas(SwitchHelpers.CATALOG_SWITCH.doSwitch((EObject)parentElement)).size() > 0) {
      return ComparatorsFactory.sort(super.getChildren(parentElement),ComparatorsFactory.MODELELEMENT_COMPARATOR_ID);
    }
 else {
      return FolderNodeHelper.getFolderNode((EObject)parentElement);
    }
  }
 else {
    return FolderNodeHelper.getFolderNode((EObject)parentElement);
  }
  return ComparatorsFactory.sort(super.getChildren(parentElement),ComparatorsFactory.MODELELEMENT_COMPARATOR_ID);
}

Fixed version (ground truth):
public Object[] getChildren(Object parentElement){
  if (parentElement instanceof IFile) {
    IFile file=(IFile)parentElement;
    if (file.getName().endsWith(PluginConstant.REP_SUFFIX)) {
      TdReport findReport=RepResourceFileHelper.getInstance().findReport(file);
      Object[] array=ReportHelper.getAnalyses(findReport).toArray();
      return ComparatorsFactory.sort(array,ComparatorsFactory.MODELELEMENT_COMPARATOR_ID);
    }
    parentElement=PrvResourceFileHelper.getInstance().getFileResource(file);
  }
 else   if (parentElement instanceof IFolderNode) {
    IFolderNode folerNode=(IFolderNode)parentElement;
    if (!(folerNode.isLoaded())) {
      folerNode.loadChildren();
    }
    return ComparatorsFactory.sort(folerNode.getChildren(),ComparatorsFactory.MODELELEMENT_COMPARATOR_ID);
  }
 else   if (SwitchHelpers.CATALOG_SWITCH.doSwitch((EObject)parentElement) != null) {
    if (CatalogHelper.getSchemas(SwitchHelpers.CATALOG_SWITCH.doSwitch((EObject)parentElement)).size() > 0) {
      return ComparatorsFactory.sort(super.getChildren(parentElement),ComparatorsFactory.MODELELEMENT_COMPARATOR_ID);
    }
 else {
      return FolderNodeHelper.getFolderNodes((EObject)parentElement);
    }
  }
 else {
    return FolderNodeHelper.getFolderNodes((EObject)parentElement);
  }
  return ComparatorsFactory.sort(super.getChildren(parentElement),ComparatorsFactory.MODELELEMENT_COMPARATOR_ID);
}
Program: 140693
Project: 140693
Buggy source:
@Override protected void createFormContent(IManagedForm managedForm){
  final ScrolledForm form=managedForm.getForm();
  Composite body=form.getBody();
  form.setText("String_Node_Str");
  body.setLayout(new GridLayout(2,true));
  topComp=toolkit.createComposite(body);
  GridData anasisData=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  topComp.setLayoutData(anasisData);
  topComp.setLayout(new GridLayout(1,false));
  metadataSection=creatMetadataSection(form,topComp);
}

Fixed version (ground truth):
@Override protected void createFormContent(IManagedForm managedForm){
  final ScrolledForm form=managedForm.getForm();
  Composite body=form.getBody();
  body.setLayout(new GridLayout(2,true));
  topComp=toolkit.createComposite(body);
  GridData anasisData=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  topComp.setLayoutData(anasisData);
  topComp.setLayout(new GridLayout(1,false));
  metadataSection=creatMetadataSection(form,topComp);
}
Program: 140694
Project: 140694
Buggy source:
@Override protected void createFormContent(IManagedForm managedForm){
  super.createFormContent(managedForm);
  final ScrolledForm form=managedForm.getForm();
  metadataSection.setText("String_Node_Str");
  metadataSection.setDescription("String_Node_Str");
  createAnalysisColumnsSection(form,topComp);
  createDataFilterSection(form,topComp);
  Composite body=form.getBody();
  Composite previewComp=toolkit.createComposite(body);
  GridData previewData=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  previewComp.setLayoutData(previewData);
  previewComp.setLayout(new GridLayout());
  createPreviewSection(form,previewComp);
  GridData gdBtn=new GridData();
  gdBtn.horizontalAlignment=SWT.CENTER;
  gdBtn.horizontalSpan=2;
  gdBtn.widthHint=120;
  Button runBtn=toolkit.createButton(form.getBody(),"String_Node_Str",SWT.NONE);
  runBtn.setLayoutData(gdBtn);
  runBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      new RunAnalysisAction().run();
      refreshChart(form);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void createFormContent(IManagedForm managedForm){
  super.createFormContent(managedForm);
  final ScrolledForm form=managedForm.getForm();
  form.setText("String_Node_Str");
  metadataSection.setText("String_Node_Str");
  metadataSection.setDescription("String_Node_Str");
  createAnalysisColumnsSection(form,topComp);
  createDataFilterSection(form,topComp);
  Composite body=form.getBody();
  Composite previewComp=toolkit.createComposite(body);
  GridData previewData=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  previewComp.setLayoutData(previewData);
  previewComp.setLayout(new GridLayout());
  createPreviewSection(form,previewComp);
  GridData gdBtn=new GridData();
  gdBtn.horizontalAlignment=SWT.CENTER;
  gdBtn.horizontalSpan=2;
  gdBtn.widthHint=120;
  Button runBtn=toolkit.createButton(form.getBody(),"String_Node_Str",SWT.NONE);
  runBtn.setLayoutData(gdBtn);
  runBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      new RunAnalysisAction().run();
      refreshChart(form);
    }
  }
);
}
Program: 140695
Project: 140695
Buggy source:
@Override protected void createFormContent(IManagedForm managedForm){
  super.createFormContent(managedForm);
  final ScrolledForm form=managedForm.getForm();
  this.metadataSection.setText("String_Node_Str");
  this.metadataSection.setDescription("String_Node_Str");
  createInformationSection(form,topComp);
  Button checkBtn=toolkit.createButton(topComp,"String_Node_Str",SWT.NONE);
  GridData gd=new GridData();
  gd.verticalSpan=20;
  gd.horizontalAlignment=SWT.CENTER;
  checkBtn.setLayoutData(gd);
  checkBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      ReturnCode code=checkDBConnection();
      if (code.isOk()) {
        MessageDialog.openInformation(null,"String_Node_Str","String_Node_Str");
      }
 else {
        MessageDialog.openInformation(null,"String_Node_Str","String_Node_Str" + code.getMessage());
      }
    }
  }
);
}

Fixed version (ground truth):
@Override protected void createFormContent(IManagedForm managedForm){
  super.createFormContent(managedForm);
  final ScrolledForm form=managedForm.getForm();
  form.setText("String_Node_Str");
  this.metadataSection.setText("String_Node_Str");
  this.metadataSection.setDescription("String_Node_Str");
  createInformationSection(form,topComp);
  Button checkBtn=toolkit.createButton(topComp,"String_Node_Str",SWT.NONE);
  GridData gd=new GridData();
  gd.verticalSpan=20;
  gd.horizontalAlignment=SWT.CENTER;
  checkBtn.setLayoutData(gd);
  checkBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      ReturnCode code=checkDBConnection();
      if (code.isOk()) {
        MessageDialog.openInformation(null,"String_Node_Str","String_Node_Str");
      }
 else {
        MessageDialog.openInformation(null,"String_Node_Str","String_Node_Str" + code.getMessage());
      }
    }
  }
);
}
Program: 140696
Project: 140696
Buggy source:
@Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
  monitor.beginTask("String_Node_Str" + analysis.getName() + "String_Node_Str",IProgressMonitor.UNKNOWN);
  try {
    Thread.sleep(5000);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  final ReturnCode executed=finalExec.execute(finalAnalysis);
  monitor.done();
  if (executed.isOk()) {
    if (log.isInfoEnabled()) {
      int executionDuration=analysis.getResults().getResultMetadata().getExecutionDuration();
      log.info("String_Node_Str" + finalAnalysis.getName() + "String_Node_Str"+ executed+ "String_Node_Str"+ FORMAT_SECONDS.format(Double.valueOf(executionDuration) / 1000)+ "String_Node_Str");
    }
    AnaResourceFileHelper.getInstance().save(finalAnalysis);
    return Status.OK_STATUS;
  }
 else {
    int executionDuration=analysis.getResults().getResultMetadata().getExecutionDuration();
    log.warn("String_Node_Str" + finalAnalysis.getName() + "String_Node_Str"+ executed+ "String_Node_Str"+ FORMAT_SECONDS.format(Double.valueOf(executionDuration) / 1000)+ "String_Node_Str");
    Display.getDefault().asyncExec(new Runnable(){
      public void run(){
        MessageDialogWithToggle.openError(null,"String_Node_Str","String_Node_Str" + finalAnalysis.getName() + "String_Node_Str"+ executed.getMessage());
      }
    }
);
    return Status.CANCEL_STATUS;
  }
}

Fixed version (ground truth):
@Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
  monitor.beginTask("String_Node_Str" + analysis.getName() + "String_Node_Str",IProgressMonitor.UNKNOWN);
  final ReturnCode executed=finalExec.execute(finalAnalysis);
  monitor.done();
  if (executed.isOk()) {
    if (log.isInfoEnabled()) {
      int executionDuration=analysis.getResults().getResultMetadata().getExecutionDuration();
      log.info("String_Node_Str" + finalAnalysis.getName() + "String_Node_Str"+ executed+ "String_Node_Str"+ FORMAT_SECONDS.format(Double.valueOf(executionDuration) / 1000)+ "String_Node_Str");
    }
    AnaResourceFileHelper.getInstance().save(finalAnalysis);
    return Status.OK_STATUS;
  }
 else {
    int executionDuration=analysis.getResults().getResultMetadata().getExecutionDuration();
    log.warn("String_Node_Str" + finalAnalysis.getName() + "String_Node_Str"+ executed+ "String_Node_Str"+ FORMAT_SECONDS.format(Double.valueOf(executionDuration) / 1000)+ "String_Node_Str");
    Display.getDefault().asyncExec(new Runnable(){
      public void run(){
        MessageDialogWithToggle.openError(null,"String_Node_Str","String_Node_Str" + finalAnalysis.getName() + "String_Node_Str"+ executed.getMessage());
      }
    }
);
    return Status.CANCEL_STATUS;
  }
}
Program: 140697
Project: 140697
Buggy source:
@Override protected boolean check(Analysis analysis){
  if (analysis.getContext().getAnalysedElements().size() == 0) {
    if (analysis.getContext().getConnection() == null) {
      this.errorMessage="String_Node_Str";
      return false;
    }
    this.errorMessage="String_Node_Str";
    return false;
  }
  if (analysis != null) {
    ColumnAnalysisHandler analysisHandler=new ColumnAnalysisHandler();
    analysisHandler.setAnalysis(analysis);
    for (    ModelElement node : analysis.getContext().getAnalysedElements()) {
      TdColumn column=SwitchHelpers.COLUMN_SWITCH.doSwitch(node);
      if (analysisHandler.getIndicators(column).size() == 0) {
        this.errorMessage="String_Node_Str" + "String_Node_Str";
        return false;
      }
    }
  }
  return super.check(analysis);
}

Fixed version (ground truth):
@Override protected boolean check(final Analysis analysis){
  if (analysis == null) {
    this.errorMessage="String_Node_Str";
    return false;
  }
  if (!super.check(analysis)) {
    return false;
  }
  AnalysisContext context=analysis.getContext();
  if (context == null) {
    this.errorMessage="String_Node_Str" + analysis.getName();
    return false;
  }
  if (context.getAnalysedElements().size() == 0) {
    this.errorMessage="String_Node_Str";
    return false;
  }
  if (context.getConnection() == null) {
    this.errorMessage="String_Node_Str";
    return false;
  }
  ColumnAnalysisHandler analysisHandler=new ColumnAnalysisHandler();
  analysisHandler.setAnalysis(analysis);
  for (  ModelElement node : context.getAnalysedElements()) {
    TdColumn column=SwitchHelpers.COLUMN_SWITCH.doSwitch(node);
    if (analysisHandler.getIndicators(column).size() == 0) {
      this.errorMessage="String_Node_Str" + "String_Node_Str";
      return false;
    }
    TdDataProvider dp=DataProviderHelper.getTdDataProvider(column);
    if (!isAccessWith(dp)) {
      this.errorMessage="String_Node_Str" + column.getName() + "String_Node_Str"+ dataprovider.getName()+ "String_Node_Str";
      return false;
    }
  }
  return true;
}
Program: 140699
Project: 140699
Buggy source:
@Override public boolean performFinish(){
  Pattern pattern=PatternFactory.eINSTANCE.createPattern();
  String name=AbstractWizardPage.getConnectionParams().getName();
  pattern.setName(name);
  RegularExpression regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  Expression expression=CoreFactory.eINSTANCE.createExpression();
  String expr=mPage2.getNameText().getText();
  expression.setBody(expr);
  expression.setLanguage("String_Node_Str");
  regularExpr.setExpression(expression);
  pattern.getComponents().add(regularExpr);
  EMFUtil util=EMFSharedResources.getSharedEmfUtil();
  IPath location=folder.getLocation();
  String fname=DqRepositoryViewService.createFilename(folder.getName(),name,NewSourcePatternActionProvider.EXTENSION_PATTERN);
  location=location.removeLastSegments(1);
  location=location.append(fname);
  util.addPoolToResourceSet(new File(location.toPortableString()),pattern);
  util.saveLastResource();
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  Pattern pattern=PatternFactory.eINSTANCE.createPattern();
  String name=AbstractWizardPage.getConnectionParams().getName();
  pattern.setName(name);
  TaggedValueHelper.setAuthor(pattern,AbstractWizardPage.getConnectionParams().getAuthor());
  TaggedValueHelper.setDescription(AbstractWizardPage.getConnectionParams().getDescription(),pattern);
  TaggedValueHelper.setPurpose(AbstractWizardPage.getConnectionParams().getPurpose(),pattern);
  TaggedValueHelper.setDevStatus(pattern,DevelopmentStatus.get(AbstractWizardPage.getConnectionParams().getStatus()));
  RegularExpression regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  Expression expression=CoreFactory.eINSTANCE.createExpression();
  String expr=mPage2.getNameText().getText();
  expression.setBody(expr);
  String cl=mPage2.getComboLang();
  expression.setLanguage(cl);
  regularExpr.setExpression(expression);
  pattern.getComponents().add(regularExpr);
  EMFUtil util=EMFSharedResources.getSharedEmfUtil();
  IPath location=folder.getLocation();
  String fname=DqRepositoryViewService.createFilename(folder.getName(),name,NewSourcePatternActionProvider.EXTENSION_PATTERN);
  location=location.removeLastSegments(1);
  location=location.append(fname);
  util.addPoolToResourceSet(new File(location.toPortableString()),pattern);
  util.saveLastResource();
  return true;
}
Program: 140700
Project: 140700
Buggy source:
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  GridLayout gdLayout=new GridLayout(2,false);
  container.setLayout(gdLayout);
  GridData data;
  Label nameLab=new Label(container,SWT.NONE);
  nameLab.setText("String_Node_Str");
  nameText=new Text(container,SWT.BORDER);
  nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  Label pathLab=new Label(container,SWT.NONE);
  pathLab.setText("String_Node_Str");
  Composite pathContainer=new Composite(container,SWT.NONE);
  pathContainer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  GridLayout pathLayout=new GridLayout(2,false);
  pathLayout.marginHeight=0;
  pathLayout.marginWidth=0;
  pathLayout.horizontalSpacing=0;
  pathContainer.setLayout(pathLayout);
  pathText=new Text(pathContainer,SWT.BORDER);
  pathText.setEnabled(false);
  pathText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  button=new Button(pathContainer,SWT.PUSH);
  button.setText("String_Node_Str");
  defaultFolderProviderRes=ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.LIBRARIES).getFolder(DQStructureManager.PATTERNS);
  pathText.setText(defaultFolderProviderRes.getFullPath().toString());
  setControl(container);
  nameText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      metadata.put(IParameterConstant.ANALYSIS_NAME,nameText.getText());
      getConnectionParams().setMetadate(metadata);
      setPageComplete(true);
    }
  }
);
  button.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      openFolderSelectionDialog(DQStructureManager.LIBRARIES,DQStructureManager.PATTERNS);
    }
  }
);
  if (getControl() != null) {
    try {
      PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),HelpPlugin.PATTERN_CONTEXT_HELP_ID);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  container.setLayout(new FillLayout());
  super.createControl(container);
  defaultFolderProviderRes=ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.LIBRARIES).getFolder(DQStructureManager.PATTERNS);
  pathText.setText(defaultFolderProviderRes.getFullPath().toString());
  setControl(container);
  button.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      openFolderSelectionDialog(DQStructureManager.LIBRARIES,DQStructureManager.PATTERNS);
    }
  }
);
  if (getControl() != null) {
    try {
      PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),HelpPlugin.PATTERN_CONTEXT_HELP_ID);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 140701
Project: 140701
Buggy source:
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  GridLayout gdLayout=new GridLayout(2,false);
  container.setLayout(gdLayout);
  GridData data;
  Label nameLab=new Label(container,SWT.NONE);
  nameLab.setText("String_Node_Str");
  nameText=new Text(container,SWT.BORDER | SWT.MULTI | SWT.H_SCROLL| SWT.V_SCROLL);
  nameText.setLayoutData(new GridData(GridData.FILL_BOTH));
  setControl(container);
  nameText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      setPageComplete(true);
    }
  }
);
  if (getControl() != null) {
    try {
      PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),HelpPlugin.PATTERN_CONTEXT_HELP_ID);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  GridLayout gdLayout=new GridLayout(2,false);
  container.setLayout(gdLayout);
  GridData data;
  Label nameLab=new Label(container,SWT.NONE);
  nameLab.setText("String_Node_Str");
  nameText=new Text(container,SWT.BORDER);
  nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  setControl(container);
  nameText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      setPageComplete(true);
    }
  }
);
  if (getControl() != null) {
    try {
      PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),HelpPlugin.PATTERN_CONTEXT_HELP_ID);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  nameLab=new Label(container,SWT.NONE);
  nameLab.setText("String_Node_Str");
  String[] types=SupportDBUrlStore.getInstance().getDBTypes();
  comboLang=new Combo(container,SWT.BORDER);
  comboLang.setItems(types);
  comboLang.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  if (types.length > 0) {
    comboLang.select(0);
  }
}
Program: 140702
Project: 140702
Buggy source:
@Override protected void fillCoolBar(ICoolBarManager coolBar){
  IToolBarManager toolbar=new ToolBarManager(SWT.FLAT | SWT.RIGHT);
  coolBar.add(new ToolBarContributionItem(toolbar,"String_Node_Str"));
  toolbar.add(new ChangePerspectiveAction(true));
}

Fixed version (ground truth):
@Override protected void fillCoolBar(ICoolBarManager coolBar){
  IToolBarManager toolbar=new ToolBarManager(SWT.FLAT | SWT.RIGHT);
  coolBar.add(new ToolBarContributionItem(toolbar,"String_Node_Str"));
  toolbar.add(ActionFactory.SAVE.create(window));
  toolbar.add(new ChangePerspectiveAction(true));
}
Program: 140703
Project: 140703
Buggy source:
protected void makeActions(IWorkbenchWindow window){
  exitAction=ActionFactory.QUIT.create(window);
  register(exitAction);
  colseAction=ActionFactory.CLOSE.create(window);
  colseAllAction=ActionFactory.CLOSE_ALL.create(window);
  saveAction=ActionFactory.SAVE.create(window);
  register(saveAction);
  saveAllAction=ActionFactory.SAVE_ALL.create(window);
  register(saveAllAction);
  register(ActionFactory.DELETE.create(window));
  preferenceAction=ActionFactory.PREFERENCES.create(window);
  register(preferenceAction);
  welcomeAction=ActionFactory.INTRO.create(window);
  register(welcomeAction);
  helpAction=ActionFactory.HELP_CONTENTS.create(window);
  register(helpAction);
  aboutAction=ActionFactory.ABOUT.create(window);
  register(aboutAction);
  resetPerspectiveAction=ActionFactory.RESET_PERSPECTIVE.create(window);
  register(resetPerspectiveAction);
}

Fixed version (ground truth):
protected void makeActions(IWorkbenchWindow window){
  this.window=window;
  exitAction=ActionFactory.QUIT.create(window);
  register(exitAction);
  colseAction=ActionFactory.CLOSE.create(window);
  colseAllAction=ActionFactory.CLOSE_ALL.create(window);
  saveAction=ActionFactory.SAVE.create(window);
  register(saveAction);
  saveAllAction=ActionFactory.SAVE_ALL.create(window);
  register(saveAllAction);
  register(ActionFactory.DELETE.create(window));
  preferenceAction=ActionFactory.PREFERENCES.create(window);
  register(preferenceAction);
  welcomeAction=ActionFactory.INTRO.create(window);
  register(welcomeAction);
  helpAction=ActionFactory.HELP_CONTENTS.create(window);
  register(helpAction);
  aboutAction=ActionFactory.ABOUT.create(window);
  register(aboutAction);
  resetPerspectiveAction=ActionFactory.RESET_PERSPECTIVE.create(window);
  register(resetPerspectiveAction);
}
Program: 140704
Project: 140704
Buggy source:
public DeleteCWMResourceAction(){
  super(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
  this.shell=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.ACTION_DELETE));
}

Fixed version (ground truth):
public DeleteCWMResourceAction(){
  super(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
  this.shell=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.DELETE_ACTION));
}
Program: 140705
Project: 140705
Buggy source:
public RemoveAnalysisAction(){
  super("String_Node_Str");
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.ACTION_DELETE));
}

Fixed version (ground truth):
public RemoveAnalysisAction(){
  super("String_Node_Str");
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.DELETE_ACTION));
}
Program: 140706
Project: 140706
Buggy source:
/** 
 * @param parent
 */
private Tree createTree(Composite parent){
  final Tree newTree=new Tree(parent,SWT.MULTI);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).grab(true,true).applyTo(newTree);
  newTree.setHeaderVisible(false);
  TreeColumn column1=new TreeColumn(newTree,SWT.CENTER);
  column1.setWidth(190);
  TreeColumn column2=new TreeColumn(newTree,SWT.CENTER);
  column2.setWidth(80);
  TreeColumn column3=new TreeColumn(newTree,SWT.CENTER);
  column3.setWidth(120);
  parent.layout();
  Menu menu=new Menu(newTree);
  MenuItem deleteMenuItem=new MenuItem(menu,SWT.CASCADE);
  deleteMenuItem.setText("String_Node_Str");
  deleteMenuItem.setImage(ImageLib.getImage(ImageLib.ACTION_DELETE));
  deleteMenuItem.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      removeSelectedElements(newTree);
    }
  }
);
  newTree.setMenu(menu);
  AbstractAnalysisActionHandler actionHandler=new AbstractAnalysisActionHandler(parent){
    @Override protected void handleRemove(){
      removeSelectedElements(newTree);
    }
  }
;
  parent.setData(AbstractFormPage.ACTION_HANDLER,actionHandler);
  PatternDNDFactory.installDND(newTree);
  return newTree;
}

Fixed version (ground truth):
/** 
 * @param parent
 */
private Tree createTree(Composite parent){
  final Tree newTree=new Tree(parent,SWT.MULTI);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).grab(true,true).applyTo(newTree);
  newTree.setHeaderVisible(false);
  TreeColumn column1=new TreeColumn(newTree,SWT.CENTER);
  column1.setWidth(190);
  TreeColumn column2=new TreeColumn(newTree,SWT.CENTER);
  column2.setWidth(80);
  TreeColumn column3=new TreeColumn(newTree,SWT.CENTER);
  column3.setWidth(120);
  parent.layout();
  Menu menu=new Menu(newTree);
  MenuItem deleteMenuItem=new MenuItem(menu,SWT.CASCADE);
  deleteMenuItem.setText("String_Node_Str");
  deleteMenuItem.setImage(ImageLib.getImage(ImageLib.DELETE_ACTION));
  deleteMenuItem.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      removeSelectedElements(newTree);
    }
  }
);
  newTree.setMenu(menu);
  AbstractAnalysisActionHandler actionHandler=new AbstractAnalysisActionHandler(parent){
    @Override protected void handleRemove(){
      removeSelectedElements(newTree);
    }
  }
;
  parent.setData(AbstractFormPage.ACTION_HANDLER,actionHandler);
  PatternDNDFactory.installDND(newTree);
  return newTree;
}
Program: 140709
Project: 140709
Buggy source:
public void widgetSelected(SelectionEvent e){
  tempPatternComponents.remove(finalRegExpress);
  expressComp.dispose();
  sectionComp.layout();
  setDirty(true);
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  tempPatternComponents.remove(finalRegExpress);
  expressComp.dispose();
  sectionComp.layout();
  form.reflow(true);
  setDirty(true);
}
Program: 140711
Project: 140711
Buggy source:
private void createAddButton(final ScrolledForm form){
  final Button addButton=new Button(sectionComp,SWT.NONE);
  addButton.setText("String_Node_Str");
  addButton.setToolTipText("String_Node_Str");
  GridData gdButton=new GridData();
  gdButton.horizontalAlignment=SWT.CENTER;
  gdButton.widthHint=65;
  addButton.setLayoutData(gdButton);
  addButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      Expression expression=CoreFactory.eINSTANCE.createExpression();
      expression.setLanguage(SQL);
      RegularExpressionImpl newRegularExpress=(RegularExpressionImpl)PatternFactory.eINSTANCE.createRegularExpression();
      newRegularExpress.setExpression(expression);
      creatNewExpressLine(newRegularExpress);
      tempPatternComponents.add(newRegularExpress);
      form.reflow(true);
      setDirty(true);
    }
  }
);
}

Fixed version (ground truth):
private void createAddButton(final ScrolledForm form){
  final Button addButton=new Button(sectionComp,SWT.NONE);
  addButton.setImage(ImageLib.getImage(ImageLib.ADD_ACTION));
  addButton.setToolTipText("String_Node_Str");
  GridData labelGd=new GridData();
  labelGd.horizontalAlignment=SWT.CENTER;
  labelGd.widthHint=65;
  addButton.setLayoutData(labelGd);
  addButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      Expression expression=CoreFactory.eINSTANCE.createExpression();
      expression.setLanguage(SQL);
      RegularExpressionImpl newRegularExpress=(RegularExpressionImpl)PatternFactory.eINSTANCE.createRegularExpression();
      newRegularExpress.setExpression(expression);
      creatNewExpressLine(form,newRegularExpress);
      tempPatternComponents.add(newRegularExpress);
      form.reflow(true);
      setDirty(true);
    }
  }
);
}
Program: 140712
Project: 140712
Buggy source:
private void creatPatternDefinitionSection(ScrolledForm form,Composite topComp){
  Section section=createSection(form,topComp,"String_Node_Str",false,null);
  sectionComp=toolkit.createComposite(section);
  sectionComp.setLayout(new GridLayout());
  componentsComp=new Composite(sectionComp,SWT.NONE);
  componentsComp.setLayout(new GridLayout());
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).grab(true,false).applyTo(componentsComp);
  EList<PatternComponent> components=this.pattern.getComponents();
  for (int i=0; i < components.size(); i++) {
    RegularExpressionImpl regularExpress=(RegularExpressionImpl)components.get(i);
    creatNewExpressLine(regularExpress);
  }
  createAddButton(form);
  section.setClient(sectionComp);
}

Fixed version (ground truth):
private void creatPatternDefinitionSection(ScrolledForm form,Composite topComp){
  Section section=createSection(form,topComp,"String_Node_Str",false,null);
  sectionComp=toolkit.createComposite(section);
  sectionComp.setLayout(new GridLayout());
  componentsComp=new Composite(sectionComp,SWT.NONE);
  componentsComp.setLayout(new GridLayout());
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).grab(true,false).applyTo(componentsComp);
  EList<PatternComponent> components=this.pattern.getComponents();
  for (int i=0; i < components.size(); i++) {
    RegularExpressionImpl regularExpress=(RegularExpressionImpl)components.get(i);
    creatNewExpressLine(form,regularExpress);
  }
  createAddButton(form);
  section.setClient(sectionComp);
}
Program: 140713
Project: 140713
Buggy source:
@Override protected void initialize(){
  if (parameter == null) {
    parameter=new TextLengthParameter();
  }
 else {
    nullBtn.setSelection(parameter.isUseNull());
    blankBtn.setSelection(parameter.isUseBlank());
  }
}

Fixed version (ground truth):
@Override protected void initialize(){
  if (parameter == null) {
    parameter=new TextLengthParameter();
    parameter.setUseBlank(true);
  }
  nullBtn.setSelection(parameter.isUseNull());
  blankBtn.setSelection(parameter.isUseBlank());
}