nus-yam/ex-repair huggingface dataset:
Program: 139979
Project: 139979
Buggy source:
@Override public void run(){
  IEditorPart editor=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  if (editor != null && editor instanceof AnalysisEditor) {
    AnalysisEditor anaEditor=(AnalysisEditor)editor;
    anaEditor.getMasterPage().refreshChart();
  }
}

Fixed version (ground truth):
@Override public void run(){
  IEditorPart editor=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  if (editor != null && editor instanceof AnalysisEditor) {
    AnalysisEditor anaEditor=(AnalysisEditor)editor;
    anaEditor.getMasterPage().refresh();
  }
}
Program: 139980
Project: 139980
Buggy source:
public void fireRuningItemChanged(boolean status){
  currentEditor.setRunActionButtonState(status);
  currentEditor.setRefreshResultPage(status);
  if (status) {
    refreshChart();
  }
}

Fixed version (ground truth):
public void fireRuningItemChanged(boolean status){
  currentEditor.setRunActionButtonState(status);
  currentEditor.setRefreshResultPage(status);
  if (status) {
    refresh();
  }
}
Program: 139982
Project: 139982
Buggy source:
/** 
 * DOC qzhang Comment method "doSetInput".
 */
public void doSetInput(){
  List<CatalogIndicator> indicatorList=null;
  if (this.analysis.getResults().getIndicators().size() > 0) {
    indicatorList=getCatalogIndicators();
    if (indicatorList.size() == 0) {
      statisticalViewer.setInput(getSchemaIndicators());
    }
 else {
      List<SchemaIndicator> schemaIndicators=new ArrayList<SchemaIndicator>();
      schemaIndicators.addAll(getSchemaIndicators());
      schemaIndicators.addAll(indicatorList);
      statisticalViewer.setInput(schemaIndicators);
    }
  }
 else {
    indicatorList=new ArrayList<CatalogIndicator>();
  }
  refreshSumSection();
}

Fixed version (ground truth):
/** 
 * DOC qzhang Comment method "doSetInput".
 */
public void doSetInput(){
  List<CatalogIndicator> indicatorList=null;
  if (this.analysis.getResults().getIndicators().size() > 0) {
    indicatorList=getCatalogIndicators();
    if (indicatorList.size() == 0) {
      catalogTableViewer.setInput(getSchemaIndicators());
    }
 else {
      List<SchemaIndicator> schemaIndicators=new ArrayList<SchemaIndicator>();
      schemaIndicators.addAll(getSchemaIndicators());
      schemaIndicators.addAll(indicatorList);
      catalogTableViewer.setInput(schemaIndicators);
    }
  }
 else {
    indicatorList=new ArrayList<CatalogIndicator>();
  }
}
Program: 139983
Project: 139983
Buggy source:
public void fireRuningItemChanged(boolean status){
  currentEditor.setRunActionButtonState(status);
  if (status) {
    doSetInput();
  }
}

Fixed version (ground truth):
public void fireRuningItemChanged(boolean status){
  currentEditor.setRunActionButtonState(status);
  if (status) {
    refresh();
  }
  statisticalSection.setExpanded(status);
}
Program: 139984
Project: 139984
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  StructuredSelection selection=(StructuredSelection)event.getSelection();
  CatalogIndicator firstElement=(CatalogIndicator)selection.getFirstElement();
  createSecondStatisticalTable.setInput(firstElement.getSchemaIndicators());
  createSecondStatisticalTable.getTable().setVisible(true);
}

Fixed version (ground truth):
public void selectionChanged(SelectionChangedEvent event){
  StructuredSelection selection=(StructuredSelection)event.getSelection();
  CatalogIndicator firstElement=(CatalogIndicator)selection.getFirstElement();
  schemaTableViewer.setInput(firstElement.getSchemaIndicators());
  schemaTableViewer.getTable().setVisible(true);
}
Program: 139985
Project: 139985
Buggy source:
public void start(BundleContext context) throws Exception {
  super.start(context);
  plugin=this;
  getPreferenceStore().setDefault(PluginConstant.CHEAT_SHEET_VIEW,true);
  try {
    for (    BookMarkEnum bookMark : BookMarkEnum.VALUES) {
      BaseHelpSystem.getBookmarkManager().addBookmark(bookMark.getHref(),bookMark.getLabel());
    }
    doMigrationTask();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void start(BundleContext context) throws Exception {
  super.start(context);
  plugin=this;
  getPreferenceStore().setDefault(PluginConstant.CHEAT_SHEET_VIEW,true);
  try {
    for (    BookMarkEnum bookMark : BookMarkEnum.VALUES) {
      BaseHelpSystem.getBookmarkManager().addBookmark(bookMark.getHref(),bookMark.getLabel());
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 139986
Project: 139986
Buggy source:
public DQRespositoryView(){
  super();
  CorePlugin.getDefault().checkDQStructure();
  CorePlugin.getDefault().setRespositoryView(this);
}

Fixed version (ground truth):
public DQRespositoryView(){
  super();
  CorePlugin.getDefault().checkDQStructure();
  CorePlugin.getDefault().setRespositoryView(this);
  CorePlugin.getDefault().doMigrationTask();
}
Program: 139987
Project: 139987
Buggy source:
/** 
 * DOC Zqin Comment method "isAoverB".
 * @param a
 * @param b
 * @return
 */
public static boolean isAoverB(String a,String b){
  if (!isEmpty(a,b) && (isNumberValue(a,b) || isRealNumberValue(a,b))) {
    Double da=new Double(a);
    Double db=new Double(b);
    return da > db;
  }
  if (!isEmpty(a,b) && isDateValue(a) && isDateValue(b)) {
    try {
      Date ad=DateFormat.getDateInstance().parse(a);
      Date bd=DateFormat.getDateInstance().parse(b);
      return ad.after(bd);
    }
 catch (    Exception e) {
      e.printStackTrace();
      return false;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * DOC Zqin Comment method "isAoverB".
 * @param a
 * @param b
 * @return
 */
public static boolean isAoverB(String a,String b){
  if (!isEmpty(a,b) && (isNumberValue(a,b) || isRealNumberValue(a,b))) {
    Double da=new Double(a);
    Double db=new Double(b);
    return da > db;
  }
  if (!isEmpty(a,b) && isDateValue(a) && isDateValue(b)) {
    try {
      String[] patterns=new String[2];
      patterns[0]="String_Node_Str";
      patterns[1]="String_Node_Str";
      Date ad=DateUtils.parseDate(a,patterns);
      Date bd=DateUtils.parseDate(b,patterns);
      return ad.after(bd);
    }
 catch (    Exception e) {
      e.printStackTrace();
      return false;
    }
  }
  return false;
}
Program: 139988
Project: 139988
Buggy source:
@Override protected Control createDialogArea(Composite parent){
  Composite top=new Composite(parent,SWT.NONE);
  top.setLayout(new GridLayout());
  dateTime=new DateTime(top,SWT.CALENDAR);
  dateTime.setLayoutData(new GridData(GridData.FILL_BOTH));
  if (isDatetime) {
    dateTime=new DateTime(top,SWT.TIME | SWT.BORDER);
    dateTime.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  }
  return top;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(Composite parent){
  Composite top=new Composite(parent,SWT.NONE);
  top.setLayout(new GridLayout());
  timed=new DateTime(top,SWT.CALENDAR);
  timed.setLayoutData(new GridData(GridData.FILL_BOTH));
  if (isDatetime) {
    timet=new DateTime(top,SWT.TIME | SWT.BORDER);
    timet.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  }
  return top;
}
Program: 139989
Project: 139989
Buggy source:
@Override protected void okPressed(){
  Calendar cenlendar=Calendar.getInstance();
  SimpleDateFormat format=null;
  int year=dateTime.getYear();
  int month=dateTime.getMonth();
  int day=dateTime.getDay();
  int hour=dateTime.getHours();
  int mnts=dateTime.getMinutes();
  int secds=dateTime.getSeconds();
  cenlendar.set(year,month,day,hour,mnts,secds);
  if (isDatetime) {
    format=new SimpleDateFormat("String_Node_Str");
  }
 else {
    format=new SimpleDateFormat("String_Node_Str");
  }
  selectDate=format.format(cenlendar.getTime());
  super.okPressed();
}

Fixed version (ground truth):
@Override protected void okPressed(){
  Calendar cenlendar=Calendar.getInstance();
  SimpleDateFormat format=null;
  int year=timed.getYear();
  int month=timed.getMonth();
  int day=timed.getDay();
  if (timet != null) {
    format=new SimpleDateFormat("String_Node_Str");
    int hour=timet.getHours();
    int mnts=timet.getMinutes();
    int secds=timet.getSeconds();
    cenlendar.set(year,month,day,hour,mnts,secds);
  }
 else {
    format=new SimpleDateFormat("String_Node_Str");
    cenlendar.set(year,month,day);
  }
  selectDate=format.format(cenlendar.getTime());
  super.okPressed();
}
Program: 139990
Project: 139990
Buggy source:
@Override public void refresh(){
  doSetInput();
  refreshSumSection();
  refreshStatisticSection();
}

Fixed version (ground truth):
@Override public void refresh(){
  doSetInput();
  refreshSumSection();
}
Program: 139991
Project: 139991
Buggy source:
public void run(){
  HideSeriesPanel hideSeriesPanel=new HideSeriesPanel(columnSetMultiIndicator,tdColumn);
  if (hideSeriesPanel != null) {
    Composite frameComp=toolkit.createComposite(comp,SWT.EMBEDDED);
    frameComp.setLayout(new GridLayout());
    GridData gd=new GridData();
    gd.heightHint=230;
    gd.widthHint=460;
    frameComp.setLayoutData(gd);
    Frame frame=SWT_AWT.new_Frame(frameComp);
    frame.setLayout(new java.awt.BorderLayout());
    frame.add(hideSeriesPanel);
    frame.validate();
  }
}

Fixed version (ground truth):
public void run(){
  HideSeriesChartComposite hcc=new HideSeriesChartComposite(comp,columnSetMultiIndicator,tdColumn,false);
  GridData gd=new GridData();
  gd.heightHint=230;
  gd.widthHint=460;
  hcc.setLayoutData(gd);
}
Program: 139993
Project: 139993
Buggy source:
public void run(){
  HideSeriesPanel hideSeriesPanel=new HideSeriesPanel(columnSetMultiValueIndicator,tdColumn);
  if (hideSeriesPanel != null) {
    Composite frameComp=toolkit.createComposite(comp,SWT.EMBEDDED);
    frameComp.setLayout(new GridLayout());
    GridData gd=new GridData();
    gd.heightHint=300;
    gd.widthHint=600;
    frameComp.setLayoutData(gd);
    Frame frame=SWT_AWT.new_Frame(frameComp);
    frame.setLayout(new java.awt.BorderLayout());
    frame.add(hideSeriesPanel);
    frame.validate();
  }
}

Fixed version (ground truth):
public void run(){
  HideSeriesChartComposite hcc=new HideSeriesChartComposite(comp,columnSetMultiValueIndicator,tdColumn,true);
  GridData gd=new GridData();
  gd.widthHint=900;
  gd.heightHint=450;
  hcc.setLayoutData(gd);
}
Program: 139995
Project: 139995
Buggy source:
@Override public void expansionStateChanged(ExpansionEvent e){
  getChartComposite().layout();
  form.reflow(true);
  composite.pack();
}

Fixed version (ground truth):
@Override public void expansionStateChanged(ExpansionEvent e){
  composite.layout();
  composite.pack();
  form.reflow(true);
}
Program: 139997
Project: 139997
Buggy source:
@Override protected Control createDialogArea(Composite parent){
  Composite top=new Composite(parent,SWT.NONE);
  top.setLayout(new GridLayout(2,false));
  Label dl=new Label(top,SWT.NONE);
  dl.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  dl.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
  timed=new DateTime(top,SWT.CALENDAR);
  timed.setLayoutData(new GridData(GridData.FILL_BOTH));
  if (isDatetime) {
    Label dt=new Label(top,SWT.NONE);
    dt.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    timet=new DateTime(top,SWT.TIME);
    timet.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  }
  return top;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(Composite parent){
  Composite top=new Composite(parent,SWT.NONE);
  top.setLayout(new GridLayout());
  dateTime=new DateTime(top,SWT.CALENDAR);
  dateTime.setLayoutData(new GridData(GridData.FILL_BOTH));
  if (isDatetime) {
    dateTime=new DateTime(top,SWT.TIME | SWT.BORDER);
    dateTime.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  }
  return top;
}
Program: 139998
Project: 139998
Buggy source:
@Override protected void okPressed(){
  Calendar cenlendar=Calendar.getInstance();
  SimpleDateFormat format=null;
  int year=timed.getYear();
  int month=timed.getMonth();
  int day=timed.getDay();
  if (timet != null) {
    format=new SimpleDateFormat("String_Node_Str");
    int hour=timet.getHours();
    int mnts=timet.getMinutes();
    int secds=timet.getSeconds();
    cenlendar.set(year,month,day,hour,mnts,secds);
  }
 else {
    format=new SimpleDateFormat("String_Node_Str");
    cenlendar.set(year,month,day);
  }
  selectDate=format.format(cenlendar.getTime());
  super.okPressed();
}

Fixed version (ground truth):
@Override protected void okPressed(){
  Calendar cenlendar=Calendar.getInstance();
  SimpleDateFormat format=null;
  int year=dateTime.getYear();
  int month=dateTime.getMonth();
  int day=dateTime.getDay();
  int hour=dateTime.getHours();
  int mnts=dateTime.getMinutes();
  int secds=dateTime.getSeconds();
  cenlendar.set(year,month,day,hour,mnts,secds);
  if (isDatetime) {
    format=new SimpleDateFormat("String_Node_Str");
  }
 else {
    format=new SimpleDateFormat("String_Node_Str");
  }
  selectDate=format.format(cenlendar.getTime());
  super.okPressed();
}
Program: 140001
Project: 140001
Buggy source:
@Override protected ColumnIndicator[] getPredefinedColumnIndicator(){
  IndicatorEnum[] allwedEnumes=new IndicatorEnum[2];
  allwedEnumes[0]=IndicatorEnum.LowFrequencyIndicatorEnum;
  allwedEnumes[1]=IndicatorEnum.FrequencyIndicatorEnum;
  ColumnIndicator[] returnColumnIndicator=composePredefinedColumnIndicator(allwedEnumes);
  if (parameters != null) {
    for (    ColumnIndicator columnIndicator : returnColumnIndicator) {
      for (      Indicator indicator : columnIndicator.getIndicators()) {
        if (indicator instanceof FrequencyIndicator) {
          indicator.getParameters().getDateParameters().setDateAggregationType(parameters.getDateParameters().getDateAggregationType());
        }
      }
    }
  }
  return returnColumnIndicator;
}

Fixed version (ground truth):
@Override protected ColumnIndicator[] getPredefinedColumnIndicator(){
  IndicatorEnum[] allwedEnumes=new IndicatorEnum[5];
  allwedEnumes[0]=IndicatorEnum.CountsIndicatorEnum;
  allwedEnumes[1]=IndicatorEnum.MinValueIndicatorEnum;
  allwedEnumes[2]=IndicatorEnum.MaxValueIndicatorEnum;
  allwedEnumes[3]=IndicatorEnum.LowFrequencyIndicatorEnum;
  allwedEnumes[4]=IndicatorEnum.FrequencyIndicatorEnum;
  ColumnIndicator[] returnColumnIndicator=composePredefinedColumnIndicator(allwedEnumes);
  if (parameters != null) {
    for (    ColumnIndicator columnIndicator : returnColumnIndicator) {
      for (      Indicator indicator : columnIndicator.getIndicators()) {
        if (indicator instanceof FrequencyIndicator) {
          indicator.getParameters().getDateParameters().setDateAggregationType(parameters.getDateParameters().getDateAggregationType());
        }
      }
    }
  }
  return returnColumnIndicator;
}
Program: 140002
Project: 140002
Buggy source:
@Override public void run(){
  if (isSelectedSameDataProvider()) {
    TdColumn oneColumn=columns[0];
    TdDataProvider dataprovider=DataProviderHelper.getTdDataProvider(oneColumn);
    ColumnSet columnSetOwner=ColumnHelper.getColumnSetOwner(oneColumn);
    String tableName=ColumnSetNameHelper.getColumnSetQualifiedName(dataprovider,columnSetOwner);
    String columnClause="String_Node_Str";
    for (    TdColumn column : columns) {
      String columnName=ColumnHelper.getFullName(column);
      columnClause+=columnName + "String_Node_Str";
    }
    columnClause=columnClause.substring(0,columnClause.length() - 1);
    String query="String_Node_Str" + columnClause + "String_Node_Str"+ tableName;
    CorePlugin.getDefault().runInDQViewer(dataprovider,query,tableName);
  }
 else {
    MessageDialogWithToggle.openWarning(null,"String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (ColumnHelper.isFromSameTable(Arrays.asList((Column[])columns))) {
    TdColumn oneColumn=columns[0];
    TdDataProvider dataprovider=DataProviderHelper.getTdDataProvider(oneColumn);
    ColumnSet columnSetOwner=ColumnHelper.getColumnSetOwner(oneColumn);
    String tableName=ColumnSetNameHelper.getColumnSetQualifiedName(dataprovider,columnSetOwner);
    DbmsLanguage language=DbmsLanguageFactory.createDbmsLanguage(dataprovider);
    String columnClause="String_Node_Str";
    for (    TdColumn column : columns) {
      columnClause+=language.quote(column.getName()) + "String_Node_Str";
    }
    columnClause=columnClause.substring(0,columnClause.length() - 1);
    String query="String_Node_Str" + columnClause + "String_Node_Str"+ tableName;
    CorePlugin.getDefault().runInDQViewer(dataprovider,query,tableName);
  }
 else {
    MessageDialogWithToggle.openWarning(null,"String_Node_Str","String_Node_Str");
  }
}
Program: 140003
Project: 140003
Buggy source:
@Override public void run(){
  if (column != null) {
    TdDataProvider dataprovider=DataProviderHelper.getTdDataProvider(column);
    ColumnSet columnSetOwner=ColumnHelper.getColumnSetOwner(column);
    String tableName=ColumnSetNameHelper.getColumnSetQualifiedName(dataprovider,columnSetOwner);
    String columnName=ColumnHelper.getFullName(column);
    String query="String_Node_Str" + columnName + "String_Node_Str"+ tableName;
    CorePlugin.getDefault().runInDQViewer(dataprovider,query,column.getName());
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (isSelectedSameDataProvider()) {
    TdColumn oneColumn=columns[0];
    TdDataProvider dataprovider=DataProviderHelper.getTdDataProvider(oneColumn);
    ColumnSet columnSetOwner=ColumnHelper.getColumnSetOwner(oneColumn);
    String tableName=ColumnSetNameHelper.getColumnSetQualifiedName(dataprovider,columnSetOwner);
    String columnClause="String_Node_Str";
    for (    TdColumn column : columns) {
      String columnName=ColumnHelper.getFullName(column);
      columnClause+=columnName + "String_Node_Str";
    }
    columnClause=columnClause.substring(0,columnClause.length() - 1);
    String query="String_Node_Str" + columnClause + "String_Node_Str"+ tableName;
    CorePlugin.getDefault().runInDQViewer(dataprovider,query,tableName);
  }
 else {
    MessageDialogWithToggle.openWarning(null,"String_Node_Str","String_Node_Str");
  }
}
Program: 140004
Project: 140004
Buggy source:
public PreviewColumnAction(TdColumn column){
  super("String_Node_Str");
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.EXPLORE_IMAGE));
  this.column=column;
}

Fixed version (ground truth):
public PreviewColumnAction(TdColumn[] columns){
  super("String_Node_Str");
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.EXPLORE_IMAGE));
  this.columns=columns;
}
Program: 140005
Project: 140005
Buggy source:
@Override public void fillContextMenu(IMenuManager menu){
  TreeSelection treeSelection=((TreeSelection)this.getContext().getSelection());
  TdColumn column=(TdColumn)treeSelection.getFirstElement();
  PreviewColumnAction action=new PreviewColumnAction(column);
  menu.add(action);
}

Fixed version (ground truth):
@Override public void fillContextMenu(IMenuManager menu){
  TreeSelection treeSelection=((TreeSelection)this.getContext().getSelection());
  Object[] selectedObjs=treeSelection.toArray();
  TdColumn[] columns=new TdColumn[selectedObjs.length];
  for (int i=0; i < selectedObjs.length; i++) {
    columns[i]=(TdColumn)selectedObjs[i];
  }
  PreviewColumnAction action=new PreviewColumnAction(columns);
  menu.add(action);
}
Program: 140006
Project: 140006
Buggy source:
/** 
 * DOC Zqin Comment method "previewSelectedElements".
 * @param newTree
 */
private void previewSelectedElements(Tree newTree){
  TreeItem[] items=newTree.getSelection();
  if (isSelectedSameDataProvider(items)) {
    TreeItem oneItem=items[0];
    ColumnIndicator oneColumnIndicator=(ColumnIndicator)oneItem.getData(COLUMN_INDICATOR_KEY);
    TdColumn oneColumn=oneColumnIndicator.getTdColumn();
    TdDataProvider dataprovider=DataProviderHelper.getTdDataProvider(oneColumn);
    ColumnSet columnSetOwner=ColumnHelper.getColumnSetOwner(oneColumn);
    String tableName=ColumnSetNameHelper.getColumnSetQualifiedName(dataprovider,columnSetOwner);
    String columnClause="String_Node_Str";
    for (    TreeItem item : items) {
      ColumnIndicator columnIndicator=(ColumnIndicator)item.getData(COLUMN_INDICATOR_KEY);
      TdColumn column=columnIndicator.getTdColumn();
      String columnName=ColumnHelper.getFullName(column);
      columnClause+=columnName + "String_Node_Str";
    }
    columnClause=columnClause.substring(0,columnClause.length() - 1);
    String query="String_Node_Str" + columnClause + "String_Node_Str"+ tableName;
    CorePlugin.getDefault().runInDQViewer(dataprovider,query,tableName);
  }
 else {
    MessageDialogWithToggle.openWarning(null,"String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * DOC Zqin Comment method "previewSelectedElements".
 * @param newTree
 */
private void previewSelectedElements(Tree newTree){
  TreeItem[] items=newTree.getSelection();
  TdColumn[] columns=new TdColumn[items.length];
  for (int i=0; i < items.length; i++) {
    ColumnIndicator columnIndicator=(ColumnIndicator)items[i].getData(COLUMN_INDICATOR_KEY);
    TdColumn column=columnIndicator.getTdColumn();
    columns[i]=column;
  }
  new PreviewColumnAction(columns).run();
}
Program: 140007
Project: 140007
Buggy source:
private boolean isSelectedPatternIndicator(TreeItem[] items){
  if (!isSelectedIndicator(items)) {
    return false;
  }
  for (  TreeItem item : items) {
    IndicatorUnit unit=(IndicatorUnit)item.getData(INDICATOR_UNIT_KEY);
    Indicator indicator=unit.getIndicator();
    if (!(indicator instanceof PatternMatchingIndicator)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean isSelectedPatternIndicator(TreeItem[] items){
  if (!isSelectedIndicator(items)) {
    return false;
  }
  for (  TreeItem item : items) {
    IndicatorUnit unit=(IndicatorUnit)item.getData(INDICATOR_UNIT_KEY);
    if (unit != null) {
      Indicator indicator=unit.getIndicator();
      if (!(indicator instanceof PatternMatchingIndicator)) {
        return false;
      }
    }
  }
  return true;
}
Program: 140008
Project: 140008
Buggy source:
/** 
 * DOC Zqin Comment method "showSelectedElements".MOD 2009-01-07 mzhao
 * @param newTree
 */
private void showSelectedElements(Tree newTree){
  TreeItem[] selection=newTree.getSelection();
  DQRespositoryView dqview=(DQRespositoryView)CorePlugin.getDefault().findView(DQRespositoryView.ID);
  if (selection.length == 1) {
    try {
      ColumnIndicator columnIndicator=(ColumnIndicator)selection[0].getData(COLUMN_INDICATOR_KEY);
      TdColumn column=columnIndicator.getTdColumn();
      dqview.showSelectedElements(column);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC Zqin Comment method "showSelectedElements".MOD 2009-01-07 mzhao.
 * @param newTree
 */
private void showSelectedElements(Tree newTree){
  TreeItem[] selection=newTree.getSelection();
  DQRespositoryView dqview=(DQRespositoryView)CorePlugin.getDefault().findView(DQRespositoryView.ID);
  if (selection.length == 1) {
    try {
      ColumnIndicator columnIndicator=(ColumnIndicator)selection[0].getData(COLUMN_INDICATOR_KEY);
      TdColumn column=columnIndicator.getTdColumn();
      dqview.showSelectedElements(column);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 140010
Project: 140010
Buggy source:
@Override public void run(){
  if (preDo()) {
    WizardDialog dialog=getPredefinedDialog();
    if (dialog == null) {
      dialog=getStandardAnalysisWizardDialog();
    }
    dialog.setPageSize(500,340);
    if (dialog.open() == Window.OK) {
      if (getPredefinedColumnIndicator() != null) {
        getMasterPage().getTreeViewer().addElements(getPredefinedColumnIndicator());
        getMasterPage().doSave(null);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (preDo()) {
    WizardDialog dialog=getPredefinedDialog();
    if (dialog == null) {
      dialog=getStandardAnalysisWizardDialog();
    }
    dialog.setPageSize(500,340);
    if (dialog.open() == Window.OK) {
      ColumnIndicator[] predefinedColumnIndicator=getPredefinedColumnIndicator();
      if (predefinedColumnIndicator != null) {
        getMasterPage().getTreeViewer().addElements(predefinedColumnIndicator);
        getMasterPage().doSave(null);
      }
    }
  }
}
Program: 140011
Project: 140011
Buggy source:
@Override protected ColumnIndicator[] getPredefinedColumnIndicator(){
  IndicatorEnum[] allwedEnumes=new IndicatorEnum[5];
  allwedEnumes[0]=IndicatorEnum.CountsIndicatorEnum;
  allwedEnumes[1]=IndicatorEnum.MinValueIndicatorEnum;
  allwedEnumes[2]=IndicatorEnum.MaxValueIndicatorEnum;
  allwedEnumes[3]=IndicatorEnum.LowFrequencyIndicatorEnum;
  allwedEnumes[4]=IndicatorEnum.FrequencyIndicatorEnum;
  ColumnIndicator[] returnColumnIndicator=composePredefinedColumnIndicator(allwedEnumes);
  if (parameters != null) {
    for (    ColumnIndicator columnIndicator : returnColumnIndicator) {
      for (      Indicator indicator : columnIndicator.getIndicators()) {
        if (indicator instanceof FrequencyIndicator) {
          indicator.setParameters(parameters);
        }
      }
    }
  }
  return returnColumnIndicator;
}

Fixed version (ground truth):
@Override protected ColumnIndicator[] getPredefinedColumnIndicator(){
  IndicatorEnum[] allwedEnumes=new IndicatorEnum[2];
  allwedEnumes[0]=IndicatorEnum.LowFrequencyIndicatorEnum;
  allwedEnumes[1]=IndicatorEnum.FrequencyIndicatorEnum;
  ColumnIndicator[] returnColumnIndicator=composePredefinedColumnIndicator(allwedEnumes);
  if (parameters != null) {
    for (    ColumnIndicator columnIndicator : returnColumnIndicator) {
      for (      Indicator indicator : columnIndicator.getIndicators()) {
        if (indicator instanceof FrequencyIndicator) {
          indicator.getParameters().getDateParameters().setDateAggregationType(parameters.getDateParameters().getDateAggregationType());
        }
      }
    }
  }
  return returnColumnIndicator;
}
Program: 140012
Project: 140012
Buggy source:
/** 
 * DOC mzhao Comment method "openInSqlEditor".
 * @param tdDataProvider
 * @param query
 * @param editorName
 */
public SQLEditor openInSqlEditor(TdDataProvider tdDataProvider,String query,String editorName){
  if (editorName == null) {
    editorName=String.valueOf(SQLExplorerPlugin.getDefault().getEditorSerialNo());
  }
  TypedReturnCode<TdProviderConnection> tdPc=DataProviderHelper.getTdProviderConnection(tdDataProvider);
  TdProviderConnection providerConnection=tdPc.getObject();
  String url=providerConnection.getConnectionString();
  SQLExplorerPlugin sqlexplorer=SQLExplorerPlugin.getDefault();
  Collection<Alias> aliases=sqlexplorer.getAliasManager().getAliases();
  if (aliases.isEmpty()) {
    new ChangePerspectiveAction(PluginConstant.SE_ID).run();
  }
  SQLEditor editorPart=null;
  for (  Alias alias : aliases) {
    if (alias.getUrl().equals(url)) {
      SQLEditorInput input=new SQLEditorInput("String_Node_Str" + editorName + "String_Node_Str");
      input.setUser(alias.getDefaultUser());
      try {
        IWorkbenchPage page=SQLExplorerPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
        editorPart=(SQLEditor)page.openEditor((IEditorInput)input,SQLEditor.class.getName());
        editorPart.setText(query);
        break;
      }
 catch (      PartInitException e) {
        ExceptionHandler.process(e);
      }
    }
  }
  return editorPart;
}

Fixed version (ground truth):
/** 
 * DOC mzhao Comment method "openInSqlEditor".
 * @param tdDataProvider
 * @param query
 * @param editorName
 */
public SQLEditor openInSqlEditor(TdDataProvider tdDataProvider,String query,String editorName){
  if (editorName == null) {
    editorName=String.valueOf(SQLExplorerPlugin.getDefault().getEditorSerialNo());
  }
  TypedReturnCode<TdProviderConnection> tdPc=DataProviderHelper.getTdProviderConnection(tdDataProvider);
  TdProviderConnection providerConnection=tdPc.getObject();
  String url=providerConnection.getConnectionString();
  SQLExplorerPlugin sqlexplorer=SQLExplorerPlugin.getDefault();
  Collection<Alias> aliases=sqlexplorer.getAliasManager().getAliases();
  boolean isExisted=false;
  for (  Alias alias : aliases) {
    if (alias.getUrl().equals(url)) {
      isExisted=true;
    }
  }
  if (!isExisted) {
    new ChangePerspectiveAction(PluginConstant.SE_ID).run();
  }
  SQLEditor editorPart=null;
  for (  Alias alias : aliases) {
    if (alias.getUrl().equals(url)) {
      SQLEditorInput input=new SQLEditorInput("String_Node_Str" + editorName + "String_Node_Str");
      input.setUser(alias.getDefaultUser());
      try {
        IWorkbenchPage page=SQLExplorerPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
        editorPart=(SQLEditor)page.openEditor((IEditorInput)input,SQLEditor.class.getName());
        editorPart.setText(query);
        break;
      }
 catch (      PartInitException e) {
        ExceptionHandler.process(e);
      }
    }
  }
  return editorPart;
}
Program: 140014
Project: 140014
Buggy source:
@Override public void doSave(IProgressMonitor monitor){
  super.doSave(monitor);
  if (!canSave()) {
    return;
  }
  try {
    saveAnalysis();
    currentEditor.setRunActionButtonState(canRun());
    this.isDirty=false;
  }
 catch (  DataprofilerCoreException e) {
    ExceptionHandler.process(e,Level.ERROR);
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void doSave(IProgressMonitor monitor){
  ReturnCode rc=canSave();
  if (!rc.isOk()) {
    MessageDialogWithToggle.openError(null,"String_Node_Str",rc.getMessage());
  }
 else {
    super.doSave(monitor);
    try {
      saveAnalysis();
      currentEditor.setRunActionButtonState(canRun().isOk());
      this.isDirty=false;
    }
 catch (    DataprofilerCoreException e) {
      ExceptionHandler.process(e,Level.ERROR);
      e.printStackTrace();
    }
  }
}
Program: 140015
Project: 140015
Buggy source:
protected abstract boolean canRun();

Fixed version (ground truth):
protected abstract ReturnCode canRun();
Program: 140016
Project: 140016
Buggy source:
protected boolean canSave(){
  return true;
}

Fixed version (ground truth):
protected abstract ReturnCode canSave();
Program: 140017
Project: 140017
Buggy source:
@Override protected boolean canRun(){
  return true;
}

Fixed version (ground truth):
@Override protected ReturnCode canRun(){
  return new ReturnCode(true);
}
Program: 140018
Project: 140018
Buggy source:
@Override protected void pageChange(int newPageIndex){
  super.pageChange(newPageIndex);
  if (masterPage.isDirty() && (newPageIndex == RESULT_PAGE_INDEX)) {
    masterPage.doSave(null);
  }
  if (isRefreshResultPage && columnResultPage != null && newPageIndex == columnResultPage.getIndex() && columnResultPage instanceof ColumnAnalysisResultPage) {
    ((ColumnAnalysisResultPage)columnResultPage).refresh((ColumnMasterDetailsPage)masterPage);
    isRefreshResultPage=false;
  }
  if (isRefreshResultPage && columnResultPage != null && newPageIndex == columnResultPage.getIndex() && columnResultPage instanceof ColumnCorrelationNominalIntervalResultPage) {
    ((ColumnCorrelationNominalIntervalResultPage)columnResultPage).refresh((ColumnCorrelationNominalAndIntervalMasterPage)masterPage);
    isRefreshResultPage=false;
  }
  if (masterPage != null) {
    setRunActionButtonState(masterPage.canRun());
  }
}

Fixed version (ground truth):
@Override protected void pageChange(int newPageIndex){
  super.pageChange(newPageIndex);
  if (masterPage.isDirty() && (newPageIndex == RESULT_PAGE_INDEX)) {
    masterPage.doSave(null);
  }
  if (isRefreshResultPage && columnResultPage != null && newPageIndex == columnResultPage.getIndex() && columnResultPage instanceof ColumnAnalysisResultPage) {
    ((ColumnAnalysisResultPage)columnResultPage).refresh((ColumnMasterDetailsPage)masterPage);
    isRefreshResultPage=false;
  }
  if (isRefreshResultPage && columnResultPage != null && newPageIndex == columnResultPage.getIndex() && columnResultPage instanceof ColumnCorrelationNominalIntervalResultPage) {
    ((ColumnCorrelationNominalIntervalResultPage)columnResultPage).refresh((ColumnCorrelationNominalAndIntervalMasterPage)masterPage);
    isRefreshResultPage=false;
  }
  if (masterPage != null) {
    setRunActionButtonState(masterPage.canRun().isOk());
  }
}
Program: 140020
Project: 140020
Buggy source:
public boolean canRun(){
  if (isDirty() || getTreeViewer().getTree().getItemCount() == 0) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override protected ReturnCode canRun(){
  List<Column> columnSetMultiValueList=getTreeViewer().getColumnSetMultiValueList();
  if (columnSetMultiValueList.isEmpty()) {
    return new ReturnCode("String_Node_Str",false);
  }
  return new ReturnCode(true);
}
Program: 140021
Project: 140021
Buggy source:
protected boolean canSave(){
  return true;
}

Fixed version (ground truth):
@Override protected ReturnCode canSave(){
  List<Column> columnSetMultiValueList=getTreeViewer().getColumnSetMultiValueList();
  if (!columnSetMultiValueList.isEmpty()) {
    if (!ColumnHelper.isFromSameTable(columnSetMultiValueList)) {
      return new ReturnCode("String_Node_Str",false);
    }
  }
  return new ReturnCode(true);
}
Program: 140022
Project: 140022
Buggy source:
public void initialize(FormEditor editor){
  super.initialize(editor);
  columnCorrelationAnalysisHandler=new ColumnCorrelationAnalysisHandler();
  columnCorrelationAnalysisHandler.setAnalysis((Analysis)this.currentModelElement);
  stringDataFilter=columnCorrelationAnalysisHandler.getStringDataFilter();
  analyzedColumns=columnCorrelationAnalysisHandler.getAnalyzedColumns();
  CountAvgNullIndicator currentCountAvgNullIndicator;
  if (columnCorrelationAnalysisHandler.getIndicator() == null) {
    ColumnsetFactory columnsetFactory=ColumnsetFactory.eINSTANCE;
    currentCountAvgNullIndicator=columnsetFactory.createCountAvgNullIndicator();
    columnSetMultiIndicator=currentCountAvgNullIndicator;
    indicatorIsBlank=false;
  }
 else {
    indicatorIsBlank=false;
    columnSetMultiIndicator=(ColumnSetMultiValueIndicator)columnCorrelationAnalysisHandler.getIndicator();
  }
  for (  ModelElement element : analyzedColumns) {
    TdColumn tdColumn=SwitchHelpers.COLUMN_SWITCH.doSwitch(element);
    if (tdColumn == null) {
      continue;
    }
    DataminingType dataminingType=DataminingType.get(columnCorrelationAnalysisHandler.getDatamingType(tdColumn));
    MetadataHelper.setDataminingType(dataminingType == null ? DataminingType.NOMINAL : dataminingType,tdColumn);
  }
}

Fixed version (ground truth):
public void initialize(FormEditor editor){
  super.initialize(editor);
  columnCorrelationAnalysisHandler=new ColumnCorrelationAnalysisHandler();
  columnCorrelationAnalysisHandler.setAnalysis((Analysis)this.currentModelElement);
  stringDataFilter=columnCorrelationAnalysisHandler.getStringDataFilter();
  analyzedColumns=columnCorrelationAnalysisHandler.getAnalyzedColumns();
  CountAvgNullIndicator currentCountAvgNullIndicator;
  if (columnCorrelationAnalysisHandler.getIndicator() == null) {
    ColumnsetFactory columnsetFactory=ColumnsetFactory.eINSTANCE;
    currentCountAvgNullIndicator=columnsetFactory.createCountAvgNullIndicator();
    columnSetMultiIndicator=currentCountAvgNullIndicator;
  }
 else {
    columnSetMultiIndicator=(ColumnSetMultiValueIndicator)columnCorrelationAnalysisHandler.getIndicator();
  }
  for (  ModelElement element : analyzedColumns) {
    TdColumn tdColumn=SwitchHelpers.COLUMN_SWITCH.doSwitch(element);
    if (tdColumn == null) {
      continue;
    }
    DataminingType dataminingType=DataminingType.get(columnCorrelationAnalysisHandler.getDatamingType(tdColumn));
    MetadataHelper.setDataminingType(dataminingType == null ? DataminingType.NOMINAL : dataminingType,tdColumn);
  }
}
Program: 140023
Project: 140023
Buggy source:
@Override protected boolean canRun(){
  ColumnIndicator[] columnIndicators=treeViewer.getColumnIndicator();
  if (columnIndicators == null || columnIndicators.length == 0) {
    return false;
  }
  for (  ColumnIndicator columnIndicator : columnIndicators) {
    if (columnIndicator.getIndicators().length == 0) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override protected ReturnCode canRun(){
  ColumnIndicator[] columnIndicators=treeViewer.getColumnIndicator();
  if (columnIndicators == null || columnIndicators.length == 0) {
    return new ReturnCode("String_Node_Str",false);
  }
  for (  ColumnIndicator columnIndicator : columnIndicators) {
    if (columnIndicator.getIndicators().length == 0) {
      return new ReturnCode("String_Node_Str",false);
    }
  }
  return new ReturnCode(true);
}
Program: 140024
Project: 140024
Buggy source:
@Override protected boolean canRun(){
  return rowMatchingIndicatorA.getColumnSetA().size() != 0;
}

Fixed version (ground truth):
@Override protected ReturnCode canRun(){
  return new ReturnCode(rowMatchingIndicatorA.getColumnSetA().size() != 0);
}
Program: 140026
Project: 140026
Buggy source:
public void run(){
  Map<EIndicatorChartType,List<IndicatorUnit>> indicatorComposite=CompositeIndicator.getInstance().getIndicatorComposite(columnIndicator);
  for (  EIndicatorChartType chartType : indicatorComposite.keySet()) {
    List<IndicatorUnit> units=indicatorComposite.get(chartType);
    if (!units.isEmpty()) {
      IChartTypeStates chartTypeState=ChartTypeStatesOperator.getChartState(chartType,units);
      JFreeChart chart=chartTypeState.getFeatChart();
      if (chart != null) {
        ChartComposite cc=new ChartComposite(comp,SWT.NONE,chart,true);
        GridData gd=new GridData();
        gd.widthHint=550;
        gd.heightHint=250;
        cc.setLayoutData(gd);
      }
    }
  }
}

Fixed version (ground truth):
public void run(){
  Map<EIndicatorChartType,List<IndicatorUnit>> indicatorComposite=CompositeIndicator.getInstance().getIndicatorComposite(columnIndicator);
  for (  EIndicatorChartType chartType : indicatorComposite.keySet()) {
    List<IndicatorUnit> units=indicatorComposite.get(chartType);
    if (!units.isEmpty()) {
      final IChartTypeStates chartTypeState=ChartTypeStatesOperator.getChartState(chartType,units);
      JFreeChart chart=chartTypeState.getFeatChart();
      if (chart != null) {
        final ChartComposite chartComp=new ChartComposite(comp,SWT.NONE,chart,true);
        GridData gd=new GridData();
        gd.widthHint=550;
        gd.heightHint=250;
        chartComp.setLayoutData(gd);
        addListenerToChartComp(chartComp,chartTypeState);
      }
    }
  }
}
Program: 140028
Project: 140028
Buggy source:
public AbstractChartTypeStates(List<IndicatorUnit> units){
  Iterator<IndicatorUnit> it=units.iterator();
  while (it.hasNext()) {
    IndicatorUnit unit=it.next();
    if (!unit.isExcuted()) {
      it.remove();
    }
 else {
      IndicatorCommonUtil.getIndicatorValue(unit);
    }
  }
  this.units=units;
}

Fixed version (ground truth):
public AbstractChartTypeStates(List<IndicatorUnit> units){
  Iterator<IndicatorUnit> it=units.iterator();
  while (it.hasNext()) {
    IndicatorUnit unit=it.next();
    if (!unit.isExcuted()) {
      it.remove();
    }
 else {
      IndicatorCommonUtil.getIndicatorValue(unit);
    }
  }
  if (units != null) {
    this.units.addAll(units);
  }
}
Program: 140029
Project: 140029
Buggy source:
public boolean createDQStructure(){
  Shell shell=PlatformUI.getWorkbench().getDisplay().getActiveShell();
  try {
    IProject project=this.createNewProject(DATA_PROFILING,shell);
    IFolder createNewFoler=this.createNewFoler(project,ANALYSIS);
    createNewFoler.setPersistentProperty(FOLDER_CLASSIFY_KEY,ANALYSIS_FOLDER_PROPERTY);
    createNewFoler=this.createNewFoler(project,REPORTS);
    createNewFoler.setPersistentProperty(FOLDER_CLASSIFY_KEY,REPORT_FOLDER_PROPERTY);
    project=this.createNewProject(LIBRARIES,shell);
    createNewFoler=this.createNewFoler(project,PATTERNS);
    createNewFoler.setPersistentProperty(FOLDER_CLASSIFY_KEY,PATTERNS_FOLDER_PROPERTY);
    checkVersionFile(project);
    this.copyFilesToFolder(PATTERN_PATH,true,createNewFoler);
    createNewFoler=this.createNewFoler(project,SQL_PATTERNS);
    createNewFoler.setPersistentProperty(FOLDER_CLASSIFY_KEY,SQLPATTERNS_FOLDER_PROPERTY);
    this.copyFilesToFolder(SQL_LIKE_PATH,true,createNewFoler);
    createNewFoler=this.createNewFoler(project,SOURCE_FILES);
    createNewFoler.setPersistentProperty(FOLDER_CLASSIFY_KEY,SOURCEFILES_FOLDER_PROPERTY);
    this.copyFilesToFolder(DEMO_PATH,true,createNewFoler);
    project=this.createNewProject(METADATA,shell);
    createNewFoler=this.createNewFoler(project,DB_CONNECTIONS);
    createNewFoler.setPersistentProperty(FOLDER_CLASSIFY_KEY,DBCONNECTION_FOLDER_PROPERTY);
  }
 catch (  Exception ex) {
    ExceptionHandler.process(ex);
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean createDQStructure(){
  Shell shell=PlatformUI.getWorkbench().getDisplay().getActiveShell();
  try {
    IProject project=this.createNewProject(DATA_PROFILING,shell);
    IFolder createNewFoler=this.createNewFoler(project,ANALYSIS);
    createNewFoler.setPersistentProperty(FOLDER_CLASSIFY_KEY,ANALYSIS_FOLDER_PROPERTY);
    createNewFoler=this.createNewFoler(project,REPORTS);
    createNewFoler.setPersistentProperty(FOLDER_CLASSIFY_KEY,REPORT_FOLDER_PROPERTY);
    project=this.createNewProject(LIBRARIES,shell);
    createNewFoler=this.createNewFoler(project,PATTERNS);
    createNewFoler.setPersistentProperty(FOLDER_CLASSIFY_KEY,PATTERNS_FOLDER_PROPERTY);
    WorkspaceVersionHelper.storeVersion();
    this.copyFilesToFolder(PATTERN_PATH,true,createNewFoler);
    createNewFoler=this.createNewFoler(project,SQL_PATTERNS);
    createNewFoler.setPersistentProperty(FOLDER_CLASSIFY_KEY,SQLPATTERNS_FOLDER_PROPERTY);
    this.copyFilesToFolder(SQL_LIKE_PATH,true,createNewFoler);
    createNewFoler=this.createNewFoler(project,SOURCE_FILES);
    createNewFoler.setPersistentProperty(FOLDER_CLASSIFY_KEY,SOURCEFILES_FOLDER_PROPERTY);
    this.copyFilesToFolder(DEMO_PATH,true,createNewFoler);
    project=this.createNewProject(METADATA,shell);
    createNewFoler=this.createNewFoler(project,DB_CONNECTIONS);
    createNewFoler.setPersistentProperty(FOLDER_CLASSIFY_KEY,DBCONNECTION_FOLDER_PROPERTY);
  }
 catch (  Exception ex) {
    ExceptionHandler.process(ex);
    return false;
  }
  return true;
}
Program: 140032
Project: 140032
Buggy source:
@Override public void run(){
  for (  Section section : editorBarWrap.getSections()) {
    section.setExpanded(false);
  }
}

Fixed version (ground truth):
@Override public void run(){
  Iterator<Section> it=editorBarWrap.getSections().iterator();
  Section section=null;
  while (it.hasNext()) {
    section=it.next();
    if (section == null || section.isDisposed()) {
      it.remove();
      continue;
    }
    section.setExpanded(false);
  }
  section=null;
}
Program: 140033
Project: 140033
Buggy source:
public static ProductVersion getVesion(){
  IFile versionFile=getVersionFile();
  if (versionFile.exists()) {
    Properties pros=new Properties();
    try {
      pros.load(versionFile.getContents());
      String version=pros.getProperty(VERSION);
      if (!"String_Node_Str".equals(version)) {
        return ProductVersion.fromString(version);
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return new ProductVersion(0,0,0);
}

Fixed version (ground truth):
public static ProductVersion getVesion(){
  IFile versionFile=getVersionFile();
  if (versionFile.exists()) {
    Properties pros=new Properties();
    try {
      pros.load(versionFile.getContents());
      String version=pros.getProperty(VERSION);
      if (version != null && !"String_Node_Str".equals(version)) {
        return ProductVersion.fromString(version);
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return new ProductVersion(0,0,0);
}
Program: 140034
Project: 140034
Buggy source:
public void setEnitty(ChartDataEntity entity){
  this.entity=entity;
  this.indicator=entity.getIndicator();
  this.indicatorEnum=IndicatorEnum.findIndicatorEnum(indicator.eClass());
  this.columnName=dbmsLanguage.quote(indicator.getAnalyzedElement().getName());
}

Fixed version (ground truth):
public void setEnitty(ChartDataEntity entity){
  this.entity=entity;
  this.indicator=entity.getIndicator();
  this.indicatorEnum=IndicatorEnum.findIndicatorEnum(indicator.eClass());
  this.columnName=dbmsLanguage.quote(indicator.getAnalyzedElement().getName());
  this.sqltype=((TdColumn)entity.getIndicator().getAnalyzedElement()).getJavaType();
}
Program: 140035
Project: 140035
Buggy source:
/** 
 * Method "getMatchingRowsStatement".
 * @return the query to get the rows with a matching value
 */
private String getMatchingRowsStatement(){
  double value=Double.valueOf(entity.getValue());
  String whereClause=dbmsLanguage.where() + this.columnName + dbmsLanguage.equal()+ value;
  TdColumn column=(TdColumn)indicator.getAnalyzedElement();
  return "String_Node_Str" + getFullyQualifiedTableName(column) + whereClause;
}

Fixed version (ground truth):
/** 
 * Method "getMatchingRowsStatement".
 * @return the query to get the rows with a matching value
 */
private String getMatchingRowsStatement(){
  String whereClause="String_Node_Str";
  if (Java2SqlType.isDateInSQL(sqltype)) {
    Date date=new Date(entity.getValue());
    whereClause=dbmsLanguage.where() + this.columnName + dbmsLanguage.equal()+ date.toString();
  }
 else {
    double value=Double.valueOf(entity.getValue());
    whereClause=dbmsLanguage.where() + this.columnName + dbmsLanguage.equal()+ value;
  }
  TdColumn column=(TdColumn)indicator.getAnalyzedElement();
  return "String_Node_Str" + getFullyQualifiedTableName(column) + whereClause;
}
Program: 140036
Project: 140036
Buggy source:
/** 
 * DOC zqin Comment method "isDateValue".
 * @param inputString
 * @return
 */
public static boolean isDateValue(String inputString){
  if (!isEmpty(inputString)) {
    try {
      DateFormat df=DateFormat.getDateInstance();
      df.parse(inputString);
      return true;
    }
 catch (    Exception e) {
      return false;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * DOC zqin Comment method "isDateValue".
 * @param inputString
 * @return
 */
public static boolean isDateValue(String inputString){
  if (!isEmpty(inputString)) {
    try {
      DateFormat df=new SimpleDateFormat("String_Node_Str");
      df.setLenient(false);
      df.parse(inputString);
      return true;
    }
 catch (    Exception e) {
      return false;
    }
  }
  return false;
}
Program: 140037
Project: 140037
Buggy source:
/** 
 * DOC Zqin DateTimeDialog constructor comment.
 * @param shell
 */
public DateTimeDialog(Shell shell){
  super(shell);
}

Fixed version (ground truth):
/** 
 * DOC Zqin DateTimeDialog constructor comment.
 * @param shell
 */
public DateTimeDialog(Shell shell,boolean isDatetime){
  super(shell);
  this.isDatetime=isDatetime;
}
Program: 140038
Project: 140038
Buggy source:
@Override protected Control createDialogArea(Composite parent){
  Composite top=new Composite(parent,SWT.NONE);
  top.setLayout(new FillLayout());
  timec=new DateTime(top,SWT.CALENDAR);
  return top;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(Composite parent){
  Composite top=new Composite(parent,SWT.NONE);
  top.setLayout(new GridLayout(2,false));
  Label dl=new Label(top,SWT.NONE);
  dl.setText("String_Node_Str");
  dl.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
  timed=new DateTime(top,SWT.CALENDAR);
  timed.setLayoutData(new GridData(GridData.FILL_BOTH));
  if (isDatetime) {
    Label dt=new Label(top,SWT.NONE);
    dt.setText("String_Node_Str");
    timet=new DateTime(top,SWT.TIME);
    timet.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  }
  return top;
}