nus-yam/ex-repair huggingface dataset:
Program: 136955
Project: 136955
Buggy source:
/** 
 * DOC zhao Comment method "removeAllSurvivorship".
 */
protected void removeAllSurvivorship(){
  matchAndSurvivorKeySection.removeAllSurvivorship();
}

Fixed version (ground truth):
/** 
 * DOC zhao Comment method "removeAllSurvivorship".
 * @param redrawn whether needed redrawn the section after remove All of survivorship
 */
protected void removeAllSurvivorship(){
  matchAndSurvivorKeySection.removeAllSurvivorship();
}
Program: 136956
Project: 136956
Buggy source:
public void initTableInput(boolean isClearSurvivor){
  List<MatchKeyAndSurvivorDefinition> keyList=new ArrayList<MatchKeyAndSurvivorDefinition>();
  EList<MatchRule> matchRules=matchRuleDef.getMatchRules();
  if (!matchRules.isEmpty()) {
    keyList=getKeyList(matchRules.get(0),isClearSurvivor);
    matchAndSurvivorKeyList=matchRuleWithSurvMap.get(matchRules.get(0));
  }
  tableComposite.setInput(keyList);
  if (!matchRules.isEmpty()) {
    tableComposite.setMatchIntervalText(String.valueOf(matchRules.get(0).getMatchInterval()));
  }
  groupQualityThresholdText.setText(String.valueOf(this.matchRuleDef.getMatchGroupQualityThreshold()));
}

Fixed version (ground truth):
public void initTableInput(boolean isClearSurvivor){
  List<MatchKeyAndSurvivorDefinition> generatedSurvivorKeyList=new ArrayList<MatchKeyAndSurvivorDefinition>();
  EList<MatchRule> matchRules=matchRuleDef.getMatchRules();
  if (!matchRules.isEmpty()) {
    generatedSurvivorKeyList=generateSurvivorKeyByMatchKey(matchRules.get(0),isClearSurvivor);
    matchAndSurvivorKeyList=matchRuleWithSurvMap.get(matchRules.get(0));
  }
  tableComposite.setInput(generatedSurvivorKeyList);
  if (!matchRules.isEmpty()) {
    tableComposite.setMatchIntervalText(String.valueOf(matchRules.get(0).getMatchInterval()));
  }
  groupQualityThresholdText.setText(String.valueOf(this.matchRuleDef.getMatchGroupQualityThreshold()));
}
Program: 136957
Project: 136957
Buggy source:
public Map<String,String> getQueryMap(){
  Map<String,String> map=new HashMap<String,String>();
  boolean isSqlEngine=ExecutionLanguage.SQL.equals(this.analysis.getParameters().getExecutionLanguage());
  map.put(MENU_VIEW_ROWS,isSqlEngine ? getComment(MENU_VIEW_ROWS) + getFreqRowsStatement() : null);
  return map;
}

Fixed version (ground truth):
public Map<String,String> getQueryMap(){
  Map<String,String> map=new HashMap<String,String>();
  boolean isJavaEngine=AnalysisHelper.isJavaExecutionEngine(this.analysis);
  map.put(MENU_VIEW_ROWS,!isJavaEngine ? getComment(MENU_VIEW_ROWS) + getFreqRowsStatement() : null);
  return map;
}
Program: 136962
Project: 136962
Buggy source:
/** 
 * DOC msjian Comment method "createDrillDownMenu".
 * @param dataEntity
 * @param menu
 * @param itemEntities
 * @param analysis
 */
private static void createDrillDownMenu(final ChartDataEntity dataEntity,Menu menu,MenuItemEntity[] itemEntities,final Analysis analysis){
  for (  final MenuItemEntity itemEntity : itemEntities) {
    MenuItem item=new MenuItem(menu,SWT.PUSH);
    item.setText(itemEntity.getLabel());
    item.setImage(itemEntity.getIcon());
    try {
      int mapSize=DrillDownUtils.getMapDB(dataEntity,analysis,itemEntity).size();
      item.setEnabled(mapSize > 0);
    }
 catch (    IOError e) {
      item.setEnabled(false);
    }
    item.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        CorePlugin.getDefault().openEditor(new DrillDownEditorInput(analysis,dataEntity,itemEntity),DRILL_DOWN_EDITOR);
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * DOC msjian Comment method "createDrillDownMenu".
 * @param dataEntity
 * @param menu
 * @param itemEntities
 * @param analysis
 */
private static void createDrillDownMenu(final ChartDataEntity dataEntity,Menu menu,MenuItemEntity[] itemEntities,final Analysis analysis){
  for (  final MenuItemEntity itemEntity : itemEntities) {
    MenuItem item=new MenuItem(menu,SWT.PUSH);
    item.setText(itemEntity.getLabel());
    item.setImage(itemEntity.getIcon());
    item.setEnabled(isMenuItemEnable(dataEntity,itemEntity,analysis));
    item.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        CorePlugin.getDefault().openEditor(new DrillDownEditorInput(analysis,dataEntity,itemEntity),DRILL_DOWN_EDITOR);
      }
    }
);
  }
}
Program: 136963
Project: 136963
Buggy source:
private void setValue(String key){
  Long c=this.getMapForFreq().get(key);
  if (c == null) {
    this.getMapForFreq().put(key,1L);
  }
 else {
    c++;
    this.getMapForFreq().put(key,c);
  }
}

Fixed version (ground truth):
private void setValue(String key){
  Long c=this.valueToFreq.get(key);
  if (c == null) {
    this.valueToFreq.put(key,1L);
  }
 else {
    c++;
    this.valueToFreq.put(key,c);
  }
}
Program: 136964
Project: 136964
Buggy source:
@Override public boolean reset(){
  boolean ok=super.reset();
  for (int i=1; i <= 9; i++) {
    valueToFreq.put(String.valueOf(i),0L);
  }
  return ok;
}

Fixed version (ground truth):
@Override public boolean reset(){
  boolean ok=super.reset();
  for (int i=1; i <= 9; i++) {
    this.valueToFreq.put(String.valueOf(i),0L);
  }
  return ok;
}
Program: 136965
Project: 136965
Buggy source:
/** 
 * handle some special cases for SQL engine: <ul> <li>when there are null values;</li> <li>when there miss some numbers between 1~9;</li> <li>when the column is double, the leading digit maybe 0;</li> <li>when the column is string type, when the leading is not 1~9, all counted into "invalid" one.</li> </ul>
 */
private void handleSpecialCharacterAndMissingValues(){
  if (isChecked && this.getMapForFreq().size() < 1) {
    return;
  }
  long counted=0L;
  List<Object> invalid=new ArrayList<Object>();
  List<Object> lengthMore=new ArrayList<Object>();
  for (  Object val : this.getMapForFreq().keySet()) {
    if (isInvalid(val) < 0) {
      invalid.add(val);
      Long freq=this.getMapForFreq().get(val);
      counted=(freq == null) ? counted : counted + freq;
    }
 else     if (String.valueOf(val).length() > 1) {
      lengthMore.add(val);
    }
  }
  if (invalid.size() > 0) {
    for (    Object val : invalid) {
      this.getMapForFreq().remove(val);
    }
    this.getMapForFreq().put(INVALID,counted);
  }
  if (lengthMore.size() > 0) {
    for (    Object val : lengthMore) {
      String k=String.valueOf(val).substring(0,1);
      Long freq=this.getMapForFreq().get(val);
      this.getMapForFreq().remove(val);
      this.getMapForFreq().put(k,freq);
    }
  }
  for (int i=1; i < 10; i++) {
    Long value=this.getMapForFreq().get(String.valueOf(i));
    if (value == null) {
      this.getMapForFreq().put(String.valueOf(i),0L);
    }
  }
  isChecked=true;
}

Fixed version (ground truth):
/** 
 * handle some special cases for SQL engine: <ul> <li>when there are null values;</li> <li>when there miss some numbers between 1~9;</li> <li>when the column is double, the leading digit maybe 0;</li> <li>when the column is string type, when the leading is not 1~9, all counted into "invalid" one.</li> </ul>
 */
private void handleSpecialCharacterAndMissingValues(){
  if (isChecked && this.valueToFreq.size() < 1) {
    return;
  }
  long counted=0L;
  List<Object> invalid=new ArrayList<Object>();
  List<Object> lengthMore=new ArrayList<Object>();
  for (  Object val : this.valueToFreq.keySet()) {
    if (isInvalid(val) < 0) {
      invalid.add(val);
      Long freq=this.valueToFreq.get(val);
      counted=(freq == null) ? counted : counted + freq;
    }
 else     if (String.valueOf(val).length() > 1) {
      lengthMore.add(val);
    }
  }
  if (invalid.size() > 0) {
    for (    Object val : invalid) {
      this.valueToFreq.remove(val);
    }
    this.valueToFreq.put(INVALID,counted);
  }
  if (lengthMore.size() > 0) {
    for (    Object val : lengthMore) {
      String k=String.valueOf(val).substring(0,1);
      Long freq=this.valueToFreq.get(val);
      this.valueToFreq.remove(val);
      this.valueToFreq.put(k,freq);
    }
  }
  for (int i=1; i < 10; i++) {
    Long value=this.valueToFreq.get(String.valueOf(i));
    if (value == null) {
      this.valueToFreq.put(String.valueOf(i),0L);
    }
  }
  isChecked=true;
}
Program: 136966
Project: 136966
Buggy source:
@Override protected String getFormatName(Object data){
  String monthStr=DateFormatUtils.format((Date)data,monthSign);
  int month=Integer.parseInt(monthStr) / 4 + 1;
  return DateFormatUtils.format((Date)data,datePattern + month);
}

Fixed version (ground truth):
@Override protected String getFormatName(Object data){
  String monthStr=DateFormatUtils.format((Date)data,monthSign);
  int month=Integer.parseInt(monthStr);
  int quotient=month / 3;
  int remainder=month % 3;
  int quarter=remainder == 0 ? quotient : quotient + 1;
  return DateFormatUtils.format((Date)data,datePattern + quarter);
}
Program: 136967
Project: 136967
Buggy source:
@Override protected String getFormatName(Object data){
  String monthStr=DateFormatUtils.format((Date)data,monthSign);
  int month=Integer.parseInt(monthStr) / 4 + 1;
  return DateFormatUtils.format((Date)data,datePattern + month);
}

Fixed version (ground truth):
@Override protected String getFormatName(Object data){
  String monthStr=DateFormatUtils.format((Date)data,monthSign);
  int month=Integer.parseInt(monthStr);
  int quotient=month / 3;
  int remainder=month % 3;
  int quarter=remainder == 0 ? quotient : quotient + 1;
  return DateFormatUtils.format((Date)data,datePattern + quarter);
}
Program: 136968
Project: 136968
Buggy source:
/** 
 * get week of year,make this indicator running result same as SQL engine, so minus 1.
 * @param date
 * @return
 */
private int getWeekOfYear(Date date){
  String weekStr=DateFormatUtils.format(date,weekSign);
  int weekOfYear=Integer.parseInt(weekStr);
  if (weekOfYear > 0) {
    weekOfYear--;
  }
  return weekOfYear;
}

Fixed version (ground truth):
/** 
 * get week of year,make this indicator running result same as SQL engine, so minus 1.
 * @param date
 * @return
 */
private int getWeekOfYear(Date date){
  Calendar cal=Calendar.getInstance(TimeZone.getDefault(),Locale.getDefault());
  cal.setTime(date);
  int weekOfYear=cal.get(Calendar.WEEK_OF_YEAR);
  return weekOfYear;
}
Program: 136969
Project: 136969
Buggy source:
/** 
 * get week of year,make this indicator running result same as SQL engine, so minus 1.
 * @param date
 * @return
 */
private int getWeekOfYear(Date date){
  String weekStr=DateFormatUtils.format(date,weekSign);
  int weekOfYear=Integer.parseInt(weekStr);
  if (weekOfYear > 0) {
    weekOfYear--;
  }
  return weekOfYear;
}

Fixed version (ground truth):
/** 
 * get week of year,make this indicator running result same as SQL engine, so minus 1.
 * @param date
 * @return
 */
private int getWeekOfYear(Date date){
  Calendar cal=Calendar.getInstance(TimeZone.getDefault(),Locale.getDefault());
  cal.setTime(date);
  int weekOfYear=cal.get(Calendar.WEEK_OF_YEAR);
  return weekOfYear;
}
Program: 136970
Project: 136970
Buggy source:
public Map<String,String> getQueryMap(){
  boolean isSqlEngine=ExecutionLanguage.SQL.equals(this.analysis.getParameters().getExecutionLanguage());
  Map<String,String> map=new HashMap<String,String>();
  boolean isHive=dbmsLanguage instanceof HiveDbmsLanguage;
  if (!isHive) {
switch (this.indicatorEnum) {
case AverageLengthIndicatorEnum:
case AverageLengthWithBlankIndicatorEnum:
      map.put(MENU_VIEW_ROWS,isSqlEngine ? getComment(MENU_VIEW_ROWS) + getAverageLengthWithBlankRowsStatement() : null);
    break;
case AverageLengthWithNullBlankIndicatorEnum:
  map.put(MENU_VIEW_ROWS,isSqlEngine ? getComment(MENU_VIEW_ROWS) + getAverageLengthWithNullBlankRowsStatement() : null);
break;
case AverageLengthWithNullIndicatorEnum:
map.put(MENU_VIEW_ROWS,isSqlEngine ? getComment(MENU_VIEW_ROWS) + getAverageLengthWithNullRowsStatement() : null);
break;
case MinLengthIndicatorEnum:
case MaxLengthIndicatorEnum:
case MinLengthWithBlankIndicatorEnum:
case MinLengthWithBlankNullIndicatorEnum:
case MinLengthWithNullIndicatorEnum:
case MaxLengthWithBlankIndicatorEnum:
case MaxLengthWithBlankNullIndicatorEnum:
case MaxLengthWithNullIndicatorEnum:
map.put(MENU_VIEW_ROWS,isSqlEngine ? getComment(MENU_VIEW_ROWS) + getTextRowsStatement() : null);
break;
default :
}
}
 else {
if (!isSqlEngine) {
map.put(MENU_VIEW_ROWS,null);
}
}
return map;
}

Fixed version (ground truth):
public Map<String,String> getQueryMap(){
  boolean isSqlEngine=ExecutionLanguage.SQL.equals(this.analysis.getParameters().getExecutionLanguage());
  Map<String,String> map=new HashMap<String,String>();
  boolean isHive=dbmsLanguage instanceof HiveDbmsLanguage;
  if (!isHive) {
switch (this.indicatorEnum) {
case AverageLengthIndicatorEnum:
case AverageLengthWithBlankIndicatorEnum:
      if (isSqlEngine) {
        map.put(MENU_VIEW_ROWS,getComment(MENU_VIEW_ROWS) + getAverageLengthWithBlankRowsStatement());
      }
    break;
case AverageLengthWithNullBlankIndicatorEnum:
  if (isSqlEngine) {
    map.put(MENU_VIEW_ROWS,getComment(MENU_VIEW_ROWS) + getAverageLengthWithNullBlankRowsStatement());
  }
break;
case AverageLengthWithNullIndicatorEnum:
if (isSqlEngine) {
map.put(MENU_VIEW_ROWS,getComment(MENU_VIEW_ROWS) + getAverageLengthWithNullRowsStatement());
}
break;
case MinLengthIndicatorEnum:
case MaxLengthIndicatorEnum:
case MinLengthWithBlankIndicatorEnum:
case MinLengthWithBlankNullIndicatorEnum:
case MinLengthWithNullIndicatorEnum:
case MaxLengthWithBlankIndicatorEnum:
case MaxLengthWithBlankNullIndicatorEnum:
case MaxLengthWithNullIndicatorEnum:
map.put(MENU_VIEW_ROWS,isSqlEngine ? getComment(MENU_VIEW_ROWS) + getTextRowsStatement() : null);
break;
default :
}
}
 else {
if (!isSqlEngine) {
switch (this.indicatorEnum) {
case MinLengthIndicatorEnum:
case MinLengthWithBlankIndicatorEnum:
case MinLengthWithBlankNullIndicatorEnum:
case MinLengthWithNullIndicatorEnum:
case MaxLengthIndicatorEnum:
case MaxLengthWithBlankIndicatorEnum:
case MaxLengthWithBlankNullIndicatorEnum:
case MaxLengthWithNullIndicatorEnum:
map.put(MENU_VIEW_ROWS,null);
break;
default :
}
}
}
return map;
}
Program: 136971
Project: 136971
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public PageResult<Object[]> loadPage(PageableController controller){
  int dbSize=db.size();
  long totalSize=dbSize < itemsSize ? dbSize : itemsSize;
  long pageSize=controller.getPageSize();
  long pageIndex=controller.getPageOffset();
  long fromIndex=pageIndex;
  long toIndex=pageIndex + pageSize;
  if (toIndex > totalSize) {
    toIndex=totalSize;
  }
  if (dataValidator == null) {
    return MapDBPageListHelper.createPage(db,indexMap,columnFilter,fromIndex,toIndex,totalSize);
  }
 else {
    return MapDBPageListHelper.createPage(db,indexMap,dataValidator,fromIndex,toIndex,totalSize);
  }
}

Fixed version (ground truth):
@Override public PageResult<Object[]> loadPage(PageableController controller){
  long totalSize=itemsSize;
  long pageSize=controller.getPageSize();
  long pageIndex=controller.getPageOffset();
  long fromIndex=pageIndex;
  long toIndex=pageIndex + pageSize;
  if (toIndex > totalSize) {
    toIndex=totalSize;
  }
  if (dataValidator == null) {
    return MapDBPageListHelper.createPage(db,indexMap,columnFilter,fromIndex,toIndex,totalSize);
  }
 else {
    return MapDBPageListHelper.createPage(db,indexMap,dataValidator,fromIndex,toIndex,totalSize);
  }
}
Program: 136978
Project: 136978
Buggy source:
/** 
 * DOC zshen Comment method "filterAdaptColumnHeader".
 * @returnget the name of column which will be displayed on the drill down editor.
 */
public List<String> filterAdaptColumnHeader(){
  Indicator indicator=this.getCurrIndicator();
  ModelElement analysisElement=indicator.getAnalyzedElement();
  String menuType=this.getMenuType();
  List<String> columnElementList=new ArrayList<String>();
  if (analysisElement == null && indicator.eContainer() instanceof SimpleStatIndicator) {
    columnElementList=columnHeaderForColumnSet((SimpleStatIndicator)indicator.eContainer());
  }
 else {
    if (DrillDownEditorInput.judgeMenuType(menuType,DrillDownEditorInput.MENU_VALUE_TYPE)) {
      columnElementList.add(ModelElementHelper.getName(indicator.getAnalyzedElement()));
    }
 else     if (analysisElement instanceof TdColumn) {
      for (      TdColumn column : TableHelper.getColumns(SwitchHelpers.TABLE_SWITCH.doSwitch(indicator.getAnalyzedElement().eContainer()))) {
        columnElementList.add(column.getName());
      }
    }
 else     if (analysisElement instanceof MetadataColumn) {
      MetadataTable mTable=ColumnHelper.getColumnOwnerAsMetadataTable((MetadataColumn)analysisElement);
      for (      MetadataColumn mColumn : mTable.getColumns()) {
        columnElementList.add(mColumn.getLabel());
      }
    }
  }
  return columnElementList;
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "filterAdaptColumnHeader".
 * @returnget the name of column which will be displayed on the drill down editor.
 */
public List<String> filterAdaptColumnHeader(){
  Indicator indicator=this.getCurrIndicator();
  ModelElement analysisElement=indicator.getAnalyzedElement();
  String menuType=this.getMenuType();
  List<String> columnElementList=new ArrayList<String>();
  if (analysisElement == null && indicator.eContainer() instanceof SimpleStatIndicator) {
    columnElementList=columnHeaderForColumnSet((SimpleStatIndicator)indicator.eContainer());
  }
 else {
    if (DrillDownUtils.judgeMenuType(menuType,DrillDownUtils.MENU_VALUE_TYPE)) {
      columnElementList.add(ModelElementHelper.getName(indicator.getAnalyzedElement()));
    }
 else     if (analysisElement instanceof TdColumn) {
      for (      TdColumn column : TableHelper.getColumns(SwitchHelpers.TABLE_SWITCH.doSwitch(indicator.getAnalyzedElement().eContainer()))) {
        columnElementList.add(column.getName());
      }
    }
 else     if (analysisElement instanceof MetadataColumn) {
      MetadataTable mTable=ColumnHelper.getColumnOwnerAsMetadataTable((MetadataColumn)analysisElement);
      for (      MetadataColumn mColumn : mTable.getColumns()) {
        columnElementList.add(mColumn.getLabel());
      }
    }
  }
  return columnElementList;
}
Program: 136979
Project: 136979
Buggy source:
/** 
 * Get index of column whiche will be used on the dirll down. Note that One indicator only belong one column so that the array of retrun value just contain one element. And if we create new map for view values menu rather than used same map with view rows menu then method can be removed
 * @return
 */
public Integer[] getColumnIndexArray(){
  if (!DrillDownEditorInput.judgeMenuType(this.getMenuType(),DrillDownEditorInput.MENU_VALUE_TYPE) || DuplicateCountIndicator.class.isInstance(currIndicator)) {
    return null;
  }
  List<Integer> indexArray=new ArrayList<Integer>();
  Indicator indicator=this.getCurrIndicator();
  ModelElement analysisElement=indicator.getAnalyzedElement();
  int index=0;
  if (analysisElement instanceof TdColumn) {
    TdTable tdTable=ColumnHelper.getColumnOwnerAsTdTable((TdColumn)analysisElement);
    for (    TdColumn column : TableHelper.getColumns(tdTable)) {
      if (column.getName().equals(analysisElement.getName())) {
        indexArray.add(index);
        break;
      }
      index++;
    }
  }
 else   if (analysisElement instanceof MetadataColumn) {
    MetadataTable mTable=ColumnHelper.getColumnOwnerAsMetadataTable((MetadataColumn)analysisElement);
    for (    MetadataColumn mColumn : mTable.getColumns()) {
      if (mColumn.getLabel().equals(analysisElement.getName())) {
        indexArray.add(index);
        break;
      }
      index++;
    }
  }
  return indexArray.toArray(new Integer[indexArray.size()]);
}

Fixed version (ground truth):
/** 
 * Get index of column whiche will be used on the dirll down. Note that One indicator only belong one column so that the array of retrun value just contain one element. And if we create new map for view values menu rather than used same map with view rows menu then method can be removed
 * @return
 */
public Integer[] getColumnIndexArray(){
  if (!DrillDownUtils.judgeMenuType(this.getMenuType(),DrillDownUtils.MENU_VALUE_TYPE) || !UniqueCountIndicator.class.isInstance(currIndicator)) {
    return null;
  }
  List<Integer> indexArray=new ArrayList<Integer>();
  Indicator indicator=this.getCurrIndicator();
  ModelElement analysisElement=indicator.getAnalyzedElement();
  int index=0;
  if (analysisElement instanceof TdColumn) {
    TdTable tdTable=ColumnHelper.getColumnOwnerAsTdTable((TdColumn)analysisElement);
    for (    TdColumn column : TableHelper.getColumns(tdTable)) {
      if (column.getName().equals(analysisElement.getName())) {
        indexArray.add(index);
        break;
      }
      index++;
    }
  }
 else   if (analysisElement instanceof MetadataColumn) {
    MetadataTable mTable=ColumnHelper.getColumnOwnerAsMetadataTable((MetadataColumn)analysisElement);
    for (    MetadataColumn mColumn : mTable.getColumns()) {
      if (mColumn.getLabel().equals(analysisElement.getName())) {
        indexArray.add(index);
        break;
      }
      index++;
    }
  }
  return indexArray.toArray(new Integer[indexArray.size()]);
}
Program: 136981
Project: 136981
Buggy source:
/** 
 * Get the result of current indicator.
 * @return if view values then return result of current indicator else return the size of the mapDB
 */
public Long getItemSize(AbstractDB<?> mapDB){
  if (judgeMenuType(getMenuType(),DrillDownEditorInput.MENU_VALUE_TYPE)) {
    return getCurrentIndicatorResultSize();
  }
 else {
    return Long.valueOf(mapDB.size());
  }
}

Fixed version (ground truth):
/** 
 * Get the result of current indicator.
 * @return if view values then return result of current indicator else return the size of the mapDB
 */
public Long getItemSize(AbstractDB<?> mapDB){
  if (isColumnSetIndicator()) {
    return getColumnSetIndicatorResultSize();
  }
 else {
    return Long.valueOf(mapDB.size());
  }
}
Program: 136982
Project: 136982
Buggy source:
/** 
 * Get the MapDB which used to drill down data
 * @return
 */
public AbstractDB<Object> getMapDB(){
  if (judgeMenuType(this.getMenuType(),DrillDownEditorInput.MENU_VALUE_TYPE) && DuplicateCountIndicator.class.isInstance(currIndicator)) {
    return currIndicator.getMapDB(StandardDBName.drillDownValues.name());
  }
  return DrillDownUtils.getMapDB(dataEntity,analysis);
}

Fixed version (ground truth):
/** 
 * Get the MapDB which used to drill down data
 * @return
 */
public AbstractDB<Object> getMapDB(){
  return DrillDownUtils.getMapDB(dataEntity,analysis,menuItemEntity);
}
Program: 136984
Project: 136984
Buggy source:
public Object getDataSet(){
  List<String> columnElementList=filterAdaptColumnHeader();
  columnHeader=new String[columnElementList.size()];
  int headerIndex=0;
  for (  String columnElement : columnElementList) {
    columnHeader[headerIndex++]=columnElement;
  }
  List<Object[]> newColumnElementList=filterAdaptDataList();
  if (newColumnElementList.size() <= 0) {
    columnValue=new String[0][0];
    return SqlExplorerUtils.getDefault().createDataSet(columnHeader,columnValue);
  }
  if (DrillDownEditorInput.judgeMenuType(getMenuType(),DrillDownEditorInput.MENU_VALUE_TYPE)) {
    columnValue=new String[newColumnElementList.size()][newColumnElementList.get(0).length];
  }
 else {
    columnValue=new String[newColumnElementList.size()][columnElementList.size()];
  }
  int rowIndex=0;
  for (  Object[] tableRow : newColumnElementList) {
    int columnIndex=0;
    for (    Object tableValue : tableRow) {
      if (tableValue == null) {
        if (newColumnElementList.get(0).length != columnElementList.size()) {
          continue;
        }
      }
      columnValue[rowIndex][columnIndex++]=tableValue == null ? "String_Node_Str" : tableValue.toString();
    }
    rowIndex++;
  }
  return SqlExplorerUtils.getDefault().createDataSet(columnHeader,columnValue);
}

Fixed version (ground truth):
public Object getDataSet(){
  List<String> columnElementList=filterAdaptColumnHeader();
  columnHeader=new String[columnElementList.size()];
  int headerIndex=0;
  for (  String columnElement : columnElementList) {
    columnHeader[headerIndex++]=columnElement;
  }
  List<Object[]> newColumnElementList=filterAdaptDataList();
  if (newColumnElementList.size() <= 0) {
    columnValue=new String[0][0];
    return SqlExplorerUtils.getDefault().createDataSet(columnHeader,columnValue);
  }
  if (DrillDownUtils.judgeMenuType(getMenuType(),DrillDownUtils.MENU_VALUE_TYPE)) {
    columnValue=new String[newColumnElementList.size()][newColumnElementList.get(0).length];
  }
 else {
    columnValue=new String[newColumnElementList.size()][columnElementList.size()];
  }
  int rowIndex=0;
  for (  Object[] tableRow : newColumnElementList) {
    int columnIndex=0;
    for (    Object tableValue : tableRow) {
      if (tableValue == null) {
        if (newColumnElementList.get(0).length != columnElementList.size()) {
          continue;
        }
      }
      columnValue[rowIndex][columnIndex++]=tableValue == null ? "String_Node_Str" : tableValue.toString();
    }
    rowIndex++;
  }
  return SqlExplorerUtils.getDefault().createDataSet(columnHeader,columnValue);
}
Program: 136985
Project: 136985
Buggy source:
public String getComputeValue(){
  if (judgeMenuType(this.getMenuType(),MENU_INVALID_TYPE)) {
    return ((PatternChartDataEntity)this.dataEntity).getNumNoMatch();
  }
 else   if (judgeMenuType(this.getMenuType(),MENU_VALID_TYPE)) {
    return ((PatternChartDataEntity)this.dataEntity).getNumMatch();
  }
  return this.dataEntity.getValue();
}

Fixed version (ground truth):
public String getComputeValue(){
  if (DrillDownUtils.judgeMenuType(this.getMenuType(),DrillDownUtils.MENU_INVALID_TYPE)) {
    return ((PatternChartDataEntity)this.dataEntity).getNumNoMatch();
  }
 else   if (DrillDownUtils.judgeMenuType(this.getMenuType(),DrillDownUtils.MENU_VALID_TYPE)) {
    return ((PatternChartDataEntity)this.dataEntity).getNumMatch();
  }
  return this.dataEntity.getValue();
}
Program: 136986
Project: 136986
Buggy source:
public Map<String,String> getQueryMap(){
  boolean isSqlEngine=ExecutionLanguage.SQL.equals(this.analysis.getParameters().getExecutionLanguage());
  Map<String,String> map=new HashMap<String,String>();
  boolean isHive=dbmsLanguage instanceof HiveDbmsLanguage;
  if (!isHive) {
switch (this.indicatorEnum) {
case AverageLengthIndicatorEnum:
case AverageLengthWithBlankIndicatorEnum:
      map.put(MENU_VIEW_ROWS,isSqlEngine ? getComment(MENU_VIEW_ROWS) + getAverageLengthWithBlankRowsStatement() : null);
    break;
case AverageLengthWithNullBlankIndicatorEnum:
  map.put(MENU_VIEW_ROWS,isSqlEngine ? getComment(MENU_VIEW_ROWS) + getAverageLengthWithNullBlankRowsStatement() : null);
break;
case AverageLengthWithNullIndicatorEnum:
map.put(MENU_VIEW_ROWS,isSqlEngine ? getComment(MENU_VIEW_ROWS) + getAverageLengthWithNullRowsStatement() : null);
break;
case MinLengthIndicatorEnum:
case MaxLengthIndicatorEnum:
case MinLengthWithBlankIndicatorEnum:
case MinLengthWithBlankNullIndicatorEnum:
case MinLengthWithNullIndicatorEnum:
case MaxLengthWithBlankIndicatorEnum:
case MaxLengthWithBlankNullIndicatorEnum:
case MaxLengthWithNullIndicatorEnum:
map.put(MENU_VIEW_ROWS,isSqlEngine ? getComment(MENU_VIEW_ROWS) + getTextRowsStatement() : null);
break;
default :
}
}
 else {
if (!isSqlEngine) {
map.put(MENU_VIEW_ROWS,null);
}
}
return map;
}

Fixed version (ground truth):
public Map<String,String> getQueryMap(){
  boolean isSqlEngine=ExecutionLanguage.SQL.equals(this.analysis.getParameters().getExecutionLanguage());
  Map<String,String> map=new HashMap<String,String>();
  boolean isHive=dbmsLanguage instanceof HiveDbmsLanguage;
  if (!isHive) {
switch (this.indicatorEnum) {
case AverageLengthIndicatorEnum:
case AverageLengthWithBlankIndicatorEnum:
      if (isSqlEngine) {
        map.put(MENU_VIEW_ROWS,getComment(MENU_VIEW_ROWS) + getAverageLengthWithBlankRowsStatement());
      }
    break;
case AverageLengthWithNullBlankIndicatorEnum:
  if (isSqlEngine) {
    map.put(MENU_VIEW_ROWS,getComment(MENU_VIEW_ROWS) + getAverageLengthWithNullBlankRowsStatement());
  }
break;
case AverageLengthWithNullIndicatorEnum:
if (isSqlEngine) {
map.put(MENU_VIEW_ROWS,getComment(MENU_VIEW_ROWS) + getAverageLengthWithNullRowsStatement());
}
break;
case MinLengthIndicatorEnum:
case MaxLengthIndicatorEnum:
case MinLengthWithBlankIndicatorEnum:
case MinLengthWithBlankNullIndicatorEnum:
case MinLengthWithNullIndicatorEnum:
case MaxLengthWithBlankIndicatorEnum:
case MaxLengthWithBlankNullIndicatorEnum:
case MaxLengthWithNullIndicatorEnum:
map.put(MENU_VIEW_ROWS,isSqlEngine ? getComment(MENU_VIEW_ROWS) + getTextRowsStatement() : null);
break;
default :
}
}
 else {
if (!isSqlEngine) {
switch (this.indicatorEnum) {
case MinLengthIndicatorEnum:
case MinLengthWithBlankIndicatorEnum:
case MinLengthWithBlankNullIndicatorEnum:
case MinLengthWithNullIndicatorEnum:
case MaxLengthIndicatorEnum:
case MaxLengthWithBlankIndicatorEnum:
case MaxLengthWithBlankNullIndicatorEnum:
case MaxLengthWithNullIndicatorEnum:
map.put(MENU_VIEW_ROWS,null);
break;
default :
}
}
}
return map;
}
Program: 136987
Project: 136987
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public PageResult<Object[]> loadPage(PageableController controller){
  int dbSize=db.size();
  long totalSize=dbSize < itemsSize ? dbSize : itemsSize;
  long pageSize=controller.getPageSize();
  long pageIndex=controller.getPageOffset();
  long fromIndex=pageIndex;
  long toIndex=pageIndex + pageSize;
  if (toIndex > totalSize) {
    toIndex=totalSize;
  }
  if (dataValidator == null) {
    return MapDBPageListHelper.createPage(db,indexMap,columnFilter,fromIndex,toIndex,totalSize);
  }
 else {
    return MapDBPageListHelper.createPage(db,indexMap,dataValidator,fromIndex,toIndex,totalSize);
  }
}

Fixed version (ground truth):
@Override public PageResult<Object[]> loadPage(PageableController controller){
  long totalSize=itemsSize;
  long pageSize=controller.getPageSize();
  long pageIndex=controller.getPageOffset();
  long fromIndex=pageIndex;
  long toIndex=pageIndex + pageSize;
  if (toIndex > totalSize) {
    toIndex=totalSize;
  }
  if (dataValidator == null) {
    return MapDBPageListHelper.createPage(db,indexMap,columnFilter,fromIndex,toIndex,totalSize);
  }
 else {
    return MapDBPageListHelper.createPage(db,indexMap,dataValidator,fromIndex,toIndex,totalSize);
  }
}
Program: 136994
Project: 136994
Buggy source:
/** 
 * DOC zshen Comment method "filterAdaptColumnHeader".
 * @returnget the name of column which will be displayed on the drill down editor.
 */
public List<String> filterAdaptColumnHeader(){
  Indicator indicator=this.getCurrIndicator();
  ModelElement analysisElement=indicator.getAnalyzedElement();
  String menuType=this.getMenuType();
  List<String> columnElementList=new ArrayList<String>();
  if (analysisElement == null && indicator.eContainer() instanceof SimpleStatIndicator) {
    columnElementList=columnHeaderForColumnSet((SimpleStatIndicator)indicator.eContainer());
  }
 else {
    if (DrillDownEditorInput.judgeMenuType(menuType,DrillDownEditorInput.MENU_VALUE_TYPE)) {
      columnElementList.add(ModelElementHelper.getName(indicator.getAnalyzedElement()));
    }
 else     if (analysisElement instanceof TdColumn) {
      for (      TdColumn column : TableHelper.getColumns(SwitchHelpers.TABLE_SWITCH.doSwitch(indicator.getAnalyzedElement().eContainer()))) {
        columnElementList.add(column.getName());
      }
    }
 else     if (analysisElement instanceof MetadataColumn) {
      MetadataTable mTable=ColumnHelper.getColumnOwnerAsMetadataTable((MetadataColumn)analysisElement);
      for (      MetadataColumn mColumn : mTable.getColumns()) {
        columnElementList.add(mColumn.getLabel());
      }
    }
  }
  return columnElementList;
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "filterAdaptColumnHeader".
 * @returnget the name of column which will be displayed on the drill down editor.
 */
public List<String> filterAdaptColumnHeader(){
  Indicator indicator=this.getCurrIndicator();
  ModelElement analysisElement=indicator.getAnalyzedElement();
  String menuType=this.getMenuType();
  List<String> columnElementList=new ArrayList<String>();
  if (analysisElement == null && indicator.eContainer() instanceof SimpleStatIndicator) {
    columnElementList=columnHeaderForColumnSet((SimpleStatIndicator)indicator.eContainer());
  }
 else {
    if (DrillDownUtils.judgeMenuType(menuType,DrillDownUtils.MENU_VALUE_TYPE)) {
      columnElementList.add(ModelElementHelper.getName(indicator.getAnalyzedElement()));
    }
 else     if (analysisElement instanceof TdColumn) {
      for (      TdColumn column : TableHelper.getColumns(SwitchHelpers.TABLE_SWITCH.doSwitch(indicator.getAnalyzedElement().eContainer()))) {
        columnElementList.add(column.getName());
      }
    }
 else     if (analysisElement instanceof MetadataColumn) {
      MetadataTable mTable=ColumnHelper.getColumnOwnerAsMetadataTable((MetadataColumn)analysisElement);
      for (      MetadataColumn mColumn : mTable.getColumns()) {
        columnElementList.add(mColumn.getLabel());
      }
    }
  }
  return columnElementList;
}
Program: 136995
Project: 136995
Buggy source:
/** 
 * Get index of column whiche will be used on the dirll down. Note that One indicator only belong one column so that the array of retrun value just contain one element. And if we create new map for view values menu rather than used same map with view rows menu then method can be removed
 * @return
 */
public Integer[] getColumnIndexArray(){
  if (!DrillDownEditorInput.judgeMenuType(this.getMenuType(),DrillDownEditorInput.MENU_VALUE_TYPE) || DuplicateCountIndicator.class.isInstance(currIndicator)) {
    return null;
  }
  List<Integer> indexArray=new ArrayList<Integer>();
  Indicator indicator=this.getCurrIndicator();
  ModelElement analysisElement=indicator.getAnalyzedElement();
  int index=0;
  if (analysisElement instanceof TdColumn) {
    TdTable tdTable=ColumnHelper.getColumnOwnerAsTdTable((TdColumn)analysisElement);
    for (    TdColumn column : TableHelper.getColumns(tdTable)) {
      if (column.getName().equals(analysisElement.getName())) {
        indexArray.add(index);
        break;
      }
      index++;
    }
  }
 else   if (analysisElement instanceof MetadataColumn) {
    MetadataTable mTable=ColumnHelper.getColumnOwnerAsMetadataTable((MetadataColumn)analysisElement);
    for (    MetadataColumn mColumn : mTable.getColumns()) {
      if (mColumn.getLabel().equals(analysisElement.getName())) {
        indexArray.add(index);
        break;
      }
      index++;
    }
  }
  return indexArray.toArray(new Integer[indexArray.size()]);
}

Fixed version (ground truth):
/** 
 * Get index of column whiche will be used on the dirll down. Note that One indicator only belong one column so that the array of retrun value just contain one element. And if we create new map for view values menu rather than used same map with view rows menu then method can be removed
 * @return
 */
public Integer[] getColumnIndexArray(){
  if (!DrillDownUtils.judgeMenuType(this.getMenuType(),DrillDownUtils.MENU_VALUE_TYPE) || !UniqueCountIndicator.class.isInstance(currIndicator)) {
    return null;
  }
  List<Integer> indexArray=new ArrayList<Integer>();
  Indicator indicator=this.getCurrIndicator();
  ModelElement analysisElement=indicator.getAnalyzedElement();
  int index=0;
  if (analysisElement instanceof TdColumn) {
    TdTable tdTable=ColumnHelper.getColumnOwnerAsTdTable((TdColumn)analysisElement);
    for (    TdColumn column : TableHelper.getColumns(tdTable)) {
      if (column.getName().equals(analysisElement.getName())) {
        indexArray.add(index);
        break;
      }
      index++;
    }
  }
 else   if (analysisElement instanceof MetadataColumn) {
    MetadataTable mTable=ColumnHelper.getColumnOwnerAsMetadataTable((MetadataColumn)analysisElement);
    for (    MetadataColumn mColumn : mTable.getColumns()) {
      if (mColumn.getLabel().equals(analysisElement.getName())) {
        indexArray.add(index);
        break;
      }
      index++;
    }
  }
  return indexArray.toArray(new Integer[indexArray.size()]);
}
Program: 136997
Project: 136997
Buggy source:
/** 
 * Get the result of current indicator.
 * @return if view values then return result of current indicator else return the size of the mapDB
 */
public Long getItemSize(AbstractDB<?> mapDB){
  if (judgeMenuType(getMenuType(),DrillDownEditorInput.MENU_VALUE_TYPE)) {
    return getCurrentIndicatorResultSize();
  }
 else {
    return Long.valueOf(mapDB.size());
  }
}

Fixed version (ground truth):
/** 
 * Get the result of current indicator.
 * @return if view values then return result of current indicator else return the size of the mapDB
 */
public Long getItemSize(AbstractDB<?> mapDB){
  if (isColumnSetIndicator()) {
    return getColumnSetIndicatorResultSize();
  }
 else {
    return Long.valueOf(mapDB.size());
  }
}
Program: 136998
Project: 136998
Buggy source:
/** 
 * Get the MapDB which used to drill down data
 * @return
 */
public AbstractDB<Object> getMapDB(){
  if (judgeMenuType(this.getMenuType(),DrillDownEditorInput.MENU_VALUE_TYPE) && DuplicateCountIndicator.class.isInstance(currIndicator)) {
    return currIndicator.getMapDB(StandardDBName.drillDownValues.name());
  }
  return DrillDownUtils.getMapDB(dataEntity,analysis);
}

Fixed version (ground truth):
/** 
 * Get the MapDB which used to drill down data
 * @return
 */
public AbstractDB<Object> getMapDB(){
  return DrillDownUtils.getMapDB(dataEntity,analysis,menuItemEntity);
}
Program: 137000
Project: 137000
Buggy source:
public Object getDataSet(){
  List<String> columnElementList=filterAdaptColumnHeader();
  columnHeader=new String[columnElementList.size()];
  int headerIndex=0;
  for (  String columnElement : columnElementList) {
    columnHeader[headerIndex++]=columnElement;
  }
  List<Object[]> newColumnElementList=filterAdaptDataList();
  if (newColumnElementList.size() <= 0) {
    columnValue=new String[0][0];
    return SqlExplorerUtils.getDefault().createDataSet(columnHeader,columnValue);
  }
  if (DrillDownEditorInput.judgeMenuType(getMenuType(),DrillDownEditorInput.MENU_VALUE_TYPE)) {
    columnValue=new String[newColumnElementList.size()][newColumnElementList.get(0).length];
  }
 else {
    columnValue=new String[newColumnElementList.size()][columnElementList.size()];
  }
  int rowIndex=0;
  for (  Object[] tableRow : newColumnElementList) {
    int columnIndex=0;
    for (    Object tableValue : tableRow) {
      if (tableValue == null) {
        if (newColumnElementList.get(0).length != columnElementList.size()) {
          continue;
        }
      }
      columnValue[rowIndex][columnIndex++]=tableValue == null ? "String_Node_Str" : tableValue.toString();
    }
    rowIndex++;
  }
  return SqlExplorerUtils.getDefault().createDataSet(columnHeader,columnValue);
}

Fixed version (ground truth):
public Object getDataSet(){
  List<String> columnElementList=filterAdaptColumnHeader();
  columnHeader=new String[columnElementList.size()];
  int headerIndex=0;
  for (  String columnElement : columnElementList) {
    columnHeader[headerIndex++]=columnElement;
  }
  List<Object[]> newColumnElementList=filterAdaptDataList();
  if (newColumnElementList.size() <= 0) {
    columnValue=new String[0][0];
    return SqlExplorerUtils.getDefault().createDataSet(columnHeader,columnValue);
  }
  if (DrillDownUtils.judgeMenuType(getMenuType(),DrillDownUtils.MENU_VALUE_TYPE)) {
    columnValue=new String[newColumnElementList.size()][newColumnElementList.get(0).length];
  }
 else {
    columnValue=new String[newColumnElementList.size()][columnElementList.size()];
  }
  int rowIndex=0;
  for (  Object[] tableRow : newColumnElementList) {
    int columnIndex=0;
    for (    Object tableValue : tableRow) {
      if (tableValue == null) {
        if (newColumnElementList.get(0).length != columnElementList.size()) {
          continue;
        }
      }
      columnValue[rowIndex][columnIndex++]=tableValue == null ? "String_Node_Str" : tableValue.toString();
    }
    rowIndex++;
  }
  return SqlExplorerUtils.getDefault().createDataSet(columnHeader,columnValue);
}
Program: 137001
Project: 137001
Buggy source:
public String getComputeValue(){
  if (judgeMenuType(this.getMenuType(),MENU_INVALID_TYPE)) {
    return ((PatternChartDataEntity)this.dataEntity).getNumNoMatch();
  }
 else   if (judgeMenuType(this.getMenuType(),MENU_VALID_TYPE)) {
    return ((PatternChartDataEntity)this.dataEntity).getNumMatch();
  }
  return this.dataEntity.getValue();
}

Fixed version (ground truth):
public String getComputeValue(){
  if (DrillDownUtils.judgeMenuType(this.getMenuType(),DrillDownUtils.MENU_INVALID_TYPE)) {
    return ((PatternChartDataEntity)this.dataEntity).getNumNoMatch();
  }
 else   if (DrillDownUtils.judgeMenuType(this.getMenuType(),DrillDownUtils.MENU_VALID_TYPE)) {
    return ((PatternChartDataEntity)this.dataEntity).getNumMatch();
  }
  return this.dataEntity.getValue();
}
Program: 137002
Project: 137002
Buggy source:
public void loadChildren(){
  _childNames=new ArrayList();
  try {
    ITableInfo[] tables=null;
    String[] tableTypes=_session.getMetaData().getTableTypes();
    try {
      SQLDatabaseMetaData metaData=_session.getMetaData();
      boolean isODBCTeradata=ConnectionUtils.isOdbcTeradata(metaData.getJDBCMetaData()) ? true : false;
      if (isODBCTeradata) {
        tables=metaData.getTables(null,_name,"String_Node_Str",tableTypes,null);
      }
 else {
        tables=metaData.getTables(_name,_name,"String_Node_Str",tableTypes,null);
      }
    }
 catch (    Throwable e) {
      _logger.debug("String_Node_Str");
    }
    for (int i=0; i < tableTypes.length; ++i) {
      INode childNode=findExtensionNode(tableTypes[i]);
      if (childNode != null) {
        _childNames.add(childNode.getLabelText());
        if (!isExcludedByFilter(childNode.getLabelText())) {
          addChildNode(childNode);
        }
      }
 else {
        if (tables != null) {
          TableFolderNode node=new TableFolderNode(this,tableTypes[i],_session,tables);
          _childNames.add(node.getLabelText());
          if (!isExcludedByFilter(node.getLabelText())) {
            addChildNode(node);
          }
        }
      }
    }
    addExtensionNodes();
  }
 catch (  Throwable e) {
    SQLExplorerPlugin.error("String_Node_Str" + _name,e);
  }
}

Fixed version (ground truth):
public void loadChildren(){
  _childNames=new ArrayList();
  try {
    ITableInfo[] tables=null;
    String[] tableTypes=_session.getMetaData().getTableTypes();
    try {
      SQLDatabaseMetaData metaData=_session.getMetaData();
      boolean isODBCTeradata=ConnectionUtils.isOdbcTeradata(metaData.getJDBCMetaData());
      boolean isNetezza=ConnectionUtils.isNetezza(metaData.getJDBCMetaData());
      if (isODBCTeradata || isNetezza) {
        tables=metaData.getTables(null,_name,"String_Node_Str",tableTypes,null);
      }
 else {
        tables=metaData.getTables(_name,_name,"String_Node_Str",tableTypes,null);
      }
    }
 catch (    Throwable e) {
      _logger.debug("String_Node_Str");
    }
    for (int i=0; i < tableTypes.length; ++i) {
      INode childNode=findExtensionNode(tableTypes[i]);
      if (childNode != null) {
        _childNames.add(childNode.getLabelText());
        if (!isExcludedByFilter(childNode.getLabelText())) {
          addChildNode(childNode);
        }
      }
 else {
        if (tables != null) {
          TableFolderNode node=new TableFolderNode(this,tableTypes[i],_session,tables);
          _childNames.add(node.getLabelText());
          if (!isExcludedByFilter(node.getLabelText())) {
            addChildNode(node);
          }
        }
      }
    }
    addExtensionNodes();
  }
 catch (  Throwable e) {
    SQLExplorerPlugin.error("String_Node_Str" + _name,e);
  }
}
Program: 137003
Project: 137003
Buggy source:
public void initSqlExplorerRootProject(IProject rootProject){
  if (SQLExplorerPlugin.getDefault().getRootProject() == null) {
    SQLExplorerPlugin.getDefault().setRootProject(rootProject);
  }
}

Fixed version (ground truth):
@Override public void initSqlExplorerRootProject(IProject rootProject){
  if (SQLExplorerPlugin.getDefault().getRootProject() == null) {
    SQLExplorerPlugin.getDefault().setRootProject(rootProject);
  }
}
Program: 137004
Project: 137004
Buggy source:
public void initAllConnectionsToSQLExplorer(List<Connection> conns){
  try {
    if (!SQLExplorerPlugin.getDefault().isInitedAllConnToSQLExpl()) {
      for (      Connection conn : conns) {
        addConnetionAliasToSQLPlugin(conn);
      }
      SQLExplorerPlugin.getDefault().setInitedAllConnToSQLExpl(true);
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
@Override public void initAllConnectionsToSQLExplorer(List<Connection> conns){
  try {
    if (!SQLExplorerPlugin.getDefault().isInitedAllConnToSQLExpl()) {
      for (      Connection conn : conns) {
        addConnetionAliasToSQLPlugin(conn);
      }
      SQLExplorerPlugin.getDefault().setInitedAllConnToSQLExpl(true);
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}
Program: 137005
Project: 137005
Buggy source:
public boolean isInstanceofTalendDataSet(Object talendDataSet){
  if (TalendDataSet.class.isInstance(talendDataSet)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isInstanceofTalendDataSet(Object talendDataSet){
  if (TalendDataSet.class.isInstance(talendDataSet)) {
    return true;
  }
  return false;
}
Program: 137006
Project: 137006
Buggy source:
public void addConnetionAliasToSQLPlugin(ModelElement... dataproviders){
}

Fixed version (ground truth):
@Override public void addConnetionAliasToSQLPlugin(ModelElement... dataproviders){
}
Program: 137007
Project: 137007
Buggy source:
public Object createMapDBColumnSetDataSet(String[] columnHeader,Object mapDB,Long size,Object currIndicator,int pageSize){
  return new MapDBColumnSetDataSet(columnHeader,(Map<List<Object>,Long>)mapDB,size,(DataValidation)currIndicator,pageSize);
}

Fixed version (ground truth):
@Override public Object createMapDBColumnSetDataSet(String[] columnHeader,Object mapDB,Long size,Object currIndicator,int pageSize){
  return new MapDBColumnSetDataSet(columnHeader,(Map<List<Object>,Long>)mapDB,size,(DataValidation)currIndicator,pageSize);
}
Program: 137008
Project: 137008
Buggy source:
public Action createExportCSVAction(){
  ExportCSVAction exportAction=new ExportCSVAction();
  exportAction.setEnabled(true);
  return exportAction;
}

Fixed version (ground truth):
@Override public Action createExportCSVAction(){
  ExportCSVAction exportAction=new ExportCSVAction();
  exportAction.setEnabled(true);
  return exportAction;
}
Program: 137009
Project: 137009
Buggy source:
public boolean aliasExist(String connectionName){
  SQLExplorerPlugin sqlPlugin=SQLExplorerPlugin.getDefault();
  AliasManager aliasManager=sqlPlugin.getAliasManager();
  Alias alias=aliasManager.getAlias(connectionName);
  return alias != null;
}

Fixed version (ground truth):
@Override public boolean aliasExist(String connectionName){
  SQLExplorerPlugin sqlPlugin=SQLExplorerPlugin.getDefault();
  AliasManager aliasManager=sqlPlugin.getAliasManager();
  Alias alias=aliasManager.getAlias(connectionName);
  return alias != null;
}
Program: 137010
Project: 137010
Buggy source:
public Object createDataSet(String[] columnHeader,String[][] columnValue){
  return new DataSet(columnHeader,columnValue);
}

Fixed version (ground truth):
@Override public Object createDataSet(String[] columnHeader,String[][] columnValue){
  return new DataSet(columnHeader,columnValue);
}