nus-yam/ex-repair huggingface dataset:
Program: 137703
Project: 137703
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  RepositoryNode selectedObj=(RepositoryNode)((IStructuredSelection)event.getSelection()).getFirstElement();
  if (selectedObj != null) {
    if (selectedObj.hasChildren()) {
      this.setOutput(selectedObj);
      Boolean allCheckFlag=this.getTreeViewer().getChecked(selectedObj);
      List<?> repositoryNodeList=(List<?>)modelElementCheckedMap.get(selectedObj);
      if (repositoryNodeList != null) {
        this.getTableViewer().setCheckedElements(repositoryNodeList.toArray());
      }
 else       if (selectedObj instanceof DBTableRepNode || selectedObj instanceof DBViewRepNode || selectedObj instanceof DFTableRepNode) {
        if (allCheckFlag) {
          this.getTableViewer().setCheckedElements(selectedObj.getChildren().get(0).getChildren().toArray());
        }
      }
 else       if (selectedObj instanceof MDMXmlElementRepNode) {
        if (allCheckFlag) {
          this.getTableViewer().setCheckedElements(selectedObj.getChildren().toArray());
        }
      }
    }
  }
 else {
    this.getTableViewer().setInput(null);
  }
}

Fixed version (ground truth):
public void selectionChanged(SelectionChangedEvent event){
  RepositoryNode selectedObj=(RepositoryNode)((IStructuredSelection)event.getSelection()).getFirstElement();
  if (selectedObj != null) {
    if (selectedObj.hasChildren()) {
      this.setOutput(selectedObj);
      Boolean allCheckFlag=this.getTreeViewer().getChecked(selectedObj);
      List<?> repositoryNodeList=(List<?>)modelElementCheckedMap.get(selectedObj);
      if (repositoryNodeList != null) {
        this.getTableViewer().setCheckedElements(repositoryNodeList.toArray());
      }
 else       if (selectedObj instanceof DBTableRepNode || selectedObj instanceof DBViewRepNode || selectedObj instanceof DFTableRepNode) {
        if (allCheckFlag) {
          this.getTableViewer().setCheckedElements(selectedObj.getChildren().get(0).getChildren().toArray());
        }
      }
 else       if (selectedObj instanceof MDMXmlElementRepNode) {
        if (allCheckFlag) {
          this.getTableViewer().setCheckedElements(selectedObj.getChildren().toArray());
        }
      }
    }
  }
}
Program: 137706
Project: 137706
Buggy source:
protected abstract void restoreCheckStatus();

Fixed version (ground truth):
/** 
 * restore the left viewer's check status.
 */
protected abstract void restoreCheckStatus();
Program: 137707
Project: 137707
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  Object selectedObj=((IStructuredSelection)event.getSelection()).getFirstElement();
  if (selectedObj != null) {
    if (selectedObj instanceof DBTableFolderRepNode || selectedObj instanceof DBViewFolderRepNode) {
      IRepositoryNode node=(IRepositoryNode)selectedObj;
      this.setOutput(node);
      IRepositoryNode[] tables=getCheckedTableNodes(node);
      if (tables != null) {
        this.getTableViewer().setCheckedElements(tables);
      }
    }
  }
 else {
    this.getTableViewer().setInput(null);
  }
}

Fixed version (ground truth):
public void selectionChanged(SelectionChangedEvent event){
  Object selectedObj=((IStructuredSelection)event.getSelection()).getFirstElement();
  if (selectedObj != null) {
    if (selectedObj instanceof DBTableFolderRepNode || selectedObj instanceof DBViewFolderRepNode) {
      IRepositoryNode node=(IRepositoryNode)selectedObj;
      this.setOutput(node);
      IRepositoryNode[] tables=getCheckedTableNodes(node);
      if (tables != null) {
        this.getTableViewer().setCheckedElements(tables);
      }
    }
  }
}
Program: 137708
Project: 137708
Buggy source:
@Override public void run(){
  try {
    for (    IFile file : folder) {
      if (!file.exists()) {
        BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(file.getName());
        throw createBusinessException;
      }
    }
    new ChangePerspectiveAction(PluginConstant.SE_ID).run();
    IWorkbenchWindow aww=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    IWorkbenchPage ap=aww.getActivePage();
    for (    IFile file : folder) {
      try {
        IDE.openEditor(ap,file,true);
      }
 catch (      PartInitException e) {
        log.error(e,e);
      }
    }
  }
 catch (  BusinessException e) {
    ExceptionHandler.process(e,Level.FATAL);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    for (    IFile file : folder) {
      if (!file.exists()) {
        BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(file.getName());
        throw createBusinessException;
      }
    }
    new ChangePerspectiveAction(PluginConstant.SE_ID).run();
    IWorkbenchWindow aww=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    IWorkbenchPage ap=aww.getActivePage();
    for (    IFile file : folder) {
      try {
        IDE.openEditor(ap,file,SQLEditor.EDITOR_ID,true);
      }
 catch (      PartInitException e) {
        log.error(e,e);
      }
    }
  }
 catch (  BusinessException e) {
    ExceptionHandler.process(e,Level.FATAL);
  }
}
Program: 137710
Project: 137710
Buggy source:
public double getWeight(String str1,String str2){
  String code1=algorithm.encode(str1);
  String code2=algorithm.encode(str2);
  algorithm.setMaxCodeLen(Math.max(code1.length(),code2.length()));
  return StringComparisonUtil.difference(code1,code2) / (double)algorithm.getMaxCodeLen();
}

Fixed version (ground truth):
@Override public double getWeight(String str1,String str2){
  String code1=algorithm.encode(str1);
  String code2=algorithm.encode(str2);
  int maxLengh=Math.max(code1.length(),code2.length());
  if (maxLengh == 0) {
    return 0d;
  }
  algorithm.setMaxCodeLen(maxLengh);
  return StringComparisonUtil.difference(code1,code2) / (double)algorithm.getMaxCodeLen();
}
Program: 137711
Project: 137711
Buggy source:
public AttributeMatcherType getMatchType(){
  return AttributeMatcherType.metaphone;
}

Fixed version (ground truth):
@Override public AttributeMatcherType getMatchType(){
  return AttributeMatcherType.metaphone;
}
Program: 137712
Project: 137712
Buggy source:
@Override public double getMatchingWeight(String[] record1,String[] record2){
  double matchingWeight=0;
  for (  IRecordMatcher matcher : matchers) {
    double currentWeight=matcher.getMatchingWeight(record1,record2);
    if (currentWeight > matchingWeight) {
      lastPositiveMatcher=matcher;
      matchingWeight=currentWeight;
    }
    if (matchingWeight >= matcher.getRecordMatchThreshold()) {
      return matchingWeight;
    }
  }
  return matchingWeight;
}

