nus-yam/ex-repair huggingface dataset:
Program: 140579
Project: 140579
Buggy source:
@SuppressWarnings("String_Node_Str") public Object[] getChildren(Object parentElement){
  if (parentElement instanceof IContainer) {
    IContainer container=((IContainer)parentElement);
    IResource[] members=null;
    try {
      members=container.members();
    }
 catch (    CoreException e) {
      log.error("String_Node_Str" + container.getLocation());
    }
    if (container.equals(ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.METADATA).getFolder(DQStructureManager.DB_CONNECTIONS))) {
      ComparatorsFactory.sort(members,ComparatorsFactory.FILEMODEL_COMPARATOR_ID);
    }
    return members;
  }
 else   if (parentElement instanceof NamedColumnSet) {
    return null;
  }
 else   if (parentElement instanceof NamedColumnSetFolderNode) {
    NamedColumnSetFolderNode folerNode=(NamedColumnSetFolderNode)parentElement;
    if (!(folerNode.isLoaded())) {
      folerNode.loadChildren();
    }
    Object[] children=folerNode.getChildren();
    if (children != null && children.length > 0) {
      if (!(children[0] instanceof ColumnSet)) {
        return children;
      }
      for (int i=0; i < children.length; i++) {
        ColumnSet columnSet=(ColumnSet)children[i];
        ColumnSetKey key=new ColumnSetKey(columnSet);
        if (columnSetCheckedMap.containsKey(key)) {
          currentCheckedColumnSet.add(columnSet);
        }
      }
    }
    return ComparatorsFactory.sort(children,ComparatorsFactory.MODELELEMENT_COMPARATOR_ID);
  }
  return super.getChildren(parentElement);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Object[] getChildren(Object parentElement){
  if (parentElement instanceof IContainer) {
    IContainer container=((IContainer)parentElement);
    IResource[] members=null;
    try {
      members=container.members();
    }
 catch (    CoreException e) {
      log.error("String_Node_Str" + container.getLocation());
    }
    if (container.equals(ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.METADATA).getFolder(DQStructureManager.DB_CONNECTIONS))) {
      ComparatorsFactory.sort(members,ComparatorsFactory.FILEMODEL_COMPARATOR_ID);
    }
    return members;
  }
 else   if (parentElement instanceof NamedColumnSet) {
    return null;
  }
 else   if (parentElement instanceof NamedColumnSetFolderNode) {
    NamedColumnSetFolderNode folerNode=(NamedColumnSetFolderNode)parentElement;
    folerNode.loadChildren();
    Object[] children=folerNode.getChildren();
    if (children != null && children.length > 0) {
      if (!(children[0] instanceof ColumnSet)) {
        return children;
      }
      for (int i=0; i < children.length; i++) {
        ColumnSet columnSet=(ColumnSet)children[i];
        ColumnSetKey key=new ColumnSetKey(columnSet);
        if (columnSetCheckedMap.containsKey(key)) {
          currentCheckedColumnSet.add(columnSet);
        }
      }
    }
    return ComparatorsFactory.sort(children,ComparatorsFactory.MODELELEMENT_COMPARATOR_ID);
  }
  return super.getChildren(parentElement);
}
Program: 140580
Project: 140580
Buggy source:
@Override public void treeExpanded(TreeEvent e){
  TreeItem item=(TreeItem)e.item;
  if (!item.getText().endsWith("String_Node_Str")) {
    Object obj=item.getData();
    if (obj instanceof TableFolderNode || obj instanceof ViewFolderNode || obj instanceof ColumnFolderNode) {
      item.setText(item.getText() + "String_Node_Str" + item.getItemCount()+ "String_Node_Str");
      getCommonViewer().getTree().layout();
    }
  }
  super.treeExpanded(e);
}

Fixed version (ground truth):
@Override public void treeExpanded(TreeEvent e){
  TreeItem item=(TreeItem)e.item;
  if (!item.getText().endsWith("String_Node_Str")) {
    Object obj=item.getData();
    if (obj instanceof TableFolderNode || obj instanceof ViewFolderNode || obj instanceof ColumnFolderNode) {
      item.setText(item.getText() + "String_Node_Str" + item.getItemCount()+ "String_Node_Str");
    }
  }
  super.treeExpanded(e);
}
Program: 140582
Project: 140582
Buggy source:
@Override public void mouseDoubleClick(MouseEvent e){
  Tree tree=(Tree)e.getSource();
  Point point=new Point(e.x,e.y);
  TreeItem item=tree.getItem(point);
  if (item != null && !item.getText().endsWith("String_Node_Str")) {
    Object obj=item.getData();
    if (obj instanceof AbstractFolderNode) {
      AbstractFolderNode node=(AbstractFolderNode)obj;
      node.loadChildren();
      Object[] children=node.getChildren();
      if (children != null) {
        item.setText(item.getText() + "String_Node_Str" + children.length+ "String_Node_Str");
      }
      getCommonViewer().getTree().layout();
    }
  }
  super.mouseDoubleClick(e);
}

Fixed version (ground truth):
@Override public void mouseDoubleClick(MouseEvent e){
  Tree tree=(Tree)e.getSource();
  Point point=new Point(e.x,e.y);
  TreeItem item=tree.getItem(point);
  if (item != null) {
    Object obj=item.getData();
    if (obj instanceof AbstractFolderNode) {
      AbstractFolderNode node=(AbstractFolderNode)obj;
      node.loadChildren();
      Object[] children=node.getChildren();
      if (children != null) {
        if (item.getText().indexOf("String_Node_Str") > 0) {
          item.setText(item.getText().substring(0,item.getText().indexOf("String_Node_Str")) + "String_Node_Str" + children.length+ "String_Node_Str");
        }
 else {
          item.setText(item.getText() + "String_Node_Str" + children.length+ "String_Node_Str");
        }
      }
    }
  }
  super.mouseDoubleClick(e);
}
Program: 140583
Project: 140583
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.getFolderNodes((EObject)parentElement);
    }
  }
 else {
    return FolderNodeHelper.getFolderNodes((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;
    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: 140584
Project: 140584
Buggy source:
public TimeSliceOptionPage(){
  super("String_Node_Str");
  setTitle("String_Node_Str");
  setDescription("String_Node_Str");
  patameter=new TimeSlicesParameter();
  patameter.setDataUnit(DateGrain.YEAR.getLiteral());
}

Fixed version (ground truth):
public TimeSliceOptionPage(){
  super("String_Node_Str");
  setTitle("String_Node_Str");
  setDescription("String_Node_Str");
  patameter=new TimeSlicesParameter();
  patameter.setDataUnit(DateGrain.YEAR.getLiteral());
  this.listener=new AbstractForm.ICheckListener(){
    public void checkPerformed(    AbstractForm source){
      if (source.isStatusOnError()) {
        TimeSliceOptionPage.this.setPageComplete(false);
        setErrorMessage(source.getStatus());
      }
 else {
        TimeSliceOptionPage.this.setPageComplete(true);
        setErrorMessage(null);
        setMessage(source.getStatus(),source.getStatusLevel());
      }
    }
  }
;
}
Program: 140585
Project: 140585
Buggy source:
public void createControl(Composite parent){
  Composite comp=new Composite(parent,SWT.NONE);
  comp.setLayout(new GridLayout());
  comp.setLayoutData(new GridData(GridData.FILL_BOTH));
  FreqTimeSliceForm timeSliceForm=new FreqTimeSliceForm(comp,SWT.NONE);
  timeSliceForm.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  timeSliceForm.setParameter(patameter);
  setControl(comp);
}

Fixed version (ground truth):
public void createControl(Composite parent){
  Composite comp=new Composite(parent,SWT.NONE);
  comp.setLayout(new GridLayout());
  comp.setLayoutData(new GridData(GridData.FILL_BOTH));
  FreqTimeSliceForm timeSliceForm=new FreqTimeSliceForm(comp,SWT.NONE);
  timeSliceForm.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  timeSliceForm.setParameter(patameter);
  timeSliceForm.setListener(listener);
  setControl(comp);
}
Program: 140590
Project: 140590
Buggy source:
protected ImageDescriptor decorateImage(ImageDescriptor input,Object element){
  if (element instanceof IFile) {
    IFile file=(IFile)element;
    if (file.getFileExtension().equalsIgnoreCase(FactoriesUtil.REP)) {
      return ImageLib.getImageDescriptor(ImageLib.REPORT_OBJECT);
    }
 else     if (file.getFileExtension().equalsIgnoreCase(FactoriesUtil.PATTERN)) {
      return ImageLib.getImageDescriptor(ImageLib.PATTERN_REG);
    }
  }
  return super.decorateImage(input,element);
}

Fixed version (ground truth):
protected ImageDescriptor decorateImage(ImageDescriptor input,Object element){
  if (element instanceof IFile) {
    IFile file=(IFile)element;
    if (file.getFileExtension().equalsIgnoreCase(FactoriesUtil.REP)) {
      return ImageLib.getImageDescriptor(ImageLib.REPORT_OBJECT);
    }
 else     if (file.getFileExtension().equalsIgnoreCase(FactoriesUtil.PATTERN)) {
      return ImageLib.getImageDescriptor(ImageLib.PATTERN_REG);
    }
  }
  if (element instanceof IProject) {
    if (DQStructureManager.METADATA.equals(((IProject)element).getName())) {
      return ImageLib.getImageDescriptor(ImageLib.METADATA);
    }
  }
 else   if (element instanceof IFolder) {
    if (DQStructureManager.DB_CONNECTIONS.equals(((IFolder)element).getName())) {
      return ImageLib.getImageDescriptor(ImageLib.CONNECTION);
    }
  }
  return super.decorateImage(input,element);
}
Program: 140591
Project: 140591
Buggy source:
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (element instanceof EObject) {
    EObject eObj=(EObject)element;
    if (SwitchHelpers.TDDATAPROVIDER_SWITCH.doSwitch(eObj) != null || dependencySwitch.doSwitch(eObj) != null) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (element instanceof EObject) {
    EObject eObj=(EObject)element;
    if (SwitchHelpers.TDDATAPROVIDER_SWITCH.doSwitch(eObj) != null || dependencySwitch.doSwitch(eObj) != null) {
      return false;
    }
  }
 else   if (element instanceof IFile) {
    IFile file=(IFile)element;
    return file.getFileExtension() != null;
  }
  return true;
}
Program: 140592
Project: 140592
Buggy source:
public void treeExpanded(TreeExpansionEvent event){
  TreeViewer viewer=(TreeViewer)event.getSource();
  if (viewer.getSelection() == null) {
    return;
  }
  AnalysisTypeNode node=(AnalysisTypeNode)((IStructuredSelection)viewer.getSelection()).getFirstElement();
  updateAnalysisNode(node);
}

Fixed version (ground truth):
public void treeExpanded(TreeExpansionEvent event){
  TreeViewer viewer=(TreeViewer)event.getSource();
  if (viewer.getSelection() == null) {
    return;
  }
  AnalysisTypeNode node=(AnalysisTypeNode)((IStructuredSelection)viewer.getSelection()).getFirstElement();
  if (node == null) {
    return;
  }
 else {
    updateAnalysisNode(node);
  }
}
Program: 140595
Project: 140595
Buggy source:
private void fillDbUrlMap(){
  supportDBUrlMap.put(SupportDBUrlType.MYSQLDEFAULTURL.getDBKey(),SupportDBUrlType.MYSQLDEFAULTURL);
  supportDBUrlMap.put(SupportDBUrlType.ORACLEDEFAULTURL.getDBKey(),SupportDBUrlType.ORACLEDEFAULTURL);
}

Fixed version (ground truth):
private void fillDbUrlMap(){
  supportDBUrlMap.put(SupportDBUrlType.MYSQLDEFAULTURL.getDBKey(),SupportDBUrlType.MYSQLDEFAULTURL);
  supportDBUrlMap.put(SupportDBUrlType.ORACLEDEFAULTURL.getDBKey(),SupportDBUrlType.ORACLEDEFAULTURL);
  supportDBUrlMap.put(SupportDBUrlType.POSTGRESQLEFAULTURL.getDBKey(),SupportDBUrlType.POSTGRESQLEFAULTURL);
}
Program: 140596
Project: 140596
Buggy source:
public void doSave(IProgressMonitor monitor){
  if (masterPage.isDirty()) {
    masterPage.doSave(monitor);
  }
  super.doSave(monitor);
}

Fixed version (ground truth):
public void doSave(IProgressMonitor monitor){
  if (masterPage.isDirty()) {
    masterPage.doSave(monitor);
  }
  super.doSave(monitor);
  IFile efile=((FileEditorInput)getEditorInput()).getFile();
  refreshDQView(efile);
}
Program: 140597
Project: 140597
Buggy source:
public void modifyText(ModifyEvent e){
  setPageComplete(true);
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  checkFieldsValue();
  if (isStatusOnValid()) {
    setPageComplete(true);
  }
}
Program: 140598
Project: 140598
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));
  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);
  }
}

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){
      checkFieldsValue();
      if (isStatusOnValid()) {
        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: 140599
Project: 140599
Buggy source:
@Override public boolean checkFieldsValue(){
  if (nameText.getText() == "String_Node_Str") {
    updateStatus(IStatus.ERROR,MSG_EMPTY);
    return false;
  }
  if (!CheckValueUtils.isStringValue(nameText.getText())) {
    updateStatus(IStatus.ERROR,MSG_ONLY_CHAR);
    return false;
  }
  updateStatus(IStatus.OK,MSG_OK);
  return super.checkFieldsValue();
}

Fixed version (ground truth):
@Override public boolean checkFieldsValue(){
  if (nameText.getText().trim() == "String_Node_Str") {
    updateStatus(IStatus.ERROR,MSG_EMPTY);
    return false;
  }
  if (nameText.getText().contains("String_Node_Str")) {
    updateStatus(IStatus.ERROR,MSG_INVALID);
    return false;
  }
  updateStatus(IStatus.OK,MSG_OK);
  return super.checkFieldsValue();
}
Program: 140600
Project: 140600
Buggy source:
protected void addListeners(){
  nameText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      checkFieldsValue();
      if (isStatusOnValid()) {
        metadata.put(IParameterConstant.ANALYSIS_NAME,nameText.getText());
        getConnectionParams().setMetadate(metadata);
      }
    }
  }
);
  purposeText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (purposeText.getText().length() != 0) {
        metadata.put(IParameterConstant.ANALYSIS_PURPOSE,purposeText.getText());
        getConnectionParams().setMetadate(metadata);
      }
    }
  }
);
  descriptionText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (descriptionText.getText().length() != 0) {
        metadata.put(IParameterConstant.ANALYSIS_DESCRIPTION,descriptionText.getText());
        getConnectionParams().setMetadate(metadata);
      }
    }
  }
);
  authorText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      checkFieldsValue();
      if (isStatusOnValid()) {
        metadata.put(IParameterConstant.ANALYSIS_AUTHOR,authorText.getText());
        getConnectionParams().setMetadate(metadata);
      }
    }
  }
);
  statusText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      String selected=((CCombo)e.getSource()).getText();
      metadata.put(IParameterConstant.ANALYSIS_STATUS,selected);
      getConnectionParams().setMetadate(metadata);
    }
  }
);
}

Fixed version (ground truth):
protected void addListeners(){
  nameText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      checkFieldsValue();
      if (isStatusOnValid()) {
        metadata.put(IParameterConstant.ANALYSIS_NAME,nameText.getText());
        getConnectionParams().setMetadate(metadata);
      }
    }
  }
);
  purposeText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (purposeText.getText().length() != 0) {
        metadata.put(IParameterConstant.ANALYSIS_PURPOSE,purposeText.getText());
        getConnectionParams().setMetadate(metadata);
      }
    }
  }
);
  descriptionText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (descriptionText.getText().length() != 0) {
        metadata.put(IParameterConstant.ANALYSIS_DESCRIPTION,descriptionText.getText());
        getConnectionParams().setMetadate(metadata);
      }
    }
  }
);
  authorText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      metadata.put(IParameterConstant.ANALYSIS_AUTHOR,authorText.getText());
      getConnectionParams().setMetadate(metadata);
    }
  }
);
  statusText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      String selected=((CCombo)e.getSource()).getText();
      metadata.put(IParameterConstant.ANALYSIS_STATUS,selected);
      getConnectionParams().setMetadate(metadata);
    }
  }
);
}
Program: 140601
Project: 140601
Buggy source:
@Override protected boolean checkFieldsValue(){
  if (lowerText.getText() == "String_Node_Str" || higherText.getText() == "String_Node_Str") {
    updateStatus(IStatus.ERROR,MSG_EMPTY);
    return false;
  }
  if (!CheckValueUtils.isNumberValue(lowerText.getText()) || !CheckValueUtils.isNumberValue(higherText.getText())) {
    updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
    return false;
  }
  updateStatus(IStatus.OK,MSG_OK);
  return true;
}

Fixed version (ground truth):
@Override protected boolean checkFieldsValue(){
  if (lowerText.getText() == "String_Node_Str" || higherText.getText() == "String_Node_Str") {
    updateStatus(IStatus.ERROR,MSG_EMPTY);
    return false;
  }
  if (!CheckValueUtils.isNumberWithNegativeValue(lowerText.getText()) || !CheckValueUtils.isNumberWithNegativeValue(higherText.getText())) {
    updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
    return false;
  }
  updateStatus(IStatus.OK,MSG_OK);
  return true;
}
Program: 140602
Project: 140602
Buggy source:
@Override protected boolean checkFieldsValue(){
  if (numberTxt.getText() == "String_Node_Str") {
    updateStatus(IStatus.ERROR,MSG_EMPTY);
    return false;
  }
  if (!CheckValueUtils.isNumberValue(numberTxt.getText())) {
    updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
    return false;
  }
  updateStatus(IStatus.OK,MSG_OK);
  return super.checkFieldsValue();
}

Fixed version (ground truth):
@Override protected boolean checkFieldsValue(){
  if (numberTxt.getText() == "String_Node_Str") {
    updateStatus(IStatus.ERROR,MSG_EMPTY);
    return false;
  }
  if (!CheckValueUtils.isNumberOfShownValue(numberTxt.getText())) {
    updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
    return false;
  }
  updateStatus(IStatus.OK,MSG_OK);
  return super.checkFieldsValue();
}
Program: 140603
Project: 140603
Buggy source:
@Override protected boolean checkFieldsValue(){
  if (numberTxt.getText() == "String_Node_Str") {
    updateStatus(IStatus.ERROR,MSG_EMPTY);
    return false;
  }
  if (!CheckValueUtils.isNumberValue(numberTxt.getText())) {
    updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
    return false;
  }
  updateStatus(IStatus.OK,MSG_OK);
  return true;
}

Fixed version (ground truth):
@Override protected boolean checkFieldsValue(){
  if (numberTxt.getText() == "String_Node_Str") {
    updateStatus(IStatus.ERROR,MSG_EMPTY);
    return false;
  }
  if (!CheckValueUtils.isNumberOfShownValue(numberTxt.getText())) {
    updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
    return false;
  }
  updateStatus(IStatus.OK,MSG_OK);
  return true;
}
Program: 140604
Project: 140604
Buggy source:
@Override protected boolean checkFieldsValue(){
  if (numberTxt.getText() == "String_Node_Str") {
    updateStatus(IStatus.ERROR,MSG_EMPTY);
    return false;
  }
  if (!CheckValueUtils.isNumberValue(numberTxt.getText())) {
    updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
    return false;
  }
  updateStatus(IStatus.OK,MSG_OK);
  return true;
}

Fixed version (ground truth):
@Override protected boolean checkFieldsValue(){
  if (numberTxt.getText() == "String_Node_Str") {
    updateStatus(IStatus.ERROR,MSG_EMPTY);
    return false;
  }
  if (!CheckValueUtils.isNumberOfShownValue(numberTxt.getText())) {
    updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
    return false;
  }
  updateStatus(IStatus.OK,MSG_OK);
  return true;
}
Program: 140606
Project: 140606
Buggy source:
protected void fillAnalysisBuilder(AnalysisBuilder analysisBuilder){
  ConnectionAnalysisParameter parameters=(ConnectionAnalysisParameter)getAnalysisParameter();
  TdDataProvider tdProvider=parameters.getTdDataProvider();
  analysisBuilder.setAnalysisConnection(tdProvider);
  ConnectionIndicator indicator=SchemaFactory.eINSTANCE.createConnectionIndicator();
  indicator.setAnalyzedElement(tdProvider);
  List<TdSchema> tdSchemas=DataProviderHelper.getTdSchema(tdProvider);
  for (  TdSchema schema : tdSchemas) {
    SchemaIndicator createSchemaIndicator=SchemaFactory.eINSTANCE.createSchemaIndicator();
    createSchemaIndicator.setAnalyzedElement(schema);
    indicator.addSchemaIndicator(createSchemaIndicator);
  }
  List<TdCatalog> tdCatalogs=DataProviderHelper.getTdCatalogs(tdProvider);
  for (  TdCatalog tdCatalog : tdCatalogs) {
    SchemaIndicator createSchemaIndicator=SchemaFactory.eINSTANCE.createSchemaIndicator();
    createSchemaIndicator.setAnalyzedElement(tdCatalog);
    indicator.addSchemaIndicator(createSchemaIndicator);
  }
  analysisBuilder.addElementToAnalyze(tdProvider,indicator);
  super.fillAnalysisBuilder(analysisBuilder);
}

Fixed version (ground truth):
@Override protected void fillAnalysisBuilder(AnalysisBuilder analysisBuilder){
  ConnectionAnalysisParameter parameters=(ConnectionAnalysisParameter)getAnalysisParameter();
  TdDataProvider tdProvider=parameters.getTdDataProvider();
  this.analysisBuilder=analysisBuilder;
  analysisBuilder.setAnalysisConnection(tdProvider);
  ConnectionIndicator indicator=SchemaFactory.eINSTANCE.createConnectionIndicator();
  indicator.setAnalyzedElement(tdProvider);
  List<TdSchema> tdSchemas=DataProviderHelper.getTdSchema(tdProvider);
  for (  TdSchema schema : tdSchemas) {
    SchemaIndicator createSchemaIndicator=SchemaFactory.eINSTANCE.createSchemaIndicator();
    createSchemaIndicator.setAnalyzedElement(schema);
    indicator.addSchemaIndicator(createSchemaIndicator);
  }
  List<TdCatalog> tdCatalogs=DataProviderHelper.getTdCatalogs(tdProvider);
  for (  TdCatalog tdCatalog : tdCatalogs) {
    SchemaIndicator createSchemaIndicator=SchemaFactory.eINSTANCE.createSchemaIndicator();
    createSchemaIndicator.setAnalyzedElement(tdCatalog);
    indicator.addSchemaIndicator(createSchemaIndicator);
  }
  analysisBuilder.addElementToAnalyze(tdProvider,indicator);
  super.fillAnalysisBuilder(analysisBuilder);
}
Program: 140607
Project: 140607
Buggy source:
/** 
 * DOC scorreia Comment method "getDateAggregatedCompletedString".
 * @param indicator
 * @param sqlExpression
 * @param colName
 * @param table
 * @param dataFilterExpression
 * @param dateAggregationType
 * @return
 */
private String getDateAggregatedCompletedString(Expression sqlExpression,String colName,String table,DateGrain dateAggregationType){
  int nbExtractedColumns=0;
  String result="String_Node_Str";
switch (dateAggregationType) {
case DAY:
    result=dbms().extractDay(colName) + comma(result);
  nbExtractedColumns++;
case WEEK:
result=dbms().extractWeek(colName) + comma(result);
nbExtractedColumns++;
case MONTH:
result=dbms().extractMonth(colName) + comma(result);
nbExtractedColumns++;
case QUARTER:
result=dbms().extractQuarter(colName) + comma(result);
nbExtractedColumns++;
case YEAR:
result=dbms().extractYear(colName) + comma(result);
nbExtractedColumns++;
break;
case NONE:
result=colName;
nbExtractedColumns++;
break;
default :
break;
}
String sql=replaceVariables(sqlExpression.getBody(),result,table);
return sql;
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "getDateAggregatedCompletedString".
 * @param indicator
 * @param sqlExpression
 * @param colName
 * @param table
 * @param dataFilterExpression
 * @param dateAggregationType
 * @return
 */
private String getDateAggregatedCompletedString(Expression sqlExpression,String colName,String table,DateGrain dateAggregationType){
  int nbExtractedColumns=0;
  String result="String_Node_Str";
  String aliases="String_Node_Str";
  String alias;
switch (dateAggregationType) {
case DAY:
    alias=getAlias(colName,DateGrain.DAY);
  result=dbms().extractDay(colName) + alias + comma(result);
aliases=alias + comma(aliases);
nbExtractedColumns++;
case WEEK:
alias=getAlias(colName,DateGrain.WEEK);
result=dbms().extractWeek(colName) + alias + comma(result);
aliases=alias + comma(aliases);
nbExtractedColumns++;
case MONTH:
alias=getAlias(colName,DateGrain.MONTH);
result=dbms().extractMonth(colName) + alias + comma(result);
aliases=alias + comma(aliases);
nbExtractedColumns++;
case QUARTER:
alias=getAlias(colName,DateGrain.QUARTER);
result=dbms().extractQuarter(colName) + alias + comma(result);
aliases=alias + comma(aliases);
nbExtractedColumns++;
case YEAR:
alias=getAlias(colName,DateGrain.YEAR);
result=dbms().extractYear(colName) + alias + comma(result);
aliases=alias + comma(aliases);
nbExtractedColumns++;
break;
case NONE:
result=colName;
nbExtractedColumns++;
break;
default :
break;
}
String sql=replaceVariablesLow(sqlExpression.getBody(),result,table,aliases);
return sql;
}
Program: 140608
Project: 140608
Buggy source:
/** 
 * Method "replaceVariables".
 * @param sqlGenericString a string with 2 parameters {0} and {1}
 * @param column the string that replaces the {0} parameter
 * @param table the string that replaces the {1} parameter
 * @return the string with the given parameters
 */
private String replaceVariables(String sqlGenericString,String column,String table){
  Object[] arguments={column,table};
  String toFormat=surroundSingleQuotes(sqlGenericString);
  return MessageFormat.format(toFormat,arguments);
}

Fixed version (ground truth):
/** 
 * Method "replaceVariables".
 * @param sqlGenericString a string with 2 parameters {0} and {1}
 * @param column the string that replaces the {0} parameter
 * @param table the string that replaces the {1} parameter
 * @return the string with the given parameters
 */
private String replaceVariables(String sqlGenericString,String column,String table){
  Object[] arguments={column,table};
  return replaceVariablesLow(sqlGenericString,arguments);
}
Program: 140610
Project: 140610
Buggy source:
/** 
 * DOC qzhang ImportPatternsAction constructor comment.
 */
public ImportPatternsAction(IFolder folder){
  setText("String_Node_Str");
  this.folder=folder;
}

Fixed version (ground truth):
/** 
 * DOC qzhang ImportPatternsAction constructor comment.
 */
public ImportPatternsAction(IFolder folder){
  setText("String_Node_Str");
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.PATTERN_REG));
  this.folder=folder;
}
Program: 140611
Project: 140611
Buggy source:
/** 
 * DOC qzhang Comment method "addComponents".
 * @param pattern
 * @param reg
 * @param mysql
 * @param string
 */
private void addComponents(Pattern pattern,String reg,String mysql,String oracle){
  RegularExpression regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  Expression expression=CoreFactory.eINSTANCE.createExpression();
  expression.setBody(reg);
  expression.setLanguage("String_Node_Str");
  regularExpr.setExpression(expression);
  pattern.getComponents().add(regularExpr);
  regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  expression=CoreFactory.eINSTANCE.createExpression();
  expression.setBody(mysql);
  expression.setLanguage("String_Node_Str");
  regularExpr.setExpression(expression);
  pattern.getComponents().add(regularExpr);
  regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  expression=CoreFactory.eINSTANCE.createExpression();
  expression.setBody(oracle);
  expression.setLanguage("String_Node_Str");
  regularExpr.setExpression(expression);
  pattern.getComponents().add(regularExpr);
}

Fixed version (ground truth):
/** 
 * DOC qzhang Comment method "addComponents".
 * @param pattern
 * @param reg
 * @param mysql
 * @param string
 */
private void addComponents(Pattern pattern,String reg,String mysql,String oracle){
  RegularExpression regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  Expression expression=CoreFactory.eINSTANCE.createExpression();
  expression.setBody(reg);
  expression.setLanguage("String_Node_Str");
  regularExpr.setExpression(expression);
  regularExpr.setExpressionType(ExpressionType.REGEXP.getName());
  pattern.getComponents().add(regularExpr);
  regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  expression=CoreFactory.eINSTANCE.createExpression();
  expression.setBody(mysql);
  expression.setLanguage("String_Node_Str");
  regularExpr.setExpression(expression);
  regularExpr.setExpressionType(ExpressionType.REGEXP.getName());
  pattern.getComponents().add(regularExpr);
  regularExpr=PatternFactory.eINSTANCE.createRegularExpression();
  expression=CoreFactory.eINSTANCE.createExpression();
  expression.setBody(oracle);
  expression.setLanguage("String_Node_Str");
  regularExpr.setExpression(expression);
  regularExpr.setExpressionType(ExpressionType.REGEXP.getName());
  pattern.getComponents().add(regularExpr);
}
Program: 140612
Project: 140612
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  CheckedTreeSelectionDialog dialog=new CheckedTreeSelectionDialog(null,new PatternLabelProvider(),new WorkbenchContentProvider());
  IFolder defaultPatternFolder=ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.LIBRARIES).getFolder(DQStructureManager.PATTERNS);
  dialog.setInput(defaultPatternFolder);
  dialog.setContainerMode(true);
  dialog.setTitle("String_Node_Str");
  dialog.setMessage("String_Node_Str");
  dialog.setSize(80,30);
  dialog.create();
  if (dialog.open() == Window.OK) {
    for (    Object obj : dialog.getResult()) {
      if (obj instanceof IFile) {
        IFile file=(IFile)obj;
        Pattern pattern=PatternResourceFileHelper.getInstance().findPattern(file);
        PatternMatchingIndicator patternMatchingIndicator=PatternIndicatorFactory.createRegexpMatchingIndicator(pattern);
        DependenciesHandler.getInstance().setDependencyOn(patternMatchingIndicator,pattern);
        IndicatorEnum type=IndicatorEnum.findIndicatorEnum(patternMatchingIndicator.eClass());
        IndicatorUnit addIndicatorUnit=columnIndicator.addSpecialIndicator(type,patternMatchingIndicator);
        createOneUnit(treeItem,addIndicatorUnit);
        setDirty(true);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  CheckedTreeSelectionDialog dialog=new CheckedTreeSelectionDialog(null,new PatternLabelProvider(),new WorkbenchContentProvider());
  IProject defaultPatternFolder=ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.LIBRARIES);
  dialog.setInput(defaultPatternFolder);
  dialog.addFilter(new ViewerFilter(){
    @Override public boolean select(    Viewer viewer,    Object parentElement,    Object element){
      if (element instanceof IFile) {
        IFile file=(IFile)element;
        if (FactoriesUtil.PATTERN.equals(file.getFileExtension())) {
          return true;
        }
      }
 else       if (element instanceof IFolder) {
        IFolder folder=(IFolder)element;
        return PatternUtilities.isLibraiesSubfolder(folder,DQStructureManager.PATTERNS,DQStructureManager.SQL_PATTERNS);
      }
      return false;
    }
  }
);
  dialog.setContainerMode(true);
  dialog.setTitle("String_Node_Str");
  dialog.setMessage("String_Node_Str");
  dialog.setSize(80,30);
  dialog.create();
  if (dialog.open() == Window.OK) {
    for (    Object obj : dialog.getResult()) {
      if (obj instanceof IFile) {
        IFile file=(IFile)obj;
        IndicatorUnit addIndicatorUnit=PatternUtilities.createIndicatorUnit(file,columnIndicator,analysis);
        createOneUnit(treeItem,addIndicatorUnit);
        setDirty(true);
      }
    }
  }
}
Program: 140613
Project: 140613
Buggy source:
@Override public String getText(Object element){
  if (element instanceof IFile) {
    IFile file=(IFile)element;
    Pattern pattern=PatternResourceFileHelper.getInstance().findPattern(file);
    return pattern.getName();
  }
  if (element instanceof IFolder) {
    return ((IFolder)element).getName();
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getText(Object element){
  if (element instanceof IFile) {
    IFile file=(IFile)element;
    Pattern pattern=PatternResourceFileHelper.getInstance().findPattern(file);
    if (pattern != null) {
      return pattern.getName();
    }
  }
  if (element instanceof IFolder) {
    return ((IFolder)element).getName();
  }
  return "String_Node_Str";
}
Program: 140616
Project: 140616
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  ElementTreeSelectionDialog dialog=new ElementTreeSelectionDialog(null,new PatternLabelProvider(),new WorkbenchContentProvider());
  IFolder defaultPatternFolder=ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.LIBRARIES).getFolder(DQStructureManager.PATTERNS);
  dialog.setInput(defaultPatternFolder);
  dialog.setTitle("String_Node_Str");
  dialog.setMessage("String_Node_Str");
  dialog.setSize(80,30);
  dialog.create();
  if (dialog.open() == Window.OK) {
    for (    Object obj : dialog.getResult()) {
      IFile file=(IFile)obj;
      Pattern pattern=PatternResourceFileHelper.getInstance().findPattern(file);
      PatternMatchingIndicator patternMatchingIndicator=PatternIndicatorFactory.createRegexpMatchingIndicator(pattern);
      DependenciesHandler.getInstance().setDependencyOn(patternMatchingIndicator,pattern);
      IndicatorEnum type=IndicatorEnum.findIndicatorEnum(patternMatchingIndicator.eClass());
      IndicatorUnit addIndicatorUnit=columnIndicator.addSpecialIndicator(type,patternMatchingIndicator);
      createOneUnit(treeItem,addIndicatorUnit);
      setDirty(true);
    }
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  CheckedTreeSelectionDialog dialog=new CheckedTreeSelectionDialog(null,new PatternLabelProvider(),new WorkbenchContentProvider());
  IFolder defaultPatternFolder=ResourcesPlugin.getWorkspace().getRoot().getProject(DQStructureManager.LIBRARIES).getFolder(DQStructureManager.PATTERNS);
  dialog.setInput(defaultPatternFolder);
  dialog.setContainerMode(true);
  dialog.setTitle("String_Node_Str");
  dialog.setMessage("String_Node_Str");
  dialog.setSize(80,30);
  dialog.create();
  if (dialog.open() == Window.OK) {
    for (    Object obj : dialog.getResult()) {
      if (obj instanceof IFile) {
        IFile file=(IFile)obj;
        Pattern pattern=PatternResourceFileHelper.getInstance().findPattern(file);
        PatternMatchingIndicator patternMatchingIndicator=PatternIndicatorFactory.createRegexpMatchingIndicator(pattern);
        DependenciesHandler.getInstance().setDependencyOn(patternMatchingIndicator,pattern);
        IndicatorEnum type=IndicatorEnum.findIndicatorEnum(patternMatchingIndicator.eClass());
        IndicatorUnit addIndicatorUnit=columnIndicator.addSpecialIndicator(type,patternMatchingIndicator);
        createOneUnit(treeItem,addIndicatorUnit);
        setDirty(true);
      }
    }
  }
}
Program: 140619
Project: 140619
Buggy source:
@Override public Image getImage(Object element){
  return ImageLib.getImage(ImageLib.PATTERN_REG);
}

Fixed version (ground truth):
@Override public Image getImage(Object element){
  if (element instanceof IFolder) {
    return ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
  }
  if (element instanceof IFile) {
    return ImageLib.getImage(ImageLib.PATTERN_REG);
  }
  return null;
}
Program: 140621
Project: 140621
Buggy source:
public void addElements(final ColumnIndicator[] elements){
  ColumnIndicator[] newsArray=new ColumnIndicator[this.columnIndicators.length + elements.length];
  System.arraycopy(this.columnIndicators,0,newsArray,0,this.columnIndicators.length);
  for (int i=0; i < elements.length; i++) {
    newsArray[this.columnIndicators.length + i]=elements[i];
  }
  this.setElements(newsArray);
}

Fixed version (ground truth):
public void addElements(final ColumnIndicator[] elements){
  ColumnIndicator[] newsArray=new ColumnIndicator[this.columnIndicators.length + elements.length];
  System.arraycopy(this.columnIndicators,0,newsArray,0,this.columnIndicators.length);
  for (int i=0; i < elements.length; i++) {
    newsArray[this.columnIndicators.length + i]=elements[i];
  }
  this.columnIndicators=newsArray;
  this.addItemElements(elements);
}
Program: 140622
Project: 140622
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void run(){
  if (preDo()) {
    WizardDialog dialog=new WizardDialog(null,getPredefinedWizard());
    dialog.setPageSize(500,340);
    if (dialog.open() == Window.OK) {
      getMasterPage().getTreeViewer().addElements(getPredefinedColumnIndicator());
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void run(){
  if (preDo()) {
    WizardDialog dialog=getPredefinedDialog();
    dialog.setPageSize(500,340);
    if (dialog.open() == Window.OK) {
      getMasterPage().getTreeViewer().addElements(getPredefinedColumnIndicator());
    }
  }
}
Program: 140624
Project: 140624
Buggy source:
public static Dialog injectWithHelp(WizardDialog dialog,Wizard wizard,String helpID){
  return injectWithHelp(dialog,wizard,helpID,null);
}

Fixed version (ground truth):
public static Dialog injectWithHelp(WizardDialog dialog,Wizard wizard,String helpID){
  return injectHelp(dialog,wizard,helpID,null);
}
Program: 140625
Project: 140625
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void openTray(DialogTray tray) throws IllegalStateException, UnsupportedOperationException {
  super.openTray(tray);
  if (tray instanceof HelpTray) {
    HelpTray helpTray=(HelpTray)tray;
    ReusableHelpPart helpPart=helpTray.getHelpPart();
    helpPart.getForm().getForm().notifyListeners(SWT.Activate,new Event());
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void openTray(DialogTray tray) throws IllegalStateException, UnsupportedOperationException {
  super.openTray(tray);
  if (tray instanceof HelpTray) {
    HelpTray helpTray=(HelpTray)tray;
    helpPart=helpTray.getHelpPart();
    helpPart.getForm().getForm().notifyListeners(SWT.Activate,new Event());
  }
}
Program: 140627
Project: 140627
Buggy source:
public void shellActivated(ShellEvent e){
  if (activeCount < 2) {
    Point point=e.widget.getDisplay().getCursorLocation();
    IContext context=HelpSystem.getContext(HelpPlugin.PATTERN_CONTEXT_HELP_ID);
    IWorkbenchHelpSystem helpSystem=PlatformUI.getWorkbench().getHelpSystem();
    helpSystem.displayContext(context,point.x + 15,point.y);
    activeCount++;
    ReusableHelpPart lastActiveInstance=ReusableHelpPart.getLastActiveInstance();
    if (lastActiveInstance != null) {
      IHelpResource[] relatedTopics=context.getRelatedTopics();
      String href=relatedTopics[0].getHref();
      lastActiveInstance.showURL(href);
    }
  }
}

Fixed version (ground truth):
public void shellActivated(ShellEvent e){
  if (activeCount < 2) {
    Point point=e.widget.getDisplay().getCursorLocation();
    IContext context=HelpSystem.getContext(HelpPlugin.PATTERN_CONTEXT_HELP_ID);
    IWorkbenchHelpSystem helpSystem=PlatformUI.getWorkbench().getHelpSystem();
    helpSystem.displayContext(context,point.x + 15,point.y);
    activeCount++;
    ReusableHelpPart lastActiveInstance=ReusableHelpPart.getLastActiveInstance();
    if (lastActiveInstance != null) {
      IHelpResource[] relatedTopics=context.getRelatedTopics();
      String href=relatedTopics[0].getHref();
switch (type) {
case SQL_LIKE:
        href=relatedTopics[1].getHref();
      break;
default :
    break;
}
lastActiveInstance.showURL(href);
}
}
}
Program: 140628
Project: 140628
Buggy source:
/** 
 * DOC qzhang AddSqlFileAction constructor comment.
 * @param folder
 */
public CreatePatternAction(IFolder folder){
  setText("String_Node_Str");
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.PATTERN_REG));
  this.folder=folder;
}

Fixed version (ground truth):
/** 
 * DOC qzhang AddSqlFileAction constructor comment.
 * @param folder
 * @param type
 */
public CreatePatternAction(IFolder folder,ExpressionType type){
switch (type) {
case SQL_LIKE:
    setText("String_Node_Str");
  break;
default :
setText("String_Node_Str");
break;
}
setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.PATTERN_REG));
this.folder=folder;
this.type=type;
}
Program: 140629
Project: 140629
Buggy source:
/** 
 * DOC qzhang CreateSqlFileWizard constructor comment.
 * @param folder
 */
public CreatePatternWizard(IFolder folder){
  this.folder=folder;
}

Fixed version (ground truth):
/** 
 * DOC qzhang CreateSqlFileWizard constructor comment.
 * @param folder
 * @param type
 */
public CreatePatternWizard(IFolder folder,ExpressionType type){
  this.folder=folder;
  this.type=type;
}
Program: 140630
Project: 140630
Buggy source:
@Override public void addPages(){
  mPage=new CreatePatternWizardPage1(folder);
  AbstractWizardPage.setConnectionParams(new ConnectionParameter());
  mPage.setTitle("String_Node_Str");
  mPage.setDescription("String_Node_Str");
  mPage.setPageComplete(false);
  mPage2=new CreatePatternWizardPage2();
  mPage2.setTitle("String_Node_Str");
  mPage2.setDescription("String_Node_Str");
  mPage2.setPageComplete(false);
  addPage(mPage);
  addPage(mPage2);
}

Fixed version (ground truth):
@Override public void addPages(){
  String s="String_Node_Str";
switch (type) {
case SQL_LIKE:
    s="String_Node_Str";
  break;
default :
break;
}
mPage=new CreatePatternWizardPage1(folder);
AbstractWizardPage.setConnectionParams(new ConnectionParameter());
mPage.setTitle(s + "String_Node_Str");
mPage.setDescription("String_Node_Str");
mPage.setPageComplete(false);
mPage2=new CreatePatternWizardPage2();
mPage2.setTitle(s + "String_Node_Str");
mPage2.setDescription("String_Node_Str");
mPage2.setPageComplete(false);
addPage(mPage);
addPage(mPage2);
}
Program: 140631
Project: 140631
Buggy source:
public void fillContextMenu(IMenuManager menu){
  TreeSelection treeSelection=((TreeSelection)this.getContext().getSelection());
  List<IFile> selectedFiles=new ArrayList<IFile>();
  if (treeSelection.size() == 1) {
    Object obj=treeSelection.getFirstElement();
    if (obj instanceof IFolder) {
      selectedFolderName=((IFolder)obj).getName();
      if (selectedFolderName.equals(DQStructureManager.PATTERNS)) {
        menu.add(new CreatePatternAction((IFolder)obj));
      }
    }
 else     if (obj instanceof IFile) {
      IFile file=(IFile)obj;
      if (file.getFileExtension().equalsIgnoreCase(EXTENSION_PATTERN)) {
      }
    }
  }
  boolean isSelectFile=computeSelectedFiles(treeSelection,selectedFiles);
  if (!isSelectFile && !selectedFiles.isEmpty()) {
  }
}

Fixed version (ground truth):
public void fillContextMenu(IMenuManager menu){
  TreeSelection treeSelection=((TreeSelection)this.getContext().getSelection());
  List<IFile> selectedFiles=new ArrayList<IFile>();
  if (treeSelection.size() == 1) {
    Object obj=treeSelection.getFirstElement();
    if (obj instanceof IFolder) {
      selectedFolderName=((IFolder)obj).getName();
      ExpressionType type=null;
      if (selectedFolderName.equals(DQStructureManager.PATTERNS)) {
        type=ExpressionType.REGEXP;
      }
 else       if (selectedFolderName.equals(DQStructureManager.SQL_PATTERNS)) {
        type=ExpressionType.SQL_LIKE;
      }
      if (type != null) {
        menu.add(new CreatePatternAction((IFolder)obj,type));
      }
    }
 else     if (obj instanceof IFile) {
      IFile file=(IFile)obj;
      if (file.getFileExtension().equalsIgnoreCase(EXTENSION_PATTERN)) {
      }
    }
  }
  boolean isSelectFile=computeSelectedFiles(treeSelection,selectedFiles);
  if (!isSelectFile && !selectedFiles.isEmpty()) {
  }
}
Program: 140632
Project: 140632
Buggy source:
@Override public void addPages(){
  mPage=new CreateSqlFileWizardPage();
  AbstractWizardPage.setConnectionParams(new ConnectionParameter());
  mPage.setTitle("String_Node_Str");
  mPage.setDescription("String_Node_Str");
  mPage.setPageComplete(false);
  addPage(mPage);
}

Fixed version (ground truth):
@Override public void addPages(){
  mPage=new CreateSqlFileWizardPage(folder);
  AbstractWizardPage.setConnectionParams(new ConnectionParameter());
  mPage.setTitle("String_Node_Str");
  mPage.setDescription("String_Node_Str");
  mPage.setPageComplete(false);
  addPage(mPage);
}