nus-yam/ex-repair huggingface dataset:
Program: 137538
Project: 137538
Buggy source:
@Override public void onBeginProcessing(){
  LOGGER.info("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onBeginProcessing(){
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("String_Node_Str");
  }
}
Program: 137539
Project: 137539
Buggy source:
@Override public void onEndRecord(Record record){
  LOGGER.info("String_Node_Str" + record.getId());
}

Fixed version (ground truth):
@Override public void onEndRecord(Record record){
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("String_Node_Str" + record.getId());
  }
}
Program: 137540
Project: 137540
Buggy source:
@Override public void onEndProcessing(){
  LOGGER.info("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onEndProcessing(){
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("String_Node_Str");
  }
}
Program: 137541
Project: 137541
Buggy source:
@Override public void onNewMerge(Record record){
  if (record.getRelatedIds().size() > 1) {
    LOGGER.info("String_Node_Str" + record.getId() + "String_Node_Str"+ record.getRelatedIds().size()+ "String_Node_Str");
  }
 else {
    LOGGER.info("String_Node_Str" + record.getId() + "String_Node_Str");
  }
  if (LOGGER.isDebugEnabled()) {
    StringBuilder messageBuilder=new StringBuilder();
    for (    Attribute attribute : record.getAttributes()) {
      messageBuilder.append("String_Node_Str").append(attribute.getLabel()).append("String_Node_Str").append(attribute.getValue()).append("String_Node_Str");
    }
    LOGGER.debug(messageBuilder.toString());
  }
}

Fixed version (ground truth):
@Override public void onNewMerge(Record record){
  if (LOGGER.isInfoEnabled()) {
    if (record.getRelatedIds().size() > 1) {
      LOGGER.info("String_Node_Str" + record.getId() + "String_Node_Str"+ record.getRelatedIds().size()+ "String_Node_Str");
    }
 else {
      LOGGER.info("String_Node_Str" + record.getId() + "String_Node_Str");
    }
  }
  if (LOGGER.isDebugEnabled()) {
    StringBuilder messageBuilder=new StringBuilder();
    for (    Attribute attribute : record.getAttributes()) {
      messageBuilder.append("String_Node_Str").append(attribute.getLabel()).append("String_Node_Str").append(attribute.getValue()).append("String_Node_Str");
    }
    LOGGER.debug(messageBuilder.toString());
  }
}
Program: 137542
Project: 137542
Buggy source:
@Override public void onBeginRecord(Record record){
  LOGGER.info("String_Node_Str" + record.getId());
}

Fixed version (ground truth):
@Override public void onBeginRecord(Record record){
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("String_Node_Str" + record.getId());
  }
}
Program: 137543
Project: 137543
Buggy source:
@Override public void onBeginPostMergeProcess(){
  LOGGER.info("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onBeginPostMergeProcess(){
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("String_Node_Str");
  }
}
Program: 137544
Project: 137544
Buggy source:
@Override public void onEndPostMergeProcess(){
  LOGGER.info("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onEndPostMergeProcess(){
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("String_Node_Str");
  }
}
Program: 137545
Project: 137545
Buggy source:
@Override public void onRemoveMerge(Record record){
  LOGGER.info("String_Node_Str" + record.getId());
}

Fixed version (ground truth):
@Override public void onRemoveMerge(Record record){
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("String_Node_Str" + record.getId());
  }
}
Program: 137546
Project: 137546
Buggy source:
private NonMatchResult(MatchResult result){
  this.result=result;
}

Fixed version (ground truth):
private NonMatchResult(MatchResult result){
  super(result.getScores().size());
  this.result=result;
}
Program: 137548
Project: 137548
Buggy source:
public MigrationTaskManager(IMigrationTaskProvider taskProvider,ProductVersion workspaceVersion,ProductVersion currentVersion,MigrationTaskType taskType){
  if (taskProvider == null) {
    taskProvider=new DefaultMigrationTaskProvider();
  }
  if (currentVersion == null) {
    this.currentVersion=MigrationPlugin.getDefault().getProductVersion();
  }
 else {
    this.currentVersion=currentVersion;
  }
  this.workspaceVersion=workspaceVersion;
  this.taskType=taskType;
  this.allMigrationTask=new ArrayList<IMigrationTask>();
  if (taskProvider != null) {
    allMigrationTask.addAll(Arrays.asList(taskProvider.getMigrationTasks()));
    sortTasks(allMigrationTask);
  }
}

Fixed version (ground truth):
public MigrationTaskManager(IMigrationTaskProvider taskProvider,ProductVersion workspaceVersion,ProductVersion currentVersion,MigrationTaskType taskType){
  super(taskProvider,workspaceVersion,currentVersion,taskType);
}
Program: 137549
Project: 137549
Buggy source:
/** 
 * DOC zhao Comment method "setRuleMatcher".
 * @param columnMap
 * @param recordMatchingIndicator
 * @param analysisMatchRecordGrouping
 * @throws BusinessException
 */
private static void setRuleMatcher(Map<String,String> columnMap,RecordMatchingIndicator recordMatchingIndicator,AnalysisMatchRecordGrouping analysisMatchRecordGrouping) throws BusinessException {
  List<MatchRule> matchRules=recordMatchingIndicator.getBuiltInMatchRuleDefinition().getMatchRules();
  for (  MatchRule matcher : matchRules) {
    List<Map<String,String>> ruleMatcherConvertResult=new ArrayList<Map<String,String>>();
    if (matcher == null) {
      continue;
    }
    for (    MatchKeyDefinition matchDef : matcher.getMatchKeys()) {
      if (matchDef.getColumn() == null || StringUtils.EMPTY.equals(matchDef.getColumn())) {
        BusinessException businessException=new BusinessException();
        businessException.setAdditonalMessage(Messages.getString("String_Node_Str",matchDef.getName()));
        throw businessException;
      }
      Map<String,String> matchKeyMap=AnalysisRecordGroupingUtils.getMatchKeyMap(matchDef.getColumn(),matchDef.getAlgorithm().getAlgorithmType(),matchDef.getAlgorithm().getAlgorithmParameters(),matchDef.getConfidenceWeight(),columnMap,matcher.getMatchInterval(),matchDef.getColumn());
      ruleMatcherConvertResult.add(matchKeyMap);
    }
    analysisMatchRecordGrouping.addRuleMatcher(ruleMatcherConvertResult);
  }
}

Fixed version (ground truth):
/** 
 * DOC zhao Comment method "setRuleMatcher".
 * @param columnMap
 * @param recordMatchingIndicator
 * @param analysisMatchRecordGrouping
 * @throws BusinessException
 */
private static void setRuleMatcher(Map<String,String> columnMap,RecordMatchingIndicator recordMatchingIndicator,AnalysisMatchRecordGrouping analysisMatchRecordGrouping) throws BusinessException {
  List<MatchRule> matchRules=recordMatchingIndicator.getBuiltInMatchRuleDefinition().getMatchRules();
  for (  MatchRule matcher : matchRules) {
    List<Map<String,String>> ruleMatcherConvertResult=new ArrayList<Map<String,String>>();
    if (matcher == null) {
      continue;
    }
    for (    MatchKeyDefinition matchDef : matcher.getMatchKeys()) {
      if (matchDef.getColumn() == null || StringUtils.EMPTY.equals(matchDef.getColumn())) {
        BusinessException businessException=new BusinessException();
        businessException.setAdditonalMessage(Messages.getString("String_Node_Str",matchDef.getName()));
        throw businessException;
      }
      Map<String,String> matchKeyMap=AnalysisRecordGroupingUtils.getMatchKeyMap(matchDef.getColumn(),matchDef.getAlgorithm().getAlgorithmType(),matchDef.getAlgorithm().getAlgorithmParameters(),matchDef.getConfidenceWeight(),columnMap,matcher.getMatchInterval(),matchDef.getColumn(),matchDef.getHandleNull());
      ruleMatcherConvertResult.add(matchKeyMap);
    }
    analysisMatchRecordGrouping.addRuleMatcher(ruleMatcherConvertResult);
  }
}
Program: 137550
Project: 137550
Buggy source:
/** 
 * get the key map of the match table's columns(<column, index>)
 * @param column
 * @param algoType
 * @param algoParameter
 * @param confidentWeight
 * @param columnIndexMap
 * @param matchInterval
 * @param attributeName
 * @return
 */
public static Map<String,String> getMatchKeyMap(String column,String algoType,String algoParameter,int confidentWeight,Map<String,String> columnIndexMap,double matchInterval,String attributeName){
  Map<String,String> matchKeyMap=new HashMap<String,String>();
  matchKeyMap.put(IRecordGrouping.COLUMN_IDX,columnIndexMap.get(column));
  matchKeyMap.put(IRecordGrouping.MATCHING_TYPE,AttributeMatcherType.valueOf(algoType).name());
  matchKeyMap.put(IRecordGrouping.CUSTOMER_MATCH_CLASS,algoParameter);
  matchKeyMap.put(IRecordGrouping.CONFIDENCE_WEIGHT,String.valueOf(confidentWeight));
  matchKeyMap.put(IRecordGrouping.RECORD_MATCH_THRESHOLD,String.valueOf(matchInterval));
  matchKeyMap.put(IRecordGrouping.ATTRIBUTE_NAME,attributeName);
  return matchKeyMap;
}

Fixed version (ground truth):
/** 
 * get the key map of the match table's columns(<column, index>)
 * @param column
 * @param algoType
 * @param algoParameter
 * @param confidentWeight
 * @param columnIndexMap
 * @param matchInterval
 * @param attributeName
 * @return
 */
public static Map<String,String> getMatchKeyMap(String column,String algoType,String algoParameter,int confidentWeight,Map<String,String> columnIndexMap,double matchInterval,String attributeName,String handleNull){
  Map<String,String> matchKeyMap=new HashMap<String,String>();
  matchKeyMap.put(IRecordGrouping.COLUMN_IDX,columnIndexMap.get(column));
  matchKeyMap.put(IRecordGrouping.MATCHING_TYPE,AttributeMatcherType.valueOf(algoType).name());
  matchKeyMap.put(IRecordGrouping.CUSTOMER_MATCH_CLASS,algoParameter);
  matchKeyMap.put(IRecordGrouping.CONFIDENCE_WEIGHT,String.valueOf(confidentWeight));
  matchKeyMap.put(IRecordGrouping.RECORD_MATCH_THRESHOLD,String.valueOf(matchInterval));
  matchKeyMap.put(IRecordGrouping.ATTRIBUTE_NAME,attributeName);
  matchKeyMap.put(IRecordGrouping.HANDLE_NULL,handleNull);
  return matchKeyMap;
}
Program: 137551
Project: 137551
Buggy source:
/** 
 * TMDM-6549,Check and collect match rule objects from deleted objects.
 * @param node
 * @param matchRules
 */
private void collectSelectedMatchRuleObjs(IRepositoryNode node,List<IRepositoryViewObject> matchRules){
  IRepositoryViewObject viewObj=node.getObject();
  if (viewObj instanceof Folder) {
    for (    IRepositoryNode childNode : node.getChildren()) {
      collectSelectedMatchRuleObjs(childNode,matchRules);
    }
  }
 else   if (viewObj.getRepositoryObjectType() == ERepositoryObjectType.TDQ_RULES_MATCHER) {
    matchRules.add(viewObj);
  }
}

Fixed version (ground truth):
/** 
 * TMDM-6549,Check and collect match rule objects from deleted objects.
 * @param node
 * @param matchRules
 */
private void collectSelectedMatchRuleObjs(IRepositoryNode node,List<IRepositoryViewObject> matchRules){
  IRepositoryViewObject viewObj=node.getObject();
  if (viewObj == null) {
    return;
  }
  if (viewObj instanceof Folder) {
    for (    IRepositoryNode childNode : node.getChildren()) {
      collectSelectedMatchRuleObjs(childNode,matchRules);
    }
  }
 else   if (viewObj.getRepositoryObjectType() == ERepositoryObjectType.TDQ_RULES_MATCHER) {
    matchRules.add(viewObj);
  }
}
Program: 137552
Project: 137552
Buggy source:
public MigrationTaskManager(IMigrationTaskProvider taskProvider,ProductVersion workspaceVersion,ProductVersion currentVersion,MigrationTaskType taskType){
  if (taskProvider == null) {
    taskProvider=new DefaultMigrationTaskProvider();
  }
  if (currentVersion == null) {
    this.currentVersion=MigrationPlugin.getDefault().getProductVersion();
  }
 else {
    this.currentVersion=currentVersion;
  }
  this.workspaceVersion=workspaceVersion;
  this.taskType=taskType;
  this.allMigrationTask=new ArrayList<IMigrationTask>();
  if (taskProvider != null) {
    allMigrationTask.addAll(Arrays.asList(taskProvider.getMigrationTasks()));
    sortTasks(allMigrationTask);
  }
}

Fixed version (ground truth):
public MigrationTaskManager(IMigrationTaskProvider taskProvider,ProductVersion workspaceVersion,ProductVersion currentVersion,MigrationTaskType taskType){
  super(taskProvider,workspaceVersion,currentVersion,taskType);
}
Program: 137553
Project: 137553
Buggy source:
/** 
 * if overwrite: need to delete all current keyss, and insert the keys according to the parameter:matchRule; else: only add the keys in the parameter matchrule, to the current keys.
 * @param matchRule
 * @param overwrite
 */
public void importMatchRule(MatchRuleDefinition matchRule,boolean overwrite){
  if (overwrite) {
    this.getBlockKeyDefinitionList().clear();
    this.tableComposite.redraw();
  }
  List<String> conflictKeys=new ArrayList<String>();
  for (  BlockKeyDefinition blockKey : matchRule.getBlockKeys()) {
    if (!overwrite && isKeyDefinitionAdded(blockKey.getName())) {
      conflictKeys.add(blockKey.getName());
      continue;
    }
    BlockKeyDefinition blockKeyDefinition=EcoreUtil.copy(blockKey);
    setColumnValueIfMatch(blockKeyDefinition);
    tableComposite.addKeyDefinition(blockKeyDefinition,this.getMatchRuleDefinition().getBlockKeys());
  }
  if (conflictKeys.size() > 0) {
    StringBuffer names=new StringBuffer();
    for (    String name : conflictKeys) {
      names.append(name);
      names.append(PluginConstant.COMMA_STRING);
    }
    if (names.length() > 0) {
      names.deleteCharAt(names.lastIndexOf(PluginConstant.COMMA_STRING));
    }
    MessageDialog.openWarning(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str") + names.toString());
  }
}

Fixed version (ground truth):
/** 
 * if overwrite: need to delete all current keyss, and insert the keys according to the parameter:matchRule; else: only add the keys in the parameter matchrule, to the current keys.
 * @param matchRule
 * @param overwrite
 */
public void importMatchRule(MatchRuleDefinition matchRule,boolean overwrite){
  if (overwrite) {
    this.removeAllBlockingKey();
  }
  List<String> conflictKeys=new ArrayList<String>();
  for (  BlockKeyDefinition blockKey : matchRule.getBlockKeys()) {
    if (!overwrite && isKeyDefinitionAdded(blockKey.getName())) {
      conflictKeys.add(blockKey.getName());
      continue;
    }
    BlockKeyDefinition blockKeyDefinition=EcoreUtil.copy(blockKey);
    setColumnValueIfMatch(blockKeyDefinition);
    tableComposite.addKeyDefinition(blockKeyDefinition,this.getMatchRuleDefinition().getBlockKeys());
  }
  if (conflictKeys.size() > 0) {
    StringBuffer names=new StringBuffer();
    for (    String name : conflictKeys) {
      names.append(name);
      names.append(PluginConstant.COMMA_STRING);
    }
    if (names.length() > 0) {
      names.deleteCharAt(names.lastIndexOf(PluginConstant.COMMA_STRING));
    }
    MessageDialog.openWarning(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str") + names.toString());
  }
}
Program: 137554
Project: 137554
Buggy source:
public void removeKeyFromAllTab(String column){
  CTabItem[] tabItems=ruleFolder.getItems();
  if (tabItems != null && tabItems.length > 0) {
    for (    CTabItem oneTab : tabItems) {
      MatchRuleTableComposite matchRuleTableComp=(MatchRuleTableComposite)oneTab.getData(MatchAnalysisConstant.MATCH_RULE_TABLE_COMPOSITE);
      matchRuleTableComp.removeKeyDefinition(column,matchRuleTableComp.getMatchRule().getMatchKeys());
      checkAndRemoveEmptyMatchRule(oneTab);
    }
    this.redrawnContent();
  }
  columnMap.remove(column);
}

Fixed version (ground truth):
public void removeKeyFromAllTab(String column){
  CTabItem[] tabItems=ruleFolder.getItems();
  if (tabItems != null && tabItems.length > 0) {
    for (    CTabItem oneTab : tabItems) {
      MatchRuleTableComposite matchRuleTableComp=(MatchRuleTableComposite)oneTab.getData(MatchAnalysisConstant.MATCH_RULE_TABLE_COMPOSITE);
      matchRuleTableComp.removeKeyDefinition(column,matchRuleTableComp.getMatchRule().getMatchKeys());
      checkAndRemoveEmptyMatchRule(oneTab);
    }
    this.redrawnSubTableContent();
  }
  columnMap.remove(column);
}
Program: 137555
Project: 137555
Buggy source:
/** 
 * DOC zshen Comment method "createButtons".
 */
private void createRefreshButton(Composite currentSectionClient){
  Composite buttonsComposite=new Composite(currentSectionClient,SWT.NONE);
  buttonsComposite.setLayout(new GridLayout(10,true));
  GridData labelGd=new GridData();
  labelGd.horizontalAlignment=SWT.LEFT;
  labelGd.widthHint=30;
  createAddAndRemoveButton(buttonsComposite,labelGd);
  createMoveButton(buttonsComposite,labelGd);
  labelGd=new GridData();
  labelGd.horizontalAlignment=SWT.CENTER;
  labelGd.horizontalSpan=5;
  String buttonText=DefaultMessagesImpl.getString("String_Node_Str");
  labelGd.widthHint=buttonText.length() * 10;
  final Button refresh=new Button(buttonsComposite,SWT.NONE);
  refresh.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  refresh.setText(buttonText);
  refresh.setLayoutData(labelGd);
  refresh.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      new RefreshChartAction(AbstractMatchAnaysisTableSection.this).run();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "createButtons".
 */
private void createRefreshButton(Composite currentSectionClient){
  Composite buttonsComposite=new Composite(currentSectionClient,SWT.NONE);
  buttonsComposite.setLayout(new GridLayout(10,true));
  buttonsComposite.setLayoutData(new GridData(SWT.FILL,SWT.NONE,true,false));
  Composite commonButtonsComposite=new Composite(buttonsComposite,SWT.NONE);
  commonButtonsComposite.setLayout(new GridLayout(10,true));
  commonButtonsComposite.setLayoutData(new GridData(SWT.FILL,SWT.NONE,true,false,8,1));
  GridData labelGd=new GridData();
  labelGd.horizontalAlignment=SWT.LEFT;
  labelGd.widthHint=30;
  createAddAndRemoveButton(commonButtonsComposite,labelGd);
  createMoveButton(commonButtonsComposite,labelGd);
  Composite refreshButtonComposite=new Composite(buttonsComposite,SWT.NONE);
  refreshButtonComposite.setLayoutData(new GridData(SWT.FILL,SWT.NONE,true,false,2,1));
  refreshButtonComposite.setLayout(new GridLayout(1,true));
  labelGd=new GridData();
  labelGd.horizontalAlignment=SWT.RIGHT;
  String buttonText=DefaultMessagesImpl.getString("String_Node_Str");
  labelGd.widthHint=buttonText.length() * 10;
  final Button refresh=new Button(refreshButtonComposite,SWT.NONE);
  refresh.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  refresh.setText(buttonText);
  refresh.setLayoutData(labelGd);
  refresh.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      new RefreshChartAction(AbstractMatchAnaysisTableSection.this).run();
    }
  }
);
}
Program: 137556
Project: 137556
Buggy source:
public void removeKeyFromAllTab(String column){
  CTabItem[] tabItems=ruleFolder.getItems();
  if (tabItems != null && tabItems.length > 0) {
    for (    CTabItem oneTab : tabItems) {
      MatchRuleTableComposite matchRuleTableComp=(MatchRuleTableComposite)oneTab.getData(MatchAnalysisConstant.MATCH_RULE_TABLE_COMPOSITE);
      matchRuleTableComp.removeKeyDefinition(column,getCurrentMatchRuleTableComposite().getMatchRule().getMatchKeys());
    }
  }
  columnMap.remove(column);
}

Fixed version (ground truth):
public void removeKeyFromAllTab(String column){
  CTabItem[] tabItems=ruleFolder.getItems();
  if (tabItems != null && tabItems.length > 0) {
    for (    CTabItem oneTab : tabItems) {
      MatchRuleTableComposite matchRuleTableComp=(MatchRuleTableComposite)oneTab.getData(MatchAnalysisConstant.MATCH_RULE_TABLE_COMPOSITE);
      matchRuleTableComp.removeKeyDefinition(column,matchRuleTableComp.getMatchRule().getMatchKeys());
      checkAndRemoveEmptyMatchRule(oneTab);
    }
    this.redrawnContent();
  }
  columnMap.remove(column);
}
Program: 137561
Project: 137561
Buggy source:
/** 
 * DOC zshen Comment method "deleteConnectionDependency".
 * @param analysis
 * @return whether it has been deleteddelete the dependency between analysis and connection
 */
public boolean deleteConnectionDependency(Analysis analysis){
  Connection tdProvider=(Connection)analysis.getContext().getConnection();
  if (tdProvider != null && tdProvider.getSupplierDependency().size() > 0) {
    List<Property> clintDependency=DependenciesHandler.getInstance().getClintDependency(analysis);
    tdProvider.getSupplierDependency().get(0).getClient().remove(analysis);
    analysis.getContext().setConnection(null);
    analysis.getClientDependency().clear();
    for (    Property clintProperty : clintDependency) {
      Item item=clintProperty.getItem();
      AElementPersistance create=ElementWriterFactory.getInstance().create(item);
      create.save(item,false);
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "deleteConnectionDependency".
 * @param analysis
 * @return whether it has been deleteddelete the dependency between analysis and connection
 */
public boolean deleteConnectionDependency(Analysis analysis){
  Connection tdProvider=(Connection)analysis.getContext().getConnection();
  if (tdProvider != null && tdProvider.getSupplierDependency().size() > 0) {
    List<Property> clintDependency=DependenciesHandler.getInstance().getClintDependency(analysis);
    tdProvider.getSupplierDependency().get(0).getClient().remove(analysis);
    for (    Property clintProperty : clintDependency) {
      Item item=clintProperty.getItem();
      AElementPersistance create=ElementWriterFactory.getInstance().create(item);
      create.save(item,false);
    }
  }
  analysis.getContext().setConnection(null);
  analysis.getClientDependency().clear();
  return true;
}
Program: 137562
Project: 137562
Buggy source:
public void partDeactivated(IWorkbenchPart part){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITdqContextViewService.class)) {
    ITdqContextViewService tdqContextViewService=(ITdqContextViewService)GlobalServiceRegister.getDefault().getService(ITdqContextViewService.class);
    if (tdqContextViewService != null) {
      tdqContextViewService.resetContextView();
    }
  }
}

Fixed version (ground truth):
public void partDeactivated(IWorkbenchPart part){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITdqContextService.class)) {
    ITdqContextService tdqContextViewService=(ITdqContextService)GlobalServiceRegister.getDefault().getService(ITdqContextService.class);
    if (tdqContextViewService != null) {
      tdqContextViewService.resetContextView();
    }
  }
}
Program: 137563
Project: 137563
Buggy source:
public void partActivated(IWorkbenchPart part){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITdqContextViewService.class)) {
    ITdqContextViewService tdqContextViewService=(ITdqContextViewService)GlobalServiceRegister.getDefault().getService(ITdqContextViewService.class);
    if (tdqContextViewService != null) {
      tdqContextViewService.updateContextView(part);
    }
  }
}

Fixed version (ground truth):
public void partActivated(IWorkbenchPart part){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITdqContextService.class)) {
    ITdqContextService tdqContextViewService=(ITdqContextService)GlobalServiceRegister.getDefault().getService(ITdqContextService.class);
    if (tdqContextViewService != null) {
      tdqContextViewService.updateContextView(part);
    }
  }
}
Program: 137564
Project: 137564
Buggy source:
public void partClosed(IWorkbenchPart part){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITdqContextViewService.class)) {
    ITdqContextViewService tdqContextViewService=(ITdqContextViewService)GlobalServiceRegister.getDefault().getService(ITdqContextViewService.class);
    if (tdqContextViewService != null) {
      tdqContextViewService.hideContextView(part);
    }
  }
}

Fixed version (ground truth):
public void partClosed(IWorkbenchPart part){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITdqContextService.class)) {
    ITdqContextService tdqContextViewService=(ITdqContextService)GlobalServiceRegister.getDefault().getService(ITdqContextService.class);
    if (tdqContextViewService != null) {
      tdqContextViewService.hideContextView(part);
    }
  }
}
Program: 137565
Project: 137565
Buggy source:
public String getColumnText(Object element,int columnIndex){
  Map<String,String> rule=(HashMap<String,String>)element;
  String result=null;
switch (columnIndex) {
case 0:
    result=rule.get(MATCH_KEY_NAME);
  break;
case 1:
result=rule.get(INPUT_COLUMN);
break;
case 2:
result=AttributeMatcherType.getTypeByComponentValue(rule.get(MATCHING_TYPE)).getLabel();
break;
case 3:
result=rule.get(CUSTOM_MATCHER);
break;
case 4:
result=rule.get(CONFIDENCE_WEIGHT);
break;
case 5:
result=rule.get(HANDLE_NULL);
break;
}
return result;
}

Fixed version (ground truth):
public String getColumnText(Object element,int columnIndex){
  Map<String,String> rule=(HashMap<String,String>)element;
  String result=null;
switch (columnIndex) {
case 0:
    result=rule.get(MATCH_KEY_NAME);
  break;
case 1:
result=rule.get(INPUT_COLUMN);
break;
case 2:
result=rule.get(MATCHING_TYPE);
break;
case 3:
result=rule.get(CUSTOM_MATCHER);
break;
case 4:
result=rule.get(CONFIDENCE_WEIGHT);
break;
case 5:
result=rule.get(HANDLE_NULL);
break;
}
return result;
}
Program: 137567
Project: 137567
Buggy source:
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  FillLayout layout=new FillLayout();
  container.setLayout(layout);
  cViewer=new ContainerCheckedTreeViewer(container,SWT.NONE);
  cViewer.setLabelProvider(new DQRuleLabelProvider());
  cViewer.setContentProvider(new WorkbenchContentProvider());
  cViewer.setInput(ResourceManager.getLibrariesFolder());
  cViewer.addFilter(new DQFolderFliter(true));
  cViewer.addFilter(new RuleFolderFliter(true));
  cViewer.addFilter(AnalysisExecutorHelper.createRuleFilter());
  setControl(container);
}

Fixed version (ground truth):
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  FillLayout layout=new FillLayout();
  container.setLayout(layout);
  cViewer=new ContainerCheckedTreeViewer(container,SWT.NONE);
  cViewer.setLabelProvider(new DQRuleLabelProvider());
  cViewer.setContentProvider(new WorkbenchContentProvider());
  cViewer.setInput(ResourceManager.getLibrariesFolder());
  cViewer.addFilter(new DQFolderFliter(true));
  cViewer.addFilter(new RuleFolderFliter(true));
  cViewer.addFilter(AnalysisUtils.createRuleFilter());
  setControl(container);
}
Program: 137568
Project: 137568
Buggy source:
/** 
 * DOC zshen Comment method "deleteConnectionDependency".
 * @param analysis
 * @return whether it has been deleteddelete the dependency between analysis and connection
 */
public boolean deleteConnectionDependency(Analysis analysis){
  Connection tdProvider=(Connection)analysis.getContext().getConnection();
  if (tdProvider != null && tdProvider.getSupplierDependency().size() > 0) {
    List<Property> clintDependency=DependenciesHandler.getInstance().getClintDependency(analysis);
    tdProvider.getSupplierDependency().get(0).getClient().remove(analysis);
    for (    Property clintProperty : clintDependency) {
      Item item=clintProperty.getItem();
      AElementPersistance create=ElementWriterFactory.getInstance().create(item);
      create.save(item,false);
    }
  }
  analysis.getContext().setConnection(null);
  analysis.getClientDependency().clear();
  return true;
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "deleteConnectionDependency".
 * @param analysis
 * @return whether it has been deleteddelete the dependency between analysis and connection
 */
public boolean deleteConnectionDependency(Analysis ana){
  return AnalysisUtils.deleteConnectionDependency(ana);
}
Program: 137569
Project: 137569
Buggy source:
private List<Map<String,String>> getMatchRulesFromRules(MatchRuleDefinition matchRuleDefinition){
  if (matchRuleDefinition != null && matchRuleDefinition instanceof MatchRuleDefinition) {
    List<Map<String,String>> ruleValues=new ArrayList<Map<String,String>>();
    for (    MatchRule matchRule : matchRuleDefinition.getMatchRules()) {
      for (      MatchKeyDefinition matchKey : matchRule.getMatchKeys()) {
        Map<String,String> pr=new HashMap<String,String>();
        pr.put(MatchRulesTableLabelProvider.MATCH_KEY_NAME,null == matchKey.getName() ? StringUtils.EMPTY : matchKey.getName());
        pr.put(MatchRulesTableLabelProvider.INPUT_COLUMN,null == matchKey.getColumn() ? StringUtils.EMPTY : matchKey.getColumn());
        pr.put(MatchRulesTableLabelProvider.MATCHING_TYPE,null == matchKey.getAlgorithm().getAlgorithmType() ? StringUtils.EMPTY : matchKey.getAlgorithm().getAlgorithmType());
        pr.put(MatchRulesTableLabelProvider.CUSTOM_MATCHER,null == matchKey.getAlgorithm().getAlgorithmParameters() ? StringUtils.EMPTY : matchKey.getAlgorithm().getAlgorithmParameters());
        pr.put(MatchRulesTableLabelProvider.CONFIDENCE_WEIGHT,String.valueOf(matchKey.getConfidenceWeight()));
        pr.put(MatchRulesTableLabelProvider.HANDLE_NULL,null == matchKey.getHandleNull() ? StringUtils.EMPTY : matchKey.getHandleNull());
        ruleValues.add(pr);
      }
    }
    return ruleValues;
  }
  return null;
}

Fixed version (ground truth):
private List<Map<String,String>> getMatchRulesFromRules(MatchRuleDefinition matchRuleDefinition){
  if (matchRuleDefinition != null) {
    List<Map<String,String>> ruleValues=new ArrayList<Map<String,String>>();
    for (    MatchRule matchRule : matchRuleDefinition.getMatchRules()) {
      for (      MatchKeyDefinition matchKey : matchRule.getMatchKeys()) {
        Map<String,String> pr=new HashMap<String,String>();
        pr.put(MatchRulesTableLabelProvider.MATCH_KEY_NAME,null == matchKey.getName() ? StringUtils.EMPTY : matchKey.getName());
        pr.put(MatchRulesTableLabelProvider.INPUT_COLUMN,null == matchKey.getColumn() ? StringUtils.EMPTY : matchKey.getColumn());
        pr.put(MatchRulesTableLabelProvider.MATCHING_TYPE,null == matchKey.getAlgorithm().getAlgorithmType() ? StringUtils.EMPTY : AttributeMatcherType.valueOf(matchKey.getAlgorithm().getAlgorithmType()).getComponentValue());
        pr.put(MatchRulesTableLabelProvider.CUSTOM_MATCHER,null == matchKey.getAlgorithm().getAlgorithmParameters() ? StringUtils.EMPTY : matchKey.getAlgorithm().getAlgorithmParameters());
        pr.put(MatchRulesTableLabelProvider.CONFIDENCE_WEIGHT,String.valueOf(matchKey.getConfidenceWeight()));
        pr.put(MatchRulesTableLabelProvider.HANDLE_NULL,null == matchKey.getHandleNull() ? StringUtils.EMPTY : matchKey.getHandleNull());
        ruleValues.add(pr);
      }
    }
    return ruleValues;
  }
  return null;
}
Program: 137572
Project: 137572
Buggy source:
public String getColumnText(Object element,int columnIndex){
  Map<String,String> rule=(HashMap<String,String>)element;
  String result=null;
switch (columnIndex) {
case 0:
    result=rule.get(MATCH_KEY_NAME);
  break;
case 1:
result=rule.get(INPUT_COLUMN);
break;
case 2:
result=AttributeMatcherType.valueOf(rule.get(MATCHING_TYPE)).getLabel();
break;
case 3:
result=rule.get(CUSTOM_MATCHER);
break;
case 4:
result=rule.get(CONFIDENCE_WEIGHT);
break;
case 5:
result=rule.get(HANDLE_NULL);
break;
}
return result;
}

Fixed version (ground truth):
public String getColumnText(Object element,int columnIndex){
  Map<String,String> rule=(HashMap<String,String>)element;
  String result=null;
switch (columnIndex) {
case 0:
    result=rule.get(MATCH_KEY_NAME);
  break;
case 1:
result=rule.get(INPUT_COLUMN);
break;
case 2:
result=AttributeMatcherType.getTypeByComponentValue(rule.get(MATCHING_TYPE)).getLabel();
break;
case 3:
result=rule.get(CUSTOM_MATCHER);
break;
case 4:
result=rule.get(CONFIDENCE_WEIGHT);
break;
case 5:
result=rule.get(HANDLE_NULL);
break;
}
return result;
}
Program: 137573
Project: 137573
Buggy source:
@Override public ModelElement initCWMResourceBuilder(){
  Analysis analysis=(Analysis)super.initCWMResourceBuilder();
  Indicator blockKeyIndicator=ColumnsetFactory.eINSTANCE.createBlockKeyIndicator();
  analysis.getResults().getIndicators().add(blockKeyIndicator);
  RecordMatchingIndicator matchRuleIndicator=ColumnsetFactory.eINSTANCE.createRecordMatchingIndicator();
  MatchRuleDefinition matchRuleDefinition=RulesFactory.eINSTANCE.createMatchRuleDefinition();
  matchRuleIndicator.setBuiltInMatchRuleDefinition(matchRuleDefinition);
  analysis.getResults().getIndicators().add(matchRuleIndicator);
  analysis.getParameters().setMaxNumberRows(Integer.valueOf(DefaultMessagesImpl.getString("String_Node_Str")));
  return analysis;
}

Fixed version (ground truth):
@Override public ModelElement initCWMResourceBuilder(){
  Analysis analysis=(Analysis)super.initCWMResourceBuilder();
  Indicator blockKeyIndicator=ColumnsetFactory.eINSTANCE.createBlockKeyIndicator();
  analysis.getResults().getIndicators().add(blockKeyIndicator);
  RecordMatchingIndicator matchRuleIndicator=ColumnsetFactory.eINSTANCE.createRecordMatchingIndicator();
  MatchRuleDefinition matchRuleDefinition=RulesFactory.eINSTANCE.createMatchRuleDefinition();
  matchRuleIndicator.setBuiltInMatchRuleDefinition(matchRuleDefinition);
  analysis.getResults().getIndicators().add(matchRuleIndicator);
  Integer maxRows=10000;
  try {
    maxRows=Integer.valueOf(DefaultMessagesImpl.getString("String_Node_Str"));
  }
 catch (  NumberFormatException e) {
    log.warn(DefaultMessagesImpl.getString("String_Node_Str",DefaultMessagesImpl.getString("String_Node_Str")));
  }
  analysis.getParameters().setMaxNumberRows(maxRows);
  return analysis;
}
Program: 137574
Project: 137574
Buggy source:
public List<Map<String,String>> getBlockingKeysFromFiles(Object[] files){
  List<Map<String,String>> ruleValues=new ArrayList<Map<String,String>>();
  for (  Object rule : files) {
    if (rule instanceof IFile) {
      MatchRuleDefinition matchRuleDefinition=DQRuleResourceFileHelper.getInstance().findMatchRule((IFile)rule);
      matchExistingColumnForBlockingKeys(matchRuleDefinition);
      ruleValues.addAll(getBlockingKeysFromRules(matchRuleDefinition));
    }
  }
  return ruleValues;
}

Fixed version (ground truth):
public List<Map<String,String>> getBlockingKeysFromFiles(Object[] files,boolean retrieveDisplayValue){
  List<Map<String,String>> ruleValues=new ArrayList<Map<String,String>>();
  for (  Object rule : files) {
    if (rule instanceof IFile) {
      MatchRuleDefinition matchRuleDefinition=DQRuleResourceFileHelper.getInstance().findMatchRule((IFile)rule);
      matchExistingColumnForBlockingKeys(matchRuleDefinition);
      ruleValues.addAll(getBlockingKeysFromRules(matchRuleDefinition,retrieveDisplayValue));
    }
  }
  return ruleValues;
}
Program: 137576
Project: 137576
Buggy source:
@Override protected Control createDialogArea(Composite parent){
  SashForm form=new SashForm(parent,SWT.SMOOTH | SWT.VERTICAL | SWT.FILL);
  form.setSize(Math.min(Display.getCurrent().getActiveShell().getSize().x,800),580);
  GridData data=new GridData(SWT.FILL,SWT.FILL,true,true,0,0);
  form.setLayoutData(data);
  Composite composite=(Composite)super.createDialogArea(form);
  getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      IStructuredSelection selection=(IStructuredSelection)event.getSelection();
      if (blockingKeysTable != null) {
        blockingKeysTable.setInput(getBlockingKeysFromFiles(selection.toArray()));
      }
      if (matchingRulesTable != null) {
        matchingRulesTable.setInput(getMatchRulesFromFiles(selection.toArray()));
      }
    }
  }
);
  if (dialogType == GENKEY_TYPE) {
    createSelectBlockingKeysTable(form);
    form.setWeights(new int[]{3,2});
  }
 else   if (dialogType == MATCHGROUP_TYPE) {
    createSelectMatchRulesTable(form);
    form.setWeights(new int[]{3,2});
  }
 else   if (dialogType == MATCH_ANALYSIS_TYPE) {
    createSelectBlockingKeysTable(form);
    createSelectMatchRulesTable(form);
    form.setWeights(new int[]{5,2,3});
  }
  createCheckerArea(composite);
  return composite;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(Composite parent){
  SashForm form=new SashForm(parent,SWT.SMOOTH | SWT.VERTICAL | SWT.FILL);
  form.setSize(Math.min(Display.getCurrent().getActiveShell().getSize().x,800),580);
  GridData data=new GridData(SWT.FILL,SWT.FILL,true,true,0,0);
  form.setLayoutData(data);
  Composite composite=(Composite)super.createDialogArea(form);
  getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      IStructuredSelection selection=(IStructuredSelection)event.getSelection();
      if (blockingKeysTable != null) {
        blockingKeysTable.setInput(getBlockingKeysFromFiles(selection.toArray(),true));
      }
      if (matchingRulesTable != null) {
        matchingRulesTable.setInput(getMatchRulesFromFiles(selection.toArray(),true));
      }
    }
  }
);
  if (dialogType == GENKEY_TYPE) {
    createSelectBlockingKeysTable(form);
    form.setWeights(new int[]{3,2});
  }
 else   if (dialogType == MATCHGROUP_TYPE) {
    createSelectMatchRulesTable(form);
    form.setWeights(new int[]{3,2});
  }
 else   if (dialogType == MATCH_ANALYSIS_TYPE) {
    createSelectBlockingKeysTable(form);
    createSelectMatchRulesTable(form);
    form.setWeights(new int[]{5,2,3});
  }
  createCheckerArea(composite);
  return composite;
}
Program: 137578
Project: 137578
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  IStructuredSelection selection=(IStructuredSelection)event.getSelection();
  if (blockingKeysTable != null) {
    blockingKeysTable.setInput(getBlockingKeysFromFiles(selection.toArray()));
  }
  if (matchingRulesTable != null) {
    matchingRulesTable.setInput(getMatchRulesFromFiles(selection.toArray()));
  }
}

Fixed version (ground truth):
public void selectionChanged(SelectionChangedEvent event){
  IStructuredSelection selection=(IStructuredSelection)event.getSelection();
  if (blockingKeysTable != null) {
    blockingKeysTable.setInput(getBlockingKeysFromFiles(selection.toArray(),true));
  }
  if (matchingRulesTable != null) {
    matchingRulesTable.setInput(getMatchRulesFromFiles(selection.toArray(),true));
  }
}
Program: 137579
Project: 137579
Buggy source:
public List<Map<String,String>> getMatchRulesFromFiles(Object[] files){
  List<Map<String,String>> ruleValues=new ArrayList<Map<String,String>>();
  for (  Object rule : files) {
    if (rule instanceof IFile) {
      MatchRuleDefinition matchRuleDefinition=DQRuleResourceFileHelper.getInstance().findMatchRule((IFile)rule);
      matchExistingColumnForMatchRules(matchRuleDefinition);
      ruleValues.addAll(getMatchRulesFromRules(matchRuleDefinition));
    }
  }
  return ruleValues;
}

Fixed version (ground truth):
/** 
 * DOC sizhaoliu Comment method "getMatchRulesFromFiles".
 * @param files
 * @param retrieveDisplayValue get the display value when this parameter is set to true, otherwise, get thecomponent value.
 * @return
 */
public List<Map<String,String>> getMatchRulesFromFiles(Object[] files,boolean retrieveDisplayValue){
  List<Map<String,String>> ruleValues=new ArrayList<Map<String,String>>();
  for (  Object rule : files) {
    if (rule instanceof IFile) {
      MatchRuleDefinition matchRuleDefinition=DQRuleResourceFileHelper.getInstance().findMatchRule((IFile)rule);
      matchExistingColumnForMatchRules(matchRuleDefinition);
      ruleValues.addAll(getMatchRulesFromRules(matchRuleDefinition,retrieveDisplayValue));
    }
  }
  return ruleValues;
}
Program: 137583
Project: 137583
Buggy source:
@Override public void dispose(){
  super.dispose();
  this.currentModelElement.eResource().unload();
}

Fixed version (ground truth):
@Override public void dispose(){
  super.dispose();
  if (this.currentModelElement != null && this.currentModelElement.eResource() != null) {
    this.currentModelElement.eResource().unload();
  }
}
Program: 137586
Project: 137586
Buggy source:
public ItemRecord[] populate(ItemRecord[] elements,boolean checkExisted){
  List<ItemRecord> inValidRecords=new ArrayList<ItemRecord>();
  for (  ItemRecord record : elements) {
    record.getErrors().clear();
    checkConflict(record,isIndicator(record.getElement()) || isPattern(record.getElement()));
    if (!checkExisted && (isIndicator(record.getElement()) || isPattern(record.getElement()))) {
      continue;
    }
    checkDependency(record);
    if (checkExisted && record.getConflictObject() != null) {
      record.addError(DefaultMessagesImpl.getString("String_Node_Str",record.getName()));
    }
    if (!record.isValid()) {
      inValidRecords.add(record);
    }
  }
  return inValidRecords.toArray(new ItemRecord[inValidRecords.size()]);
}

Fixed version (ground truth):
public ItemRecord[] populate(ItemRecord[] elements,boolean checkExisted){
  List<ItemRecord> inValidRecords=new ArrayList<ItemRecord>();
  for (  ItemRecord record : elements) {
    record.getErrors().clear();
    checkConflict(record,isIndicatorDefinition(record.getElement()) || isPattern(record.getElement()));
    if (!checkExisted && (isIndicatorDefinition(record.getElement()) || isPattern(record.getElement()))) {
      continue;
    }
    checkDependency(record);
    if (checkExisted && record.getConflictObject() != null) {
      record.addError(DefaultMessagesImpl.getString("String_Node_Str",record.getName()));
    }
    if (!record.isValid()) {
      inValidRecords.add(record);
    }
  }
  return inValidRecords.toArray(new ItemRecord[inValidRecords.size()]);
}
Program: 137587
Project: 137587
Buggy source:
@Override public void partClosed(IWorkbenchPart part){
  if (part instanceof SQLEditor) {
    unlockFile(part);
    super.partClosed(part);
    return;
  }
  if (!isCommonFormEditor(part)) {
    return;
  }
  Item item=getItem((IEditorPart)part);
  if (item == null) {
    return;
  }
  if (ProxyRepositoryManager.getInstance().isReadOnly() || ProxyRepositoryManager.getInstance().isEditable(item)) {
    ProxyRepositoryManager.getInstance().unLock(item);
    WorkspaceResourceHelper.refreshItem(item);
  }
 else {
    ProxyRepositoryManager.getInstance().refresh();
    CorePlugin.getDefault().refreshDQView();
  }
  super.partClosed(part);
}

Fixed version (ground truth):
@Override public void partClosed(IWorkbenchPart part){
  if (part instanceof org.eclipse.ui.internal.ViewIntroAdapterPart && part.getTitle().equals("String_Node_Str")) {
    IWorkbenchPage activePage=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    if (activePage != null) {
      if (activePage.getPerspective().getId().equals(IBrandingConfiguration.PERSPECTIVE_DQ_ID)) {
        CheatSheetPerspectiveAdapter.getInstance().cheetSheetInPerspective.put(IBrandingConfiguration.PERSPECTIVE_DQ_ID,true);
        CheatSheetPerspectiveAdapter.getInstance().perspectiveActivated(activePage,PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(IBrandingConfiguration.PERSPECTIVE_DQ_ID));
      }
    }
  }
  if (part instanceof SQLEditor) {
    unlockFile(part);
    super.partClosed(part);
    return;
  }
  if (!isCommonFormEditor(part)) {
    return;
  }
  Item item=getItem((IEditorPart)part);
  if (item == null) {
    return;
  }
  if (ProxyRepositoryManager.getInstance().isReadOnly() || ProxyRepositoryManager.getInstance().isEditable(item)) {
    ProxyRepositoryManager.getInstance().unLock(item);
    WorkspaceResourceHelper.refreshItem(item);
  }
 else {
    ProxyRepositoryManager.getInstance().refresh();
    CorePlugin.getDefault().refreshDQView();
  }
  super.partClosed(part);
}
Program: 137589
Project: 137589
Buggy source:
/** 
 * Method "getTopNQuery".
 * @param query
 * @param n
 * @return the n first row of the given query
 */
public String getTopNQuery(String query,int n){
  return query;
}

Fixed version (ground truth):
/** 
 * Method "getTopNQuery".
 * @param query
 * @param n
 * @return the n first row of the given query
 */
public String getTopNQuery(String query,int n){
  return query + "String_Node_Str" + n;
}
Program: 137590
Project: 137590
Buggy source:
@Override public String getTopNQuery(String query,int n){
  Matcher m=SELECT_PATTERN.matcher(query);
  return m.replaceFirst("String_Node_Str" + n + "String_Node_Str");
}

Fixed version (ground truth):
@Override public String getTopNQuery(String query,int n){
  Matcher m=SELECT_PATTERN.matcher(query);
  return m.replaceFirst("String_Node_Str" + n + PluginConstant.SPACE_STRING);
}
Program: 137591
Project: 137591
Buggy source:
/** 
 * DOC yyi 2011-08-10 22246:view rows for aveagge length
 * @return average length sql statement
 */
public String getAverageLengthRows(){
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * DOC yyi 2011-08-10 22246:view rows for aveagge length
 * @return average length sql statement
 */
@Override public String getAverageLengthRows(){
  return "String_Node_Str";
}
Program: 137592
Project: 137592
Buggy source:
/** 
 * DOC yyin Comment method "setUp".
 * @throws java.lang.Exception
 */
@Before public void setUp() throws Exception {
  DataExplorerTestHelper.initDataExplorer();
  benExp=new BenfordLawFrequencyExplorer();
  mockDbLanguage=mock(DbmsLanguage.class);
  when(mockDbLanguage.like()).thenReturn("String_Node_Str");
  stub(method(DbmsLanguageFactory.class,"String_Node_Str",DataManager.class)).toReturn(mockDbLanguage);
  benfordIndicator=mock(BenfordLawFrequencyIndicator.class);
  when(benfordIndicator.eClass()).thenReturn(null);
  Analysis analysis=DataExplorerTestHelper.getAnalysis(benfordIndicator,mockDbLanguage);
  benExp.setAnalysis(analysis);
  ChartDataEntity entity=mock(ChartDataEntity.class);
  when(entity.getIndicator()).thenReturn(benfordIndicator);
  PowerMockito.mockStatic(IndicatorEnum.class);
  when(IndicatorEnum.findIndicatorEnum(benfordIndicator.eClass())).thenReturn(IndicatorEnum.BenfordLawFrequencyIndicatorEnum);
  benExp.setEnitty(entity);
  when(entity.getKey()).thenReturn("String_Node_Str");
  when(entity.isLabelNull()).thenReturn(false);
}

Fixed version (ground truth):
/** 
 * DOC yyin Comment method "setUp".
 * @throws java.lang.Exception
 */
@Before public void setUp() throws Exception {
  DataExplorerTestHelper.initDataExplorer();
  benExp=new BenfordLawFrequencyExplorer();
  mockDbLanguage=mock(DbmsLanguage.class);
  when(mockDbLanguage.like()).thenReturn("String_Node_Str");
  stub(method(DbmsLanguageFactory.class,"String_Node_Str",DataManager.class)).toReturn(mockDbLanguage);
  benfordIndicator=mock(BenfordLawFrequencyIndicator.class);
  when(benfordIndicator.eClass()).thenReturn(null);
  Analysis analysis=DataExplorerTestHelper.getAnalysis(benfordIndicator,mockDbLanguage);
  benExp.setAnalysis(analysis);
  setValueToDrillDown("String_Node_Str");
}