Fixed version (ground truth):
@Override public double getMatchingWeight(String[] record1,String[] record2){
  double matchingWeight=0;
  for (  IRecordMatcher matcher : matchers) {
    double currentWeight=matcher.getMatchingWeight(record1,record2);
    if (currentWeight >= matchingWeight) {
      lastPositiveMatcher=matcher;
      matchingWeight=currentWeight;
    }
    if (matchingWeight >= matcher.getRecordMatchThreshold()) {
      return matchingWeight;
    }
  }
  return matchingWeight;
}
Program: 137714
Project: 137714
Buggy source:
/** 
 * @return
 */
public DatabaseNode getRoot(){
  return (DatabaseNode)_root;
}

Fixed version (ground truth):
/** 
 * @return
 */
public DatabaseNode getRoot(){
  return _root;
}
Program: 137718
Project: 137718
Buggy source:
public void modifyText(ModifyEvent e){
  useAutoGenQueryFlag=true;
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  useAutoGenQueryFlag=true;
  int tempSelectNumber=selectTabNumber;
  if (canBeOverwriten_tab1) {
    selectTabNumber=1;
    tab1_fullSql.setText(getAutoGeneratedQuery());
    canBeOverwriten_tab1=true;
  }
  if (IndicatorCategoryHelper.isUserDefMatching(category)) {
    if (canBeOverwriten_tab2_match) {
      selectTabNumber=2;
      tab2_match_viewvalidRows.setText(getAutoGeneratedQuery());
      canBeOverwriten_tab2_match=true;
    }
    if (canBeOverwriten_tab3_match) {
      selectTabNumber=3;
      tab3_match_viewInvalidRows.setText(getAutoGeneratedQuery());
      canBeOverwriten_tab3_match=true;
    }
    if (canBeOverwriten_tab4_match) {
      selectTabNumber=4;
      tab4_match_viewValidValues.setText(getAutoGeneratedQuery());
      canBeOverwriten_tab4_match=true;
    }
    if (canBeOverwriten_tab5_match) {
      selectTabNumber=5;
      tab5_match_viewInvalidValues.setText(getAutoGeneratedQuery());
      canBeOverwriten_tab5_match=true;
    }
  }
 else {
    if (canBeOverwriten_tab2_viewRows) {
      selectTabNumber=2;
      tab2_viewRows.setText(getAutoGeneratedQuery());
      canBeOverwriten_tab2_viewRows=true;
    }
  }
  selectTabNumber=tempSelectNumber;
  useAutoGenQueryFlag=true;
}
Program: 137719
Project: 137719
Buggy source:
/** 
 * Updata DB_PRODUCT tagged values for connection item in case they are not present in current file.
 * @throws SQLException
 */
public static void updataTaggedValueForConnectionItem(Connection dataProvider){
  if (dataProvider instanceof DatabaseConnection && StringUtils.isBlank(TaggedValueHelper.getValueString(TaggedValueHelper.DB_PRODUCT_NAME,dataProvider))) {
    Property property=PropertyHelper.getProperty(dataProvider);
    if (property != null) {
      Item item=property.getItem();
      if (item != null) {
        DatabaseConnection dbConn=(DatabaseConnection)dataProvider;
        IMetadataConnection metaConnection=ConvertionHelper.convert(dbConn);
        dbConn=(DatabaseConnection)MetadataFillFactory.getDBInstance().fillUIConnParams(metaConnection,dbConn);
        if (dbConn != null) {
          try {
            ProxyRepositoryFactory.getInstance().save(item);
          }
 catch (          PersistenceException e) {
            ExceptionHandler.process(e);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Updata DB_PRODUCT tagged values for connection item in case they are not present in current file.
 * @throws SQLException
 */
public static synchronized void updataTaggedValueForConnectionItem(Connection dataProvider){
  if (dataProvider instanceof DatabaseConnection && StringUtils.isBlank(TaggedValueHelper.getValueString(TaggedValueHelper.DB_PRODUCT_NAME,dataProvider))) {
    Property property=PropertyHelper.getProperty(dataProvider);
    if (property != null) {
      Item item=property.getItem();
      if (item != null) {
        DatabaseConnection dbConn=(DatabaseConnection)dataProvider;
        IMetadataConnection metaConnection=ConvertionHelper.convert(dbConn);
        dbConn=(DatabaseConnection)MetadataFillFactory.getDBInstance().fillUIConnParams(metaConnection,dbConn);
        if (dbConn != null) {
          try {
            ProxyRepositoryFactory.getInstance().save(item);
          }
 catch (          PersistenceException e) {
            ExceptionHandler.process(e);
          }
        }
      }
    }
  }
}
Program: 137721
Project: 137721
Buggy source:
/** 
 * store ViewRows Expression value.
 */
public void storeViewRowsExp(){
  storeTdExpValuesFromText(tempViewRowsExp,tab2_viewRows);
}

Fixed version (ground truth):
/** 
 * store text value to temp ViewRows Expression.
 */
public void storeViewRowsExp(){
  tempViewRowsExp=storeTdExpValuesFromText(tab2_viewRows);
}
Program: 137723
Project: 137723
Buggy source:
/** 
 * set Text value as body of TdExpression.
 * @param tdExp
 * @param text
 */
public void storeTdExpValuesFromText(TdExpression tdExp,Text text){
  tdExp.setBody(text.getText());
  tdExp.setVersion(version);
  tdExp.setLanguage(language);
  tdExp.setModificationDate(UDIUtils.getCurrentDateTime());
}

Fixed version (ground truth):
/** 
 * set Text value as body of TdExpression.
 * @param text
 */
public TdExpression storeTdExpValuesFromText(Text text){
  TdExpression result=BooleanExpressionHelper.createTdExpression(language,text.getText(),version);
  result.setModificationDate(UDIUtils.getCurrentDateTime());
  return result;
}
Program: 137724
Project: 137724
Buggy source:
/** 
 * store Expression values when indicator is user define match.
 */
public void storeExpForMatch(){
  storeTdExpValuesFromText(tempViewValidRowsExp,tab2_match_viewvalidRows);
  storeTdExpValuesFromText(tempViewInvalidRowsExp,tab3_match_viewInvalidRows);
  storeTdExpValuesFromText(tempViewValidValuesExp,tab4_match_viewValidValues);
  storeTdExpValuesFromText(tempViewInvalidValuesExp,tab5_match_viewInvalidValues);
}

Fixed version (ground truth):
/** 
 * store Expression values when indicator is user define match.
 */
public void storeExpForMatch(){
  tempViewValidRowsExp=storeTdExpValuesFromText(tab2_match_viewvalidRows);
  tempViewInvalidRowsExp=storeTdExpValuesFromText(tab3_match_viewInvalidRows);
  tempViewValidValuesExp=storeTdExpValuesFromText(tab4_match_viewValidValues);
  tempViewInvalidValuesExp=storeTdExpValuesFromText(tab5_match_viewInvalidValues);
}
Program: 137725
Project: 137725
Buggy source:
@Override public void run(){
  try {
    if (this.node != null) {
      if (WorkspaceResourceHelper.sourceFileHasBeenOpened(this.node)) {
        MessageUI.openWarning(DefaultMessagesImpl.getString("String_Node_Str",this.node.getLabel()));
        return;
      }
    }
    if (!this.filePath.toFile().exists()) {
      BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(this.filePath.toFile().getName());
      throw createBusinessException;
    }
    RenameDialog dialog=new RenameDialog(Display.getDefault().getActiveShell());
    existNames=new ArrayList<String>();
    getExistNames(parentNode,existNames);
    if (dialog.open() == RenameDialog.OK) {
      try {
        CorePlugin.getDefault().closeEditorIfOpened(sourceFiletem);
        Project project=ProjectManager.getInstance().getCurrentProject();
        if (!isNeedToMove(newFolderPath)) {
          renameSourceFile(project);
        }
 else {
          moveSourceFile(project,newFolderPath);
        }
        CorePlugin.getDefault().refreshDQView(parentNode);
      }
 catch (      PersistenceException e) {
        log.error(e);
      }
catch (      BusinessException e) {
        log.error(e);
      }
    }
  }
 catch (  BusinessException e) {
    ExceptionHandler.process(e,Level.FATAL);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    if (this.node != null) {
      if (WorkspaceResourceHelper.sourceFileHasBeenOpened(this.node)) {
        MessageUI.openWarning(DefaultMessagesImpl.getString("String_Node_Str",this.node.getLabel()));
        return;
      }
    }
    if (!ResourceManager.getRootProject().exists(filePath)) {
      BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(this.filePath.toFile().getName());
      throw createBusinessException;
    }
    RenameDialog dialog=new RenameDialog(Display.getDefault().getActiveShell());
    existNames=new ArrayList<String>();
    getExistNames(parentNode,existNames);
    if (dialog.open() == RenameDialog.OK) {
      try {
        CorePlugin.getDefault().closeEditorIfOpened(sourceFiletem);
        Project project=ProjectManager.getInstance().getCurrentProject();
        if (!isNeedToMove(newFolderPath)) {
          renameSourceFile(project);
        }
 else {
          moveSourceFile(project,newFolderPath);
        }
        CorePlugin.getDefault().refreshDQView(parentNode);
      }
 catch (      PersistenceException e) {
        log.error(e);
      }
catch (      BusinessException e) {
        log.error(e);
      }
    }
  }
 catch (  BusinessException e) {
    ExceptionHandler.process(e,Level.FATAL);
  }
}
Program: 137728
Project: 137728
Buggy source:
@Override public void run(){
  try {
    TdTaskPropertiesDialog dialog=new TdTaskPropertiesDialog(shell);
    ModelElement modelElement=null;
    IFile file=null;
    if (navObj instanceof RepositoryNode) {
      RepositoryNode node=(RepositoryNode)navObj;
      modelElement=RepositoryNodeHelper.getModelElementFromRepositoryNode(node);
      if (modelElement == null || modelElement.eResource() == null) {
        BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(node.getObject());
        throw createBusinessException;
      }
      file=WorkspaceUtils.getModelElementResource(modelElement);
    }
 else {
      modelElement=(ModelElement)navObj;
      file=WorkspaceUtils.getModelElementResource(modelElement);
    }
    if (modelElement != null) {
      TdResourceModel tdResModel=new TdResourceModel(file.getFullPath(),(Workspace)file.getWorkspace(),modelElement);
      dialog.setResource(tdResModel);
      Map<String,Object> attMap=new HashMap<String,Object>();
      attMap.put(MarkerViewUtil.NAME_ATTRIBUTE,modelElement.getName());
      attMap.put(IMarker.LOCATION,file.getRawLocation().toString());
      attMap.put(IMarker.LINE_NUMBER,file.getRawLocation().toString());
      dialog.setInitialAttributes(attMap);
      dialog.open();
    }
  }
 catch (  BusinessException e) {
    ExceptionHandler.process(e,Level.FATAL);
  }
catch (  Exception e1) {
    log.error(e1,e1);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    TdTaskPropertiesDialog dialog=new TdTaskPropertiesDialog(shell);
    ModelElement modelElement=null;
    if (navObj instanceof RepositoryNode) {
      RepositoryNode node=(RepositoryNode)navObj;
      modelElement=RepositoryNodeHelper.getModelElementFromRepositoryNode(node);
    }
 else {
      modelElement=(ModelElement)navObj;
    }
    if (modelElement == null || modelElement.eResource() == null || modelElement.getName() == null) {
      String fileName="String_Node_Str";
      if (navObj instanceof RepositoryNode) {
        Item item=((RepositoryNode)navObj).getObject().getProperty().getItem();
        if (item instanceof TDQItem) {
          fileName=((TDQItem)item).getFilename();
        }
      }
      BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(fileName);
      throw createBusinessException;
    }
    IFile file=WorkspaceUtils.getModelElementResource(modelElement);
    TdResourceModel tdResModel=new TdResourceModel(file.getFullPath(),(Workspace)file.getWorkspace(),modelElement);
    dialog.setResource(tdResModel);
    Map<String,Object> attMap=new HashMap<String,Object>();
    attMap.put(MarkerViewUtil.NAME_ATTRIBUTE,modelElement.getName());
    attMap.put(IMarker.LOCATION,file.getRawLocation().toString());
    attMap.put(IMarker.LINE_NUMBER,file.getRawLocation().toString());
    dialog.setInitialAttributes(attMap);
    dialog.open();
  }
 catch (  BusinessException e) {
    ExceptionHandler.process(e,Level.FATAL);
  }
catch (  Exception e1) {
    log.error(e1,e1);
  }
}
Program: 137730
Project: 137730
Buggy source:
/** 
 * get the Query After Replaced.
 * @param indicatorDefinition
 * @param list
 * @return String
 */
public String getQueryAfterReplaced(IndicatorDefinition indicatorDefinition,EList<TdExpression> list){
  String sql=PluginConstant.EMPTY_STRING;
  TdExpression tdExp=DbmsLanguage.getSqlExpression(indicatorDefinition,dbmsLanguage.getDbmsName(),list,dbmsLanguage.getDbVersion());
  sql=tdExp.getBody();
  String dataFilterClause=getDataFilterClause();
  if (!dataFilterClause.equals(PluginConstant.EMPTY_STRING)) {
    sql=sql.replace(GenericSQLHandler.WHERE_CLAUSE,dbmsLanguage.where() + dataFilterClause);
    sql=sql.replace(GenericSQLHandler.AND_WHERE_CLAUSE,dbmsLanguage.and() + dataFilterClause);
  }
 else {
    sql=sql.replace(GenericSQLHandler.WHERE_CLAUSE,PluginConstant.EMPTY_STRING);
    sql=sql.replace(GenericSQLHandler.AND_WHERE_CLAUSE,PluginConstant.EMPTY_STRING);
  }
  ModelElement analyzedElement=indicator.getAnalyzedElement();
  String tableName=getFullyQualifiedTableName(analyzedElement);
  sql=dbmsLanguage.fillGenericQueryWithColumnsAndTable(sql,analyzedElement.getName(),tableName);
  if (sql.indexOf(GenericSQLHandler.GROUP_BY_ALIAS) != -1) {
    sql=sql.replace(GenericSQLHandler.GROUP_BY_ALIAS,"String_Node_Str" + analyzedElement.getName() + "String_Node_Str");
  }
  return sql;
}

Fixed version (ground truth):
/** 
 * get the Query After Replaced.
 * @param indicatorDefinition
 * @param list
 * @return String
 */
public String getQueryAfterReplaced(IndicatorDefinition indicatorDefinition,EList<TdExpression> list){
  String sql=PluginConstant.EMPTY_STRING;
  TdExpression tdExp=DbmsLanguage.getSqlExpression(indicatorDefinition,dbmsLanguage.getDbmsName(),list,dbmsLanguage.getDbVersion());
  sql=tdExp.getBody();
  String dataFilterClause=getDataFilterClause();
  if (!dataFilterClause.equals(PluginConstant.EMPTY_STRING)) {
    sql=sql.replace(GenericSQLHandler.WHERE_CLAUSE,dbmsLanguage.where() + "String_Node_Str" + dataFilterClause+ "String_Node_Str");
    sql=sql.replace(GenericSQLHandler.AND_WHERE_CLAUSE,dbmsLanguage.and() + "String_Node_Str" + dataFilterClause+ "String_Node_Str");
  }
 else {
    sql=sql.replace(GenericSQLHandler.WHERE_CLAUSE,PluginConstant.EMPTY_STRING);
    sql=sql.replace(GenericSQLHandler.AND_WHERE_CLAUSE,PluginConstant.EMPTY_STRING);
  }
  ModelElement analyzedElement=indicator.getAnalyzedElement();
  String tableName=getFullyQualifiedTableName(analyzedElement);
  sql=dbmsLanguage.fillGenericQueryWithColumnsAndTable(sql,analyzedElement.getName(),tableName);
  if (sql.indexOf(GenericSQLHandler.GROUP_BY_ALIAS) != -1) {
    sql=sql.replace(GenericSQLHandler.GROUP_BY_ALIAS,"String_Node_Str" + analyzedElement.getName() + "String_Node_Str");
  }
  return sql;
}
Program: 137733
Project: 137733
Buggy source:
public GenericSQLHandler replaceUDIWhere(String UDIWhere){
  sqlString=sqlString.replace(UDI_WHERE,UDIWhere);
  return this;
}

Fixed version (ground truth):
public GenericSQLHandler replaceUDIWhere(String UDIWhere){
  sqlString=sqlString.replace(UDI_WHERE,"String_Node_Str" + UDIWhere + "String_Node_Str");
  return this;
}
Program: 137734
Project: 137734
Buggy source:
/** 
 * return the duplicate object property.
 * @param newName
 * @param objectType
 */
public static Property getDuplicateObject(String newName,ERepositoryObjectType objectType){
  Property prop=null;
  String normalizeName=WorkspaceUtils.normalize(newName);
  List<IRepositoryViewObject> existObjects;
  try {
    existObjects=ProxyRepositoryFactory.getInstance().getAll(objectType,true,false);
    if (existObjects != null) {
      for (      IRepositoryViewObject object : existObjects) {
        if (object == null || object.getProperty() == null) {
          continue;
        }
        prop=object.getProperty();
        if (newName.equals(prop.getDisplayName()) || normalizeName.equals(prop.getLabel())) {
          return prop;
        }
      }
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return prop;
}

Fixed version (ground truth):
/** 
 * return the duplicate object property.
 * @param newName
 * @param objectType
 */
public static Property getDuplicateObject(String newName,ERepositoryObjectType objectType){
  Property prop=null;
  String normalizeName=WorkspaceUtils.normalize(newName);
  List<IRepositoryViewObject> existObjects;
  try {
    existObjects=ProxyRepositoryFactory.getInstance().getAll(objectType,true,false);
    if (existObjects != null) {
      for (      IRepositoryViewObject object : existObjects) {
        if (object == null || object.getProperty() == null) {
          continue;
        }
        if (newName.equals(object.getProperty().getDisplayName()) || normalizeName.equals(object.getProperty().getLabel())) {
          return object.getProperty();
        }
      }
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return prop;
}
Program: 137735
Project: 137735
Buggy source:
@Override public IFile duplicate(String newLabel){
  IFile duplicatedFile=super.duplicate(newLabel);
  UDIndicatorDefinition definition=(UDIndicatorDefinition)ModelElementFileFactory.getModelElement(duplicatedFile);
  IndicatorCategory category=UDIHelper.getUDICategory(definition);
  if (category == null || !IndicatorCategoryHelper.isUserDefCategory(category)) {
    UDIHelper.setUDICategory(definition,DefinitionHandler.getInstance().getUserDefinedCountIndicatorCategory());
  }
  TaggedValueHelper.setValidStatus(true,definition);
  definition.setLabel(definition.getName());
  definition=UDIUtils.createDefaultDrillDownList(definition);
  IndicatorResourceFileHelper.getInstance().save(definition);
  DefinitionHandler.reload();
  return duplicatedFile;
}

Fixed version (ground truth):
@Override public IFile duplicate(String newLabel){
  IFile duplicatedFile=super.duplicate(newLabel);
  IndicatorDefinition definition=(IndicatorDefinition)ModelElementFileFactory.getModelElement(duplicatedFile);
  IndicatorCategory category=UDIHelper.getUDICategory(definition);
  if (category == null || !IndicatorCategoryHelper.isUserDefCategory(category)) {
    UDIHelper.setUDICategory(definition,DefinitionHandler.getInstance().getUserDefinedCountIndicatorCategory());
  }
  TaggedValueHelper.setValidStatus(true,definition);
  definition.setLabel(definition.getName());
  IndicatorResourceFileHelper.getInstance().save(definition);
  DefinitionHandler.reload();
  UpdateUDIIndicatorsWithNewModelTask task=new UpdateUDIIndicatorsWithNewModelTask();
  task.execute();
  return duplicatedFile;
}
Program: 137736
Project: 137736
Buggy source:
@Override public String getText(Object obj){
  if (obj == null) {
    return "String_Node_Str";
  }
  if (obj instanceof ImpactNode) {
    return ((ImpactNode)obj).toString();
  }
 else   if (obj instanceof IFile) {
    IFile file=(IFile)obj;
    ModelElement modelElement=ModelElementFileFactory.getModelElement(file);
    String name=modelElement != null ? PropertyHelper.getProperty(modelElement).getDisplayName() : file.getName();
    return name;
  }
 else   if (obj instanceof RepositoryViewObject) {
    return ((IRepositoryViewObject)obj).getLabel();
  }
  return PropertyHelper.getProperty((ModelElement)obj).getDisplayName();
}

Fixed version (ground truth):
@Override public String getText(Object obj){
  if (obj == null) {
    return "String_Node_Str";
  }
  if (obj instanceof ImpactNode) {
    return ((ImpactNode)obj).toString();
  }
 else   if (obj instanceof IFile) {
    IFile file=(IFile)obj;
    ModelElement modelElement=ModelElementFileFactory.getModelElement(file);
    String name=modelElement != null ? PropertyHelper.getProperty(modelElement).getDisplayName() : file.getName();
    return name;
  }
 else   if (obj instanceof RepositoryViewObject) {
    return ((IRepositoryViewObject)obj).getLabel();
  }
  return ((ModelElement)obj).getName();
}
Program: 137738
Project: 137738
Buggy source:
/** 
 * get Query For User define indicator.
 * @param indicatorDefinition
 * @return
 */
private String getQueryForUDIndicator(IndicatorDefinition indicatorDefinition){
  String sql=PluginConstant.EMPTY_STRING;
  EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewRowsExpression();
  TdExpression tdExp=DbmsLanguage.getSqlExpression(indicatorDefinition,dbmsLanguage.getDbmsName(),list,dbmsLanguage.getDbVersion());
  sql=tdExp.getBody();
  String dataFilterClause=getDataFilterClause();
  sql=sql.replace(GenericSQLHandler.WHERE_CLAUSE,dbmsLanguage.where() + dataFilterClause);
  sql=sql.replace(GenericSQLHandler.AND_WHERE_CLAUSE,PluginConstant.EMPTY_STRING.equals(dataFilterClause) ? PluginConstant.EMPTY_STRING : dbmsLanguage.and() + dataFilterClause);
  String tableName=getFullyQualifiedTableName(this.indicator.getAnalyzedElement());
  sql=sql.replace(GenericSQLHandler.TABLE_NAME,tableName);
  sql=sql.replace(GenericSQLHandler.COLUMN_NAMES,this.indicator.getAnalyzedElement().getName());
  sql=sql.replace(GenericSQLHandler.UDI_INDICATOR_VALUE,(String.valueOf(this.indicator.getIntegerValue().intValue())));
  return sql;
}

Fixed version (ground truth):
/** 
 * get Query For User define indicator.
 * @param indicatorDefinition
 * @return
 */
private String getQueryForUDIndicator(IndicatorDefinition indicatorDefinition){
  String sql=PluginConstant.EMPTY_STRING;
  EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewRowsExpression();
  TdExpression tdExp=DbmsLanguage.getSqlExpression(indicatorDefinition,dbmsLanguage.getDbmsName(),list,dbmsLanguage.getDbVersion());
  sql=tdExp.getBody();
  String dataFilterClause=getDataFilterClause();
  if (!dataFilterClause.equals(PluginConstant.EMPTY_STRING)) {
    sql=sql.replace(GenericSQLHandler.WHERE_CLAUSE,dbmsLanguage.where() + dataFilterClause);
    sql=sql.replace(GenericSQLHandler.AND_WHERE_CLAUSE,dbmsLanguage.and() + dataFilterClause);
  }
 else {
    sql=sql.replace(GenericSQLHandler.WHERE_CLAUSE,PluginConstant.EMPTY_STRING);
    sql=sql.replace(GenericSQLHandler.AND_WHERE_CLAUSE,PluginConstant.EMPTY_STRING);
  }
  String tableName=getFullyQualifiedTableName(this.indicator.getAnalyzedElement());
  sql=sql.replace(GenericSQLHandler.TABLE_NAME,tableName);
  sql=sql.replace(GenericSQLHandler.COLUMN_NAMES,this.indicator.getAnalyzedElement().getName());
  if (sql.indexOf(GenericSQLHandler.UDI_INDICATOR_VALUE) != -1) {
    sql=sql.replace(GenericSQLHandler.UDI_INDICATOR_VALUE,(String.valueOf(this.indicator.getIntegerValue().intValue())));
  }
  return sql;
}
Program: 137739
Project: 137739
Buggy source:
/** 
 * get the Query After Replaced.
 * @param indicatorDefinition
 * @param list
 * @return String
 */
public String getQueryAfterReplaced(IndicatorDefinition indicatorDefinition,EList<TdExpression> list){
  String sql=PluginConstant.EMPTY_STRING;
  TdExpression tdExp=DbmsLanguage.getSqlExpression(indicatorDefinition,dbmsLanguage.getDbmsName(),list,dbmsLanguage.getDbVersion());
  sql=tdExp.getBody();
  String dataFilterClause=getDataFilterClause();
  String tableName=getFullyQualifiedTableName(this.indicator.getAnalyzedElement());
  sql=sql.replace(GenericSQLHandler.WHERE_CLAUSE,dbmsLanguage.where() + dataFilterClause);
  sql=sql.replace(GenericSQLHandler.AND_WHERE_CLAUSE,PluginConstant.EMPTY_STRING.equals(dataFilterClause) ? PluginConstant.EMPTY_STRING : dbmsLanguage.and() + dataFilterClause);
  sql=dbmsLanguage.fillGenericQueryWithColumnsAndTable(sql,indicator.getAnalyzedElement().getName(),tableName);
  return sql;
}

Fixed version (ground truth):
/** 
 * get the Query After Replaced.
 * @param indicatorDefinition
 * @param list
 * @return String
 */
public String getQueryAfterReplaced(IndicatorDefinition indicatorDefinition,EList<TdExpression> list){
  String sql=PluginConstant.EMPTY_STRING;
  TdExpression tdExp=DbmsLanguage.getSqlExpression(indicatorDefinition,dbmsLanguage.getDbmsName(),list,dbmsLanguage.getDbVersion());
  sql=tdExp.getBody();
  String dataFilterClause=getDataFilterClause();
  if (!dataFilterClause.equals(PluginConstant.EMPTY_STRING)) {
    sql=sql.replace(GenericSQLHandler.WHERE_CLAUSE,dbmsLanguage.where() + dataFilterClause);
    sql=sql.replace(GenericSQLHandler.AND_WHERE_CLAUSE,dbmsLanguage.and() + dataFilterClause);
  }
 else {
    sql=sql.replace(GenericSQLHandler.WHERE_CLAUSE,PluginConstant.EMPTY_STRING);
    sql=sql.replace(GenericSQLHandler.AND_WHERE_CLAUSE,PluginConstant.EMPTY_STRING);
  }
  String tableName=getFullyQualifiedTableName(this.indicator.getAnalyzedElement());
  sql=dbmsLanguage.fillGenericQueryWithColumnsAndTable(sql,indicator.getAnalyzedElement().getName(),tableName);
  return sql;
}
Program: 137741
Project: 137741
Buggy source:
/** 
 * get Query For View Rows.
 * @param indicatorDefinition
 * @return
 */
public String getQueryForViewRows(IndicatorDefinition indicatorDefinition){
  String sql=PluginConstant.EMPTY_STRING;
  IndicatorCategory category=IndicatorCategoryHelper.getCategory(indicatorDefinition);
  EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewRowsExpression();
  TdExpression tdExp=DbmsLanguage.getSqlExpression(indicatorDefinition,dbmsLanguage.getDbmsName(),list,dbmsLanguage.getDbVersion());
  sql=tdExp.getBody();
  String dataFilterClause=getDataFilterClause();
  sql=sql.replace(GenericSQLHandler.WHERE_CLAUSE,dbmsLanguage.where() + dataFilterClause);
  sql=sql.replace(GenericSQLHandler.AND_WHERE_CLAUSE,PluginConstant.EMPTY_STRING.equals(dataFilterClause) ? PluginConstant.EMPTY_STRING : dbmsLanguage.and() + dataFilterClause);
  String tableName=getFullyQualifiedTableName(this.indicator.getAnalyzedElement());
  sql=sql.replace(GenericSQLHandler.TABLE_NAME,tableName);
  sql=sql.replace(GenericSQLHandler.COLUMN_NAMES,this.indicator.getAnalyzedElement().getName());
  if (IndicatorCategoryHelper.isUserDefRealValue(category)) {
    sql=sql.replace(GenericSQLHandler.UDI_INDICATOR_VALUE,this.indicator.getRealValue().toString());
  }
 else {
    sql=sql.replace(GenericSQLHandler.UDI_INDICATOR_VALUE,(String.valueOf(this.indicator.getIntegerValue().intValue())));
  }
  return sql;
}

Fixed version (ground truth):
/** 
 * get Query For View Rows.
 * @param indicatorDefinition
 * @return
 */
public String getQueryForViewRows(IndicatorDefinition indicatorDefinition){
  String sql=PluginConstant.EMPTY_STRING;
  IndicatorCategory category=IndicatorCategoryHelper.getCategory(indicatorDefinition);
  EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewRowsExpression();
  TdExpression tdExp=DbmsLanguage.getSqlExpression(indicatorDefinition,dbmsLanguage.getDbmsName(),list,dbmsLanguage.getDbVersion());
  sql=tdExp.getBody();
  String dataFilterClause=getDataFilterClause();
  if (!dataFilterClause.equals(PluginConstant.EMPTY_STRING)) {
    sql=sql.replace(GenericSQLHandler.WHERE_CLAUSE,dbmsLanguage.where() + dataFilterClause);
    sql=sql.replace(GenericSQLHandler.AND_WHERE_CLAUSE,dbmsLanguage.and() + dataFilterClause);
  }
 else {
    sql=sql.replace(GenericSQLHandler.WHERE_CLAUSE,PluginConstant.EMPTY_STRING);
    sql=sql.replace(GenericSQLHandler.AND_WHERE_CLAUSE,PluginConstant.EMPTY_STRING);
  }
  String tableName=getFullyQualifiedTableName(this.indicator.getAnalyzedElement());
  sql=sql.replace(GenericSQLHandler.TABLE_NAME,tableName);
  sql=sql.replace(GenericSQLHandler.COLUMN_NAMES,this.indicator.getAnalyzedElement().getName());
  if (IndicatorCategoryHelper.isUserDefRealValue(category)) {
    sql=sql.replace(GenericSQLHandler.UDI_INDICATOR_VALUE,this.indicator.getRealValue().toString());
  }
 else {
    sql=sql.replace(GenericSQLHandler.UDI_INDICATOR_VALUE,(String.valueOf(this.indicator.getIntegerValue().intValue())));
  }
  return sql;
}
Program: 137742
Project: 137742
Buggy source:
public GenericSQLHandler replaceUDIQueryToMatch(){
  sqlString=sqlString.replace("String_Node_Str" + UDI_WHERE + PluginConstant.SPACE_STRING+ GenericSQLHandler.AND_WHERE_CLAUSE,WHERE_CLAUSE);
  sqlString=sqlString.replace("String_Node_Str" + UDI_WHERE + PluginConstant.SPACE_STRING+ AND_WHERE_CLAUSE,AND_WHERE_CLAUSE);
  sqlString=sqlString.replace("String_Node_Str" + UDI_ORDER_BY,PluginConstant.SPACE_STRING);
  sqlString=sqlString.replace("String_Node_Str" + GenericSQLHandler.UDI_GROUP_BY,PluginConstant.SPACE_STRING);
  sqlString=sqlString.replace("String_Node_Str","String_Node_Str");
  sqlString=sqlString.replace("String_Node_Str" + AND_WHERE_CLAUSE,AND_WHERE_CLAUSE);
  sqlString=sqlString.replace("String_Node_Str","String_Node_Str");
  sqlString=sqlString.replace("String_Node_Str","String_Node_Str");
  sqlString=sqlString.replace("String_Node_Str","String_Node_Str");
  sqlString=sqlString.replace("String_Node_Str" + AND_WHERE_CLAUSE,"String_Node_Str" + WHERE_CLAUSE);
  sqlString=sqlString.replace("String_Node_Str" + AND_WHERE_CLAUSE,"String_Node_Str" + WHERE_CLAUSE);
  sqlString=sqlString.replace("String_Node_Str" + AND_WHERE_CLAUSE,WHERE_CLAUSE);
  sqlString=sqlString.replace("String_Node_Str","String_Node_Str" + WHERE_CLAUSE);
  return this;
}

Fixed version (ground truth):
public GenericSQLHandler replaceUDIQueryToMatch(){
  sqlString=sqlString.replace("String_Node_Str" + UDI_WHERE + PluginConstant.SPACE_STRING+ AND_WHERE_CLAUSE,WHERE_CLAUSE);
  sqlString=sqlString.replace("String_Node_Str" + UDI_WHERE + PluginConstant.SPACE_STRING+ AND_WHERE_CLAUSE,AND_WHERE_CLAUSE);
  sqlString=sqlString.replace("String_Node_Str" + UDI_ORDER_BY,PluginConstant.SPACE_STRING);
  sqlString=sqlString.replace("String_Node_Str" + UDI_GROUP_BY,PluginConstant.SPACE_STRING);
  sqlString=sqlString.replace("String_Node_Str","String_Node_Str");
  sqlString=sqlString.replace("String_Node_Str" + AND_WHERE_CLAUSE,AND_WHERE_CLAUSE);
  sqlString=sqlString.replace("String_Node_Str","String_Node_Str");
  sqlString=sqlString.replace("String_Node_Str","String_Node_Str");
  sqlString=sqlString.replace("String_Node_Str","String_Node_Str");
  sqlString=sqlString.replace("String_Node_Str" + AND_WHERE_CLAUSE,"String_Node_Str" + WHERE_CLAUSE);
  sqlString=sqlString.replace("String_Node_Str" + AND_WHERE_CLAUSE,"String_Node_Str" + WHERE_CLAUSE);
  sqlString=sqlString.replace("String_Node_Str" + AND_WHERE_CLAUSE,WHERE_CLAUSE);
  sqlString=sqlString.replace("String_Node_Str" + AND_WHERE_CLAUSE,WHERE_CLAUSE);
  sqlString=sqlString.replace("String_Node_Str" + WHERE_CLAUSE,WHERE_CLAUSE);
  sqlString=sqlString.replace("String_Node_Str",WHERE_CLAUSE);
  sqlString=sqlString.replace("String_Node_Str","String_Node_Str");
  sqlString=sqlString.trim();
  if (sqlString.endsWith("String_Node_Str")) {
    sqlString=sqlString.replace("String_Node_Str",PluginConstant.EMPTY_STRING);
  }
  sqlString=sqlString.trim();
  if (sqlString.endsWith("String_Node_Str")) {
    sqlString=sqlString.replace("String_Node_Str",PluginConstant.EMPTY_STRING);
  }
  sqlString=sqlString.trim();
  return this;
}
Program: 137744
Project: 137744
Buggy source:
/** 
 * DOC msjian Comment method "getValidRowsStatement".
 * @return
 */
public String getValidRowsStatement(){
  IndicatorDefinition indicatorDefinition=this.indicator.getIndicatorDefinition();
  if (indicatorDefinition instanceof UDIndicatorDefinition) {
    EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewValidRowsExpression();
    return getReplacedSql(list);
  }
  String regexPatternString=dbmsLanguage.getRegexPatternString((PatternMatchingIndicator)this.indicator);
  String regexCmp=dbmsLanguage.regexLike(columnName,regexPatternString) + functionReturnValue;
  return getRowsStatement(regexCmp);
}

Fixed version (ground truth):
/** 
 * get the Valid Rows Statement.
 * @return
 */
public String getValidRowsStatement(){
  IndicatorDefinition indicatorDefinition=this.indicator.getIndicatorDefinition();
  if (indicatorDefinition instanceof UDIndicatorDefinition) {
    EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewValidRowsExpression();
    return getQueryAfterReplaced(indicatorDefinition,list);
  }
  String regexPatternString=dbmsLanguage.getRegexPatternString(this.indicator);
  String regexCmp=dbmsLanguage.regexLike(columnName,regexPatternString) + functionReturnValue;
  return getRowsStatement(regexCmp);
}
Program: 137745
Project: 137745
Buggy source:
/** 
 * DOC msjian Comment method "getInvalidRowsStatement".
 * @return
 */
public String getInvalidRowsStatement(){
  IndicatorDefinition indicatorDefinition=this.indicator.getIndicatorDefinition();
  if (indicatorDefinition instanceof UDIndicatorDefinition) {
    EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewInvalidRowsExpression();
    return getReplacedSql(list);
  }
  String regexPatternString=dbmsLanguage.getRegexPatternString((PatternMatchingIndicator)this.indicator);
  String regexCmp=dbmsLanguage.regexNotLike(columnName,regexPatternString) + functionReturnValue;
  String nullClause=dbmsLanguage.or() + columnName + dbmsLanguage.isNull();
  String pattCondStr="String_Node_Str" + regexCmp + nullClause+ "String_Node_Str";
  return getRowsStatement(pattCondStr);
}

Fixed version (ground truth):
/** 
 * get the Invalid Rows Statement.
 * @return
 */
public String getInvalidRowsStatement(){
  IndicatorDefinition indicatorDefinition=this.indicator.getIndicatorDefinition();
  if (indicatorDefinition instanceof UDIndicatorDefinition) {
    EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewInvalidRowsExpression();
    return getQueryAfterReplaced(indicatorDefinition,list);
  }
  String regexPatternString=dbmsLanguage.getRegexPatternString(this.indicator);
  String regexCmp=dbmsLanguage.regexNotLike(columnName,regexPatternString) + functionReturnValue;
  String nullClause=dbmsLanguage.or() + columnName + dbmsLanguage.isNull();
  String pattCondStr="String_Node_Str" + regexCmp + nullClause+ "String_Node_Str";
  return getRowsStatement(pattCondStr);
}
Program: 137746
Project: 137746
Buggy source:
/** 
 * DOC zshen Comment method "getValidValuesStatement".
 * @return SELECT statement for the valid Value of select column
 */
public String getValidValuesStatement(){
  IndicatorDefinition indicatorDefinition=this.indicator.getIndicatorDefinition();
  if (indicatorDefinition instanceof UDIndicatorDefinition) {
    EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewValidValuesExpression();
    return getReplacedSql(list);
  }
  String regexPatternString=dbmsLanguage.getRegexPatternString((PatternMatchingIndicator)this.indicator);
  String regexCmp=dbmsLanguage.regexLike(columnName,regexPatternString) + functionReturnValue;
  return getValuesStatement(columnName,regexCmp);
}

Fixed version (ground truth):
/** 
 * get the Valid Values Statement.
 * @return SELECT statement for the valid Value of select column
 */
public String getValidValuesStatement(){
  IndicatorDefinition indicatorDefinition=this.indicator.getIndicatorDefinition();
  if (indicatorDefinition instanceof UDIndicatorDefinition) {
    EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewValidValuesExpression();
    return getQueryAfterReplaced(indicatorDefinition,list);
  }
  String regexPatternString=dbmsLanguage.getRegexPatternString(this.indicator);
  String regexCmp=dbmsLanguage.regexLike(columnName,regexPatternString) + functionReturnValue;
  return getValuesStatement(columnName,regexCmp);
}
Program: 137747
Project: 137747
Buggy source:
/** 
 * DOC zshen Comment method "getValidValuesStatement".
 * @return SELECT statement for the invalid Value of select column
 */
public String getInvalidValuesStatement(){
  IndicatorDefinition indicatorDefinition=this.indicator.getIndicatorDefinition();
  if (indicatorDefinition instanceof UDIndicatorDefinition) {
    EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewInvalidValuesExpression();
    return getReplacedSql(list);
  }
  String regexPatternString=dbmsLanguage.getRegexPatternString((PatternMatchingIndicator)this.indicator);
  String regexCmp=dbmsLanguage.regexNotLike(columnName,regexPatternString) + functionReturnValue;
  String nullClause=dbmsLanguage.or() + columnName + dbmsLanguage.isNull();
  String pattCondStr="String_Node_Str" + regexCmp + nullClause+ "String_Node_Str";
  return getValuesStatement(columnName,pattCondStr);
}

Fixed version (ground truth):
/** 
 * get the Valid Values Statement.
 * @return SELECT statement for the invalid Value of select column
 */
public String getInvalidValuesStatement(){
  IndicatorDefinition indicatorDefinition=this.indicator.getIndicatorDefinition();
  if (indicatorDefinition instanceof UDIndicatorDefinition) {
    EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewInvalidValuesExpression();
    return getQueryAfterReplaced(indicatorDefinition,list);
  }
  String regexPatternString=dbmsLanguage.getRegexPatternString(this.indicator);
  String regexCmp=dbmsLanguage.regexNotLike(columnName,regexPatternString) + functionReturnValue;
  String nullClause=dbmsLanguage.or() + columnName + dbmsLanguage.isNull();
  String pattCondStr="String_Node_Str" + regexCmp + nullClause+ "String_Node_Str";
  return getValuesStatement(columnName,pattCondStr);
}
Program: 137749
Project: 137749
Buggy source:
private boolean prepareIndicators(){
  boolean ok=true;
  for (  Indicator indic : allIndicators) {
    if (!indic.prepare()) {
      if (IndicatorsPackage.eINSTANCE.getRegexpMatchingIndicator().equals(indic.eClass())) {
        javaPatternMessage=((RegexpMatchingIndicatorImpl)indic).getJavaPatternMessage();
      }
      ok=false;
    }
  }
  return ok;
}

Fixed version (ground truth):
private boolean prepareIndicators(){
  boolean ok=true;
  for (  Indicator indic : allIndicators) {
    if (!indic.prepare()) {
      if (IndicatorsPackage.eINSTANCE.getRegexpMatchingIndicator().equals(indic.eClass())) {
        javaPatternMessage=((RegexpMatchingIndicatorImpl)indic).getJavaPatternMessage();
      }
 else       if (UDIHelper.isUDI(indic)) {
        javaPatternMessage="String_Node_Str" + indic.getName();
      }
      ok=false;
    }
  }
  return ok;
}
Program: 137750
Project: 137750
Buggy source:
/** 
 * DOC qiongli Comment method "setUp".
 * @throws java.lang.Exception
 */
@Before public void setUp() throws Exception {
  UnitTestBuildHelper.mockLocalRepositoryObjectCRUD();
  corePlugin=mock(CorePlugin.class);
  PowerMockito.mockStatic(CorePlugin.class);
  when(CorePlugin.getDefault()).thenReturn(corePlugin);
  ResourceBundle rb2=mock(ResourceBundle.class);
  stub(method(ResourceBundle.class,"String_Node_Str",String.class)).toReturn(rb2);
  PowerMockito.mockStatic(Messages.class);
  when(Messages.getString(anyString())).thenReturn("String_Node_Str");
  PowerMockito.mock(DefaultMessagesImpl.class);
  when(DefaultMessagesImpl.getString(anyString())).thenReturn("String_Node_Str").thenReturn("String_Node_Str").thenReturn("String_Node_Str").thenReturn("String_Node_Str");
  dqDeleteAction_real=new DQDeleteAction();
  deleteAction_mock=PowerMockito.spy(dqDeleteAction_real);
  PowerMockito.doReturn(null).when(deleteAction_mock).getActivePage();
  PowerMockito.doNothing().when(deleteAction_mock,"String_Node_Str");
  PowerMockito.mockStatic(CoreRuntimePlugin.class);
  CoreRuntimePlugin coreRuntPlugin=mock(CoreRuntimePlugin.class);
  when(CoreRuntimePlugin.getInstance()).thenReturn(coreRuntPlugin);
  IProxyRepositoryFactory proxFactory=mock(IProxyRepositoryFactory.class);
  when(coreRuntPlugin.getProxyRepositoryFactory()).thenReturn(proxFactory);
}

Fixed version (ground truth):
/** 
 * DOC qiongli Comment method "setUp".
 * @throws java.lang.Exception
 */
@Before public void setUp() throws Exception {
  UnitTestBuildHelper.mockLocalRepositoryObjectCRUD();
  corePlugin=mock(CorePlugin.class);
  PowerMockito.mockStatic(CorePlugin.class);
  when(CorePlugin.getDefault()).thenReturn(corePlugin);
  ResourceBundle rb2=mock(ResourceBundle.class);
  stub(method(ResourceBundle.class,"String_Node_Str",String.class)).toReturn(rb2);
  PowerMockito.mockStatic(Messages.class);
  when(Messages.getString(anyString())).thenReturn("String_Node_Str");
  PowerMockito.mockStatic(DefaultMessagesImpl.class);
  when(DefaultMessagesImpl.getString(anyString())).thenReturn("String_Node_Str").thenReturn("String_Node_Str").thenReturn("String_Node_Str").thenReturn("String_Node_Str");
  dqDeleteAction_real=new DQDeleteAction();
  deleteAction_mock=PowerMockito.spy(dqDeleteAction_real);
  PowerMockito.doReturn(null).when(deleteAction_mock).getActivePage();
  PowerMockito.doNothing().when(deleteAction_mock,"String_Node_Str");
  PowerMockito.mockStatic(CoreRuntimePlugin.class);
  CoreRuntimePlugin coreRuntPlugin=mock(CoreRuntimePlugin.class);
  when(CoreRuntimePlugin.getInstance()).thenReturn(coreRuntPlugin);
  IProxyRepositoryFactory proxFactory=mock(IProxyRepositoryFactory.class);
  when(coreRuntPlugin.getProxyRepositoryFactory()).thenReturn(proxFactory);
}
Program: 137752
Project: 137752
Buggy source:
public boolean isUseMailLoginCheck(){
  return useMainLoginCheck;
}

Fixed version (ground truth):
@Override public boolean isUseMailLoginCheck(){
  return useMainLoginCheck;
}
Program: 137753
Project: 137753
Buggy source:
public String getAdditionalTitle(){
  return title;
}

Fixed version (ground truth):
@Override public String getAdditionalTitle(){
  return title;
}
Program: 137754
Project: 137754
Buggy source:
public void fillMenuBar(IMenuManager menuBar){
  if (helper != null) {
    helper.fillMenuBar(menuBar);
  }
}

Fixed version (ground truth):
@Override public void fillMenuBar(IMenuManager menuBar){
  if (helper != null) {
    helper.fillMenuBar(menuBar);
  }
}
Program: 137755
Project: 137755
Buggy source:
public String[] getAvailableComponents(){
  return null;
}

Fixed version (ground truth):
@Override public String[] getAvailableComponents(){
  return null;
}
Program: 137756
Project: 137756
Buggy source:
public String getInitialWindowPerspectiveId(){
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getInitialWindowPerspectiveId(){
  return "String_Node_Str";
}
Program: 137757
Project: 137757
Buggy source:
public boolean isAllowDebugMode(){
  return true;
}

Fixed version (ground truth):
@Override public boolean isAllowDebugMode(){
  return true;
}