nus-yam/ex-repair huggingface dataset:
Program: 139673
Project: 139673
Buggy source:
private void searchAllAnalysis(IFolder folder) throws CoreException {
  for (  IResource resource : folder.members()) {
    if (resource.getType() == IResource.FOLDER) {
      searchAllAnalysis(folder.getFolder(resource.getName()));
      continue;
    }
    IFile file=(IFile)resource;
    if (file.getFileExtension().equals(FactoriesUtil.ANA)) {
      findAnalysis(file);
    }
  }
}

Fixed version (ground truth):
private void searchAllAnalysis(IFolder folder) throws CoreException {
  for (  IResource resource : folder.members()) {
    if (resource.getType() == IResource.FOLDER) {
      searchAllAnalysis(folder.getFolder(resource.getName()));
      continue;
    }
    IFile file=(IFile)resource;
    if (FactoriesUtil.ANA.equals(file.getFileExtension())) {
      findAnalysis(file);
    }
  }
}
Program: 139674
Project: 139674
Buggy source:
private List<IFile> searchAllDataProvider(IFolder folder,List<IFile> allPRVFiles){
  try {
    for (    IResource resource : folder.members()) {
      if (resource.getType() == IResource.FOLDER) {
        searchAllDataProvider(folder.getFolder(resource.getName()),allPRVFiles);
        continue;
      }
      IFile file=(IFile)resource;
      if (file.getFileExtension().equals(FactoriesUtil.PROV)) {
        allPRVFiles.add(file);
      }
    }
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
  return allPRVFiles;
}

Fixed version (ground truth):
private List<IFile> searchAllDataProvider(IFolder folder,List<IFile> allPRVFiles){
  try {
    for (    IResource resource : folder.members()) {
      if (resource.getType() == IResource.FOLDER) {
        searchAllDataProvider(folder.getFolder(resource.getName()),allPRVFiles);
        continue;
      }
      IFile file=(IFile)resource;
      if (FactoriesUtil.PROV.equals(file.getFileExtension())) {
        allPRVFiles.add(file);
      }
    }
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
  return allPRVFiles;
}
Program: 139675
Project: 139675
Buggy source:
public TdReport findReport(IFile file){
  if (file != null && file.getFileExtension().equals(FactoriesUtil.REP)) {
    TdReport report=allRepMap.get(file);
    if (report != null) {
      return report;
    }
    return readFromFile(file);
  }
  return null;
}

Fixed version (ground truth):
public TdReport findReport(IFile file){
  if (file != null && FactoriesUtil.REP.equals(file.getFileExtension())) {
    TdReport report=allRepMap.get(file);
    if (report != null) {
      return report;
    }
    return readFromFile(file);
  }
  return null;
}
Program: 139676
Project: 139676
Buggy source:
public boolean check(IFile file){
  return file.getFileExtension().equalsIgnoreCase(getFileExtension());
}

Fixed version (ground truth):
public boolean check(IFile file){
  return getFileExtension().equalsIgnoreCase(file.getFileExtension());
}
Program: 139678
Project: 139678
Buggy source:
private static Set<IFile> getNestedPatternFiles(Set<IFile> list,IFolder folder){
  try {
    for (    IResource resource : folder.members()) {
      if (resource instanceof IFile) {
        IFile file=(IFile)resource;
        if (file.getFileExtension().equals(FactoriesUtil.PATTERN)) {
          list.add((IFile)resource);
        }
      }
 else {
        getNestedPatternFiles(list,(IFolder)resource);
      }
    }
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
  return list;
}

Fixed version (ground truth):
private static Set<IFile> getNestedPatternFiles(Set<IFile> list,IFolder folder){
  try {
    for (    IResource resource : folder.members()) {
      if (resource instanceof IFile) {
        IFile file=(IFile)resource;
        if (FactoriesUtil.PATTERN.equals(file.getFileExtension())) {
          list.add((IFile)resource);
        }
      }
 else {
        getNestedPatternFiles(list,(IFolder)resource);
      }
    }
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
  return list;
}
Program: 139679
Project: 139679
Buggy source:
private ModelElement getOldEObject(IFile file){
  ModelElement object=null;
  if (file.getFileExtension().equals(FactoriesUtil.ANA)) {
    object=AnaResourceFileHelper.getInstance().findAnalysis(file);
  }
  if (file.getFileExtension().equals(FactoriesUtil.PATTERN)) {
    object=PatternResourceFileHelper.getInstance().findPattern(file);
  }
  if (file.getFileExtension().equals(FactoriesUtil.REP)) {
    object=RepResourceFileHelper.getInstance().findReport(file);
  }
  if (file.getFileExtension().equals(FactoriesUtil.DQRULE)) {
    object=DQRuleResourceFileHelper.getInstance().findWhereRule(file);
  }
  if (file.getFileExtension().equals(FactoriesUtil.UDI)) {
    object=UDIResourceFileHelper.getInstance().findUDI(file);
  }
  return object;
}

Fixed version (ground truth):
private ModelElement getOldEObject(IFile file){
  ModelElement object=null;
  if (FactoriesUtil.ANA.equals(file.getFileExtension())) {
    object=AnaResourceFileHelper.getInstance().findAnalysis(file);
  }
  if (FactoriesUtil.PATTERN.equals(file.getFileExtension())) {
    object=PatternResourceFileHelper.getInstance().findPattern(file);
  }
  if (FactoriesUtil.REP.equals(file.getFileExtension())) {
    object=RepResourceFileHelper.getInstance().findReport(file);
  }
  if (FactoriesUtil.DQRULE.equals(file.getFileExtension())) {
    object=DQRuleResourceFileHelper.getInstance().findWhereRule(file);
  }
  if (FactoriesUtil.UDI.equals(file.getFileExtension())) {
    object=UDIResourceFileHelper.getInstance().findUDI(file);
  }
  return object;
}
Program: 139680
Project: 139680
Buggy source:
/** 
 * DOC xqliu Comment method "computeSelectedFiles".
 * @param treeSelection
 * @param selectedFiles
 * @return
 */
public static boolean computeSelectedFiles(TreeSelection treeSelection,List<IFile> selectedFiles){
  boolean isSelectFile=false;
  Iterator iterator=treeSelection.iterator();
  while (iterator.hasNext()) {
    Object obj=iterator.next();
    if (obj instanceof IFile) {
      IFile file=(IFile)obj;
      if (file.getFileExtension().equalsIgnoreCase(EXTENSION_DQRULE)) {
        selectedFiles.add(file);
      }
    }
 else {
      isSelectFile=true;
      break;
    }
  }
  return isSelectFile;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "computeSelectedFiles".
 * @param treeSelection
 * @param selectedFiles
 * @return
 */
public static boolean computeSelectedFiles(TreeSelection treeSelection,List<IFile> selectedFiles){
  boolean isSelectFile=false;
  Iterator iterator=treeSelection.iterator();
  while (iterator.hasNext()) {
    Object obj=iterator.next();
    if (obj instanceof IFile) {
      IFile file=(IFile)obj;
      if (EXTENSION_DQRULE.equalsIgnoreCase(file.getFileExtension())) {
        selectedFiles.add(file);
      }
    }
 else {
      isSelectFile=true;
      break;
    }
  }
  return isSelectFile;
}
Program: 139681
Project: 139681
Buggy source:
/** 
 * DOC qzhang Comment method "computeSelectedFiles".
 * @param treeSelection
 * @param selectedFiles
 * @return
 */
public static boolean computeSelectedFiles(TreeSelection treeSelection,List<IFile> selectedFiles){
  boolean isSelectFile=false;
  Iterator iterator=treeSelection.iterator();
  while (iterator.hasNext()) {
    Object obj=iterator.next();
    if (obj instanceof IFile) {
      IFile file=(IFile)obj;
      if (file.getFileExtension().equalsIgnoreCase("String_Node_Str")) {
        selectedFiles.add(file);
      }
    }
 else {
      isSelectFile=true;
      break;
    }
  }
  return isSelectFile;
}

Fixed version (ground truth):
/** 
 * DOC qzhang Comment method "computeSelectedFiles".
 * @param treeSelection
 * @param selectedFiles
 * @return
 */
public static boolean computeSelectedFiles(TreeSelection treeSelection,List<IFile> selectedFiles){
  boolean isSelectFile=false;
  Iterator iterator=treeSelection.iterator();
  while (iterator.hasNext()) {
    Object obj=iterator.next();
    if (obj instanceof IFile) {
      IFile file=(IFile)obj;
      if ("String_Node_Str".equalsIgnoreCase(file.getFileExtension())) {
        selectedFiles.add(file);
      }
    }
 else {
      isSelectFile=true;
      break;
    }
  }
  return isSelectFile;
}
Program: 139682
Project: 139682
Buggy source:
public void fillContextMenu(IMenuManager menu){
  TreeSelection treeSelection=((TreeSelection)this.getContext().getSelection());
  List<IFile> selectedFiles=new ArrayList<IFile>();
  if (treeSelection.size() == 1) {
    Object obj=treeSelection.getFirstElement();
    if (obj instanceof IFolder) {
      IPath fullPath=((IFolder)obj).getFullPath();
      IPath sourceFileFolderPath=ResourceManager.getLibrariesFolder().getFolder(DQStructureManager.SOURCE_FILES).getFullPath();
      if (fullPath.equals(sourceFileFolderPath)) {
        menu.add(new AddSqlFileAction((IFolder)obj));
        if (fullPath.segmentCount() > sourceFileFolderPath.segmentCount()) {
          menu.add(new RenameFolderAction((IFolder)obj));
        }
      }
    }
 else     if (obj instanceof IFile) {
      IFile file=(IFile)obj;
      if (file.getFileExtension().equalsIgnoreCase("String_Node_Str")) {
        menu.add(new RenameSqlFileAction((IFile)obj));
      }
    }
  }
  boolean isSelectFile=computeSelectedFiles(treeSelection,selectedFiles);
  if (!isSelectFile && !selectedFiles.isEmpty()) {
    menu.add(new OpenSqlFileAction(selectedFiles));
    menu.add(new DeleteSqlFileAction(selectedFiles));
  }
}

Fixed version (ground truth):
public void fillContextMenu(IMenuManager menu){
  TreeSelection treeSelection=((TreeSelection)this.getContext().getSelection());
  List<IFile> selectedFiles=new ArrayList<IFile>();
  if (treeSelection.size() == 1) {
    Object obj=treeSelection.getFirstElement();
    if (obj instanceof IFolder) {
      IPath fullPath=((IFolder)obj).getFullPath();
      IPath sourceFileFolderPath=ResourceManager.getLibrariesFolder().getFolder(DQStructureManager.SOURCE_FILES).getFullPath();
      if (fullPath.equals(sourceFileFolderPath)) {
        menu.add(new AddSqlFileAction((IFolder)obj));
        if (fullPath.segmentCount() > sourceFileFolderPath.segmentCount()) {
          menu.add(new RenameFolderAction((IFolder)obj));
        }
      }
    }
 else     if (obj instanceof IFile) {
      IFile file=(IFile)obj;
      if ("String_Node_Str".equalsIgnoreCase(file.getFileExtension())) {
        menu.add(new RenameSqlFileAction((IFile)obj));
      }
    }
  }
  boolean isSelectFile=computeSelectedFiles(treeSelection,selectedFiles);
  if (!isSelectFile && !selectedFiles.isEmpty()) {
    menu.add(new OpenSqlFileAction(selectedFiles));
    menu.add(new DeleteSqlFileAction(selectedFiles));
  }
}
Program: 139683
Project: 139683
Buggy source:
/** 
 * DOC qzhang Comment method "computeSelectedFiles".
 * @param treeSelection
 * @param selectedFiles
 * @return
 */
public static boolean computeSelectedFiles(TreeSelection treeSelection,List<IFile> selectedFiles){
  boolean isSelectFile=false;
  Iterator iterator=treeSelection.iterator();
  while (iterator.hasNext()) {
    Object obj=iterator.next();
    if (obj instanceof IFile) {
      IFile file=(IFile)obj;
      if (file.getFileExtension().equalsIgnoreCase(EXTENSION_PATTERN)) {
        selectedFiles.add(file);
      }
    }
 else {
      isSelectFile=true;
      break;
    }
  }
  return isSelectFile;
}

Fixed version (ground truth):
/** 
 * DOC qzhang Comment method "computeSelectedFiles".
 * @param treeSelection
 * @param selectedFiles
 * @return
 */
public static boolean computeSelectedFiles(TreeSelection treeSelection,List<IFile> selectedFiles){
}
Program: 139684
Project: 139684
Buggy source:
public void fillContextMenu(IMenuManager menu){
  TreeSelection treeSelection=((TreeSelection)this.getContext().getSelection());
  List<IFile> selectedFiles=new ArrayList<IFile>();
  if (treeSelection.size() == 1) {
    Object obj=treeSelection.getFirstElement();
    if (obj instanceof IFolder) {
      try {
        IFolder folder=(IFolder)obj;
        ExpressionType type=null;
        String persistentProperty=folder.getPersistentProperty(DQStructureManager.FOLDER_CLASSIFY_KEY);
        if (DQStructureManager.PATTERNS_FOLDER_PROPERTY.equals(persistentProperty)) {
          type=ExpressionType.REGEXP;
        }
 else         if (DQStructureManager.SQLPATTERNS_FOLDER_PROPERTY.equals(persistentProperty)) {
          type=ExpressionType.SQL_LIKE;
        }
        if (type != null) {
          menu.add(new ImportPatternsAction((IFolder)obj,type));
          menu.add(new ExportPatternsAction((IFolder)obj,false));
          menu.add(new ExportPatternsAction((IFolder)obj,true));
          menu.add(new CreatePatternAction((IFolder)obj,type));
        }
      }
 catch (      Exception e) {
        log.error(e,e);
      }
    }
 else     if (obj instanceof IFile) {
      IFile file=(IFile)obj;
      if (file.getFileExtension().equalsIgnoreCase(EXTENSION_PATTERN)) {
      }
    }
  }
  boolean isSelectFile=computeSelectedFiles(treeSelection,selectedFiles);
  if (!isSelectFile && !selectedFiles.isEmpty()) {
  }
}

Fixed version (ground truth):
public void fillContextMenu(IMenuManager menu){
  TreeSelection treeSelection=((TreeSelection)this.getContext().getSelection());
  List<IFile> selectedFiles=new ArrayList<IFile>();
  if (treeSelection.size() == 1) {
    Object obj=treeSelection.getFirstElement();
    if (obj instanceof IFolder) {
      try {
        IFolder folder=(IFolder)obj;
        ExpressionType type=null;
        String persistentProperty=folder.getPersistentProperty(DQStructureManager.FOLDER_CLASSIFY_KEY);
        if (DQStructureManager.PATTERNS_FOLDER_PROPERTY.equals(persistentProperty)) {
          type=ExpressionType.REGEXP;
        }
 else         if (DQStructureManager.SQLPATTERNS_FOLDER_PROPERTY.equals(persistentProperty)) {
          type=ExpressionType.SQL_LIKE;
        }
        if (type != null) {
          menu.add(new ImportPatternsAction((IFolder)obj,type));
          menu.add(new ExportPatternsAction((IFolder)obj,false));
          menu.add(new ExportPatternsAction((IFolder)obj,true));
          menu.add(new CreatePatternAction((IFolder)obj,type));
        }
      }
 catch (      Exception e) {
        log.error(e,e);
      }
    }
 else     if (obj instanceof IFile) {
      IFile file=(IFile)obj;
      if (EXTENSION_PATTERN.equalsIgnoreCase(file.getFileExtension())) {
      }
    }
  }
  boolean isSelectFile=computeSelectedFiles(treeSelection,selectedFiles);
  if (!isSelectFile && !selectedFiles.isEmpty()) {
  }
}
Program: 139685
Project: 139685
Buggy source:
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (parentElement instanceof TreePath) {
    TreePath path=(TreePath)parentElement;
    if (path.getLastSegment() instanceof AnaElementFolderNode) {
      return true;
    }
  }
 else   if (parentElement instanceof IFolder) {
    IFolder folder=(IFolder)parentElement;
    if ("String_Node_Str".equals(folder.getName())) {
      return false;
    }
  }
  if (element instanceof EObject) {
    EObject eObj=(EObject)element;
    if (SwitchHelpers.TDDATAPROVIDER_SWITCH.doSwitch(eObj) != null || dependencySwitch.doSwitch(eObj) != null) {
      return false;
    }
  }
 else   if (element instanceof IFile) {
    IFile file=(IFile)element;
    if (file.getName().indexOf("String_Node_Str") == 0) {
      return false;
    }
    if (file.getFileExtension().equals(FactoriesUtil.ITEM_EXTENSION) || file.getFileExtension().equals(FactoriesUtil.PROPERTIES_EXTENSION)) {
      return false;
    }
    return file.getFileExtension() != null;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (parentElement instanceof TreePath) {
    TreePath path=(TreePath)parentElement;
    if (path.getLastSegment() instanceof AnaElementFolderNode) {
      return true;
    }
  }
 else   if (parentElement instanceof IFolder) {
    IFolder folder=(IFolder)parentElement;
    if ("String_Node_Str".equals(folder.getName())) {
      return false;
    }
  }
  if (element instanceof EObject) {
    EObject eObj=(EObject)element;
    if (SwitchHelpers.TDDATAPROVIDER_SWITCH.doSwitch(eObj) != null || dependencySwitch.doSwitch(eObj) != null) {
      return false;
    }
  }
 else   if (element instanceof IFile) {
    IFile file=(IFile)element;
    if (file.getName().indexOf("String_Node_Str") == 0) {
      return false;
    }
    if (FactoriesUtil.ITEM_EXTENSION.equals(file.getFileExtension()) || FactoriesUtil.PROPERTIES_EXTENSION.equals(file.getFileExtension())) {
      return false;
    }
    return file.getFileExtension() != null;
  }
  return true;
}
Program: 139687
Project: 139687
Buggy source:
@Override public IStatus validateDrop(Object target,int operation,TransferData transferType){
  if (!(target instanceof IResource)) {
    return Status.CANCEL_STATUS;
  }
  IResource targetRes=(IResource)target;
  for (  IResource res : getSelectedResources()) {
    if (res.getType() == IResource.FILE) {
      if ((targetRes.getType() == IResource.FOLDER)) {
        IFolder targetFolder=(IFolder)targetRes;
        IFolder sourceFolder=(IFolder)res.getParent();
        try {
          if (sourceFolder.getPersistentProperty(DQStructureManager.FOLDER_CLASSIFY_KEY).equals(targetFolder.getPersistentProperty(DQStructureManager.FOLDER_CLASSIFY_KEY))) {
            return Status.OK_STATUS;
          }
        }
 catch (        CoreException e) {
          log.error(e,e);
        }
      }
 else       if (res.getName().endsWith(org.talend.dq.PluginConstant.ANA_SUFFIX) && (targetRes.getType() == IResource.FILE)) {
        IFile tfile=(IFile)targetRes;
        if (tfile.getFileExtension().equals(FactoriesUtil.REP)) {
          return Status.OK_STATUS;
        }
      }
    }
  }
  return Status.CANCEL_STATUS;
}

Fixed version (ground truth):
@Override public IStatus validateDrop(Object target,int operation,TransferData transferType){
  if (!(target instanceof IResource)) {
    return Status.CANCEL_STATUS;
  }
  IResource targetRes=(IResource)target;
  for (  IResource res : getSelectedResources()) {
    if (res.getType() == IResource.FILE) {
      if ((targetRes.getType() == IResource.FOLDER)) {
        IFolder targetFolder=(IFolder)targetRes;
        IFolder sourceFolder=(IFolder)res.getParent();
        try {
          if (sourceFolder.getPersistentProperty(DQStructureManager.FOLDER_CLASSIFY_KEY).equals(targetFolder.getPersistentProperty(DQStructureManager.FOLDER_CLASSIFY_KEY))) {
            return Status.OK_STATUS;
          }
        }
 catch (        CoreException e) {
          log.error(e,e);
        }
      }
 else       if (res.getName().endsWith(org.talend.dq.PluginConstant.ANA_SUFFIX) && (targetRes.getType() == IResource.FILE)) {
        IFile tfile=(IFile)targetRes;
        if (FactoriesUtil.REP.equals(tfile.getFileExtension())) {
          return Status.OK_STATUS;
        }
      }
    }
  }
  return Status.CANCEL_STATUS;
}
Program: 139689
Project: 139689
Buggy source:
/** 
 * DOC qzhang Comment method "computeSelectedFiles".
 * @param treeSelection
 * @param selectedFiles
 * @return
 */
public static boolean computeSelectedFiles(TreeSelection treeSelection,List<IFile> selectedFiles){
}

Fixed version (ground truth):
/** 
 * DOC qzhang Comment method "computeSelectedFiles".
 * @param treeSelection
 * @param selectedFiles
 * @return
 */
public static boolean computeSelectedFiles(TreeSelection treeSelection,List<IFile> selectedFiles){
  boolean isSelectFile=false;
  Iterator iterator=treeSelection.iterator();
  while (iterator.hasNext()) {
    Object obj=iterator.next();
    if (obj instanceof IFile) {
      IFile file=(IFile)obj;
      if (EXTENSION_PATTERN.equalsIgnoreCase(file.getFileExtension())) {
        selectedFiles.add(file);
      }
    }
 else {
      isSelectFile=true;
      break;
    }
  }
  return isSelectFile;
}
Program: 139690
Project: 139690
Buggy source:
/** 
 * DOC jet according to current analysis generator chart dataset "initDataset".
 * @return
 */
private DefaultCategoryDataset initDataset(){
  DefaultCategoryDataset dataset=new DefaultCategoryDataset();
  Analysis analysis=this.getAnalysisHandler().getAnalysis();
  for (Iterator iterator=analysis.getResults().getIndicators().iterator(); iterator.hasNext(); ) {
    ColumnDependencyIndicator indicator=(ColumnDependencyIndicator)iterator.next();
    String label=getRowLabel(indicator);
    if (getAnalysisHandler().getResultMetadata().getExecutionNumber() > 0) {
      dataset.addValue(indicator.getACount() - indicator.getDistinctACount(),"String_Node_Str",label);
      dataset.addValue(indicator.getDistinctACount(),"String_Node_Str",label);
    }
  }
  return dataset;
}

Fixed version (ground truth):
/** 
 * DOC jet according to current analysis generator chart dataset "initDataset".
 * @return
 */
private DefaultCategoryDataset initDataset(){
  DefaultCategoryDataset dataset=new DefaultCategoryDataset();
  Analysis analysis=this.getAnalysisHandler().getAnalysis();
  for (Iterator iterator=analysis.getResults().getIndicators().iterator(); iterator.hasNext(); ) {
    ColumnDependencyIndicator indicator=(ColumnDependencyIndicator)iterator.next();
    String label=getRowLabel(indicator);
    if (getAnalysisHandler().getResultMetadata().getExecutionNumber() > 0) {
      dataset.addValue(indicator.getDistinctACount(),"String_Node_Str",label);
      dataset.addValue(indicator.getACount() - indicator.getDistinctACount(),"String_Node_Str",label);
    }
  }
  return dataset;
}
Program: 139691
Project: 139691
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated not
 */
public Double getDependencyFactor(){
  if (getACount() != null && getDistinctACount() != null) {
    return getDistinctACount().doubleValue() / getACount().doubleValue();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated not
 */
public Double getDependencyFactor(){
  if (getACount() != null && getDistinctACount() != null) {
    return (getACount() == 0L) ? Double.NaN : getDistinctACount().doubleValue() / getACount().doubleValue();
  }
  return null;
}
Program: 139692
Project: 139692
Buggy source:
public AbstractChartTypeStates(List<IndicatorUnit> units){
  Iterator<IndicatorUnit> it=units.iterator();
  while (it.hasNext()) {
    IndicatorUnit unit=it.next();
    if (!unit.isExcuted() && unit.getType() != IndicatorEnum.RangeIndicatorEnum && unit.getType() != IndicatorEnum.IQRIndicatorEnum) {
      it.remove();
    }
 else {
      IndicatorCommonUtil.getIndicatorValue(unit);
    }
  }
  if (units != null) {
    this.units.addAll(units);
  }
}

Fixed version (ground truth):
public AbstractChartTypeStates(List<IndicatorUnit> units){
  if (units != null) {
    this.units.addAll(check(units));
  }
}
Program: 139693
Project: 139693
Buggy source:
@Override protected boolean preDo(){
  List<TdColumn> tempList=new ArrayList<TdColumn>();
  for (  TdColumn column : getColumns()) {
    if (!Java2SqlType.isTextInSQL(column.getJavaType())) {
      tempList.add(column);
    }
  }
  if (!tempList.isEmpty()) {
    ElementListSelectionDialog dialog=new ElementListSelectionDialog(null,new DQRepositoryViewLabelProvider());
    dialog.setElements(tempList.toArray());
    dialog.setTitle(DefaultMessagesImpl.getString("String_Node_Str"));
    dialog.setMessage(DefaultMessagesImpl.getString("String_Node_Str"));
    dialog.setSize(80,20);
    dialog.create();
    if (Window.OK == dialog.open()) {
      for (      TdColumn column : tempList) {
        MetadataHelper.setDataminingType(DataminingType.NOMINAL,column);
      }
      return true;
    }
 else {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean preDo(){
  List<TdColumn> tempList=new ArrayList<TdColumn>();
  for (  TdColumn column : getColumns()) {
    if (ColumnHelper.isPrimaryKey(column) || ColumnHelper.isForeignKey(column)) {
      continue;
    }
    if (!Java2SqlType.isTextInSQL(column.getJavaType())) {
      tempList.add(column);
    }
  }
  if (!tempList.isEmpty()) {
    ElementListSelectionDialog dialog=new ElementListSelectionDialog(null,new DQRepositoryViewLabelProvider());
    dialog.setElements(tempList.toArray());
    dialog.setTitle(DefaultMessagesImpl.getString("String_Node_Str"));
    dialog.setMessage(DefaultMessagesImpl.getString("String_Node_Str"));
    dialog.setSize(80,20);
    dialog.create();
    if (Window.OK == dialog.open()) {
      for (      TdColumn column : tempList) {
        MetadataHelper.setDataminingType(DataminingType.NOMINAL,column);
      }
      return true;
    }
 else {
      return false;
    }
  }
  return true;
}
Program: 139694
Project: 139694
Buggy source:
/** 
 * Method "getDataminingType" gets the type of the content of a column.
 * @param column
 * @return the DataminingType or null if none has been set.
 */
public static DataminingType getDataminingType(TdColumn column){
  return DataminingType.get(column.getContentType());
}

Fixed version (ground truth):
/** 
 * Method "getDataminingType" gets the type of the content of a column.
 * @param column
 * @return the DataminingType or null if none has been set.
 */
public static DataminingType getDataminingType(TdColumn column){
  if (ColumnHelper.isPrimaryKey(column) || ColumnHelper.isForeignKey(column)) {
    return DataminingType.NOMINAL;
  }
  return DataminingType.get(column.getContentType());
}
Program: 139696
Project: 139696
Buggy source:
/** 
 * DOC xqliu Comment method "removeDependency".
 * @param analysis
 * @param unit
 */
protected void removeDependency(Analysis analysis,IndicatorUnit unit){
  List<ModelElement> reomveElements=new ArrayList<ModelElement>();
  Indicator indicator=unit.getIndicator();
  if (indicator instanceof UserDefIndicator) {
    reomveElements.add(indicator.getIndicatorDefinition());
    if (IndicatorCategoryHelper.isMatching(UDIHelper.getUDICategory(indicator))) {
      reomveElements.addAll(indicator.getParameters().getDataValidDomain().getPatterns());
    }
  }
 else   if (indicator instanceof PatternMatchingIndicator) {
    reomveElements.addAll(indicator.getParameters().getDataValidDomain().getPatterns());
  }
  DependenciesHandler.getInstance().removeDependenciesBetweenModels(analysis,reomveElements);
  for (  ModelElement me : reomveElements) {
    EMFUtil.saveSingleResource(me.eResource());
  }
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "removeDependency".
 * @param analysis
 * @param unit
 */
protected void removeDependency(Analysis analysis,IndicatorUnit unit){
  List<ModelElement> reomveElements=new ArrayList<ModelElement>();
  Indicator indicator=unit.getIndicator();
  if (indicator instanceof UserDefIndicator) {
    reomveElements.add(indicator.getIndicatorDefinition());
    if (IndicatorCategoryHelper.isUserDefMatching(UDIHelper.getUDICategory(indicator))) {
      reomveElements.addAll(indicator.getParameters().getDataValidDomain().getPatterns());
    }
  }
 else   if (indicator instanceof PatternMatchingIndicator) {
    reomveElements.addAll(indicator.getParameters().getDataValidDomain().getPatterns());
  }
  DependenciesHandler.getInstance().removeDependenciesBetweenModels(analysis,reomveElements);
  for (  ModelElement me : reomveElements) {
    EMFUtil.saveSingleResource(me.eResource());
  }
}
Program: 139697
Project: 139697
Buggy source:
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (parentElement instanceof TreePath) {
    TreePath path=(TreePath)parentElement;
    if (path.getLastSegment() instanceof AnaElementFolderNode) {
      return true;
    }
  }
  if (element instanceof EObject) {
    EObject eObj=(EObject)element;
    if (SwitchHelpers.TDDATAPROVIDER_SWITCH.doSwitch(eObj) != null || dependencySwitch.doSwitch(eObj) != null) {
      return false;
    }
  }
 else   if (element instanceof IFile) {
    IFile file=(IFile)element;
    if (file.getName().indexOf("String_Node_Str") == 0) {
      return false;
    }
    if (file.getFileExtension().equals(FactoriesUtil.ITEM_EXTENSION) || file.getFileExtension().equals(FactoriesUtil.PROPERTIES_EXTENSION)) {
      return false;
    }
    return file.getFileExtension() != null;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean select(Viewer viewer,Object parentElement,Object element){
  if (parentElement instanceof TreePath) {
    TreePath path=(TreePath)parentElement;
    if (path.getLastSegment() instanceof AnaElementFolderNode) {
      return true;
    }
  }
 else   if (parentElement instanceof IFolder) {
    IFolder folder=(IFolder)parentElement;
    if ("String_Node_Str".equals(folder.getName())) {
      return false;
    }
  }
  if (element instanceof EObject) {
    EObject eObj=(EObject)element;
    if (SwitchHelpers.TDDATAPROVIDER_SWITCH.doSwitch(eObj) != null || dependencySwitch.doSwitch(eObj) != null) {
      return false;
    }
  }
 else   if (element instanceof IFile) {
    IFile file=(IFile)element;
    if (file.getName().indexOf("String_Node_Str") == 0) {
      return false;
    }
    if (file.getFileExtension().equals(FactoriesUtil.ITEM_EXTENSION) || file.getFileExtension().equals(FactoriesUtil.PROPERTIES_EXTENSION)) {
      return false;
    }
    return file.getFileExtension() != null;
  }
  return true;
}
Program: 139698
Project: 139698
Buggy source:
/** 
 * DOC zqin ExportPatternsAction constructor comment.
 */
public ExportPatternsAction(IFolder folder,boolean isForExchange){
  if (isForExchange) {
    setText("String_Node_Str");
  }
 else {
    setText(DefaultMessagesImpl.getString("String_Node_Str"));
  }
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.PATTERN_REG));
  this.folder=folder;
  this.isForExchange=isForExchange;
}

Fixed version (ground truth):
/** 
 * DOC zqin ExportPatternsAction constructor comment.
 */
public ExportPatternsAction(IFolder folder,boolean isForExchange){
  if (isForExchange) {
    setText("String_Node_Str");
  }
 else {
    setText(DefaultMessagesImpl.getString("String_Node_Str"));
  }
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.EXPORT));
  this.folder=folder;
  this.isForExchange=isForExchange;
}
Program: 139699
Project: 139699
Buggy source:
/** 
 * DOC qzhang ImportPatternsAction constructor comment.
 */
public ImportPatternsAction(IFolder folder,ExpressionType type){
  setText(DefaultMessagesImpl.getString("String_Node_Str"));
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.PATTERN_REG));
  this.folder=folder;
  this.type=type;
}

Fixed version (ground truth):
/** 
 * DOC qzhang ImportPatternsAction constructor comment.
 */
public ImportPatternsAction(IFolder folder,ExpressionType type){
  setText(DefaultMessagesImpl.getString("String_Node_Str"));
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.IMPORT));
  this.folder=folder;
  this.type=type;
}
Program: 139700
Project: 139700
Buggy source:
public ExportIndicatorDefinitionAction(){
  super("String_Node_Str");
  setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
}

Fixed version (ground truth):
public ExportIndicatorDefinitionAction(){
  super("String_Node_Str");
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.EXPORT));
}
Program: 139701
Project: 139701
Buggy source:
public ExportUDIAction(IFolder folder,boolean isForExchange){
  if (isForExchange) {
    setText("String_Node_Str");
  }
 else {
    setText(DefaultMessagesImpl.getString("String_Node_Str"));
  }
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.IND_DEFINITION));
  this.folder=folder;
  this.isForExchange=isForExchange;
}

Fixed version (ground truth):
public ExportUDIAction(IFolder folder,boolean isForExchange){
  if (isForExchange) {
    setText("String_Node_Str");
  }
 else {
    setText(DefaultMessagesImpl.getString("String_Node_Str"));
  }
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.EXPORT));
  this.folder=folder;
  this.isForExchange=isForExchange;
}
Program: 139702
Project: 139702
Buggy source:
public ImportIndicatorDefinitionAction(){
  super("String_Node_Str");
  setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
}

Fixed version (ground truth):
public ImportIndicatorDefinitionAction(){
  super("String_Node_Str");
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.IMPORT));
}
Program: 139703
Project: 139703
Buggy source:
public ImportRemotePatternAction(IEcosComponent[] components){
  super("String_Node_Str");
  setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
  this.components=components;
}

Fixed version (ground truth):
public ImportRemotePatternAction(IEcosComponent[] components){
  super("String_Node_Str");
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.IMPORT));
  this.components=components;
}
Program: 139704
Project: 139704
Buggy source:
public ImportUDIAction(IFolder folder){
  setText(DefaultMessagesImpl.getString("String_Node_Str"));
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.IND_DEFINITION));
  this.folder=folder;
}

Fixed version (ground truth):
public ImportUDIAction(IFolder folder){
  setText(DefaultMessagesImpl.getString("String_Node_Str"));
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.IMPORT));
  this.folder=folder;
}
Program: 139705
Project: 139705
Buggy source:
@Override public boolean performOk(){
  boolean ok=super.performOk();
  getPreferenceStore().setValue(header.getText(),execCombo.getText());
  return ok;
}

Fixed version (ground truth):
@Override public boolean performOk(){
  boolean ok=super.performOk();
  saveLanguageType();
  getPreferenceStore().setValue(header.getText(),execCombo.getText());
  return ok;
}
Program: 139709
Project: 139709
Buggy source:
@Override public boolean performFinish(){
  File file=new File(page.getSourceFile());
  ImportFactory.importToStucture(file,folder,type,page.getSkip(),page.getRename());
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  File file=new File(page.getSourceFile());
  final StringBuffer information=new StringBuffer();
  information.append(ImportFactory.importToStucture(file,folder,type,page.getSkip(),page.getRename()));
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      ImportInfoDialog.openImportInformation(null,information);
    }
  }
);
  return true;
}
Program: 139710
Project: 139710
Buggy source:
private void updateUI(IJobChangeEvent event){
  final StringBuffer information=new StringBuffer();
  setEnabled(true);
  if (fExtensionDownloaded > 0) {
    for (    IEcosComponent componet : fInstalledComponents) {
      File file=new File(componet.getInstalledLocation());
      List<File> files=new ArrayList<File>();
      extractFiles(file,files);
      ExpressionType type=ExpressionType.REGEXP;
      if ("String_Node_Str".equals(componet.getCategry().getName())) {
        type=ExpressionType.REGEXP;
      }
 else       if ("String_Node_Str".equals(componet.getCategry().getName())) {
        type=ExpressionType.REGEXP;
      }
 else       if ("String_Node_Str".equals(componet.getCategry().getName())) {
        type=ExpressionType.SQL_LIKE;
      }
      for (      File oneFile : files) {
        information.append(ImportFactory.importToStucture(oneFile,getFolder(DQStructureManager.PATTERNS),type,true,true));
        information.append("String_Node_Str");
      }
    }
    Display.getDefault().asyncExec(new Runnable(){
      public void run(){
        MessageDialog.openInformation(null,"String_Node_Str",information.toString());
      }
    }
);
    CorePlugin.getDefault().refreshDQView();
  }
}

Fixed version (ground truth):
private void updateUI(IJobChangeEvent event){
  final StringBuffer information=new StringBuffer();
  setEnabled(true);
  if (fExtensionDownloaded > 0) {
    for (    IEcosComponent componet : fInstalledComponents) {
      File file=new File(componet.getInstalledLocation());
      List<File> files=new ArrayList<File>();
      extractFiles(file,files);
      ExpressionType type=ExpressionType.REGEXP;
      IFolder folder=getFolder(DQStructureManager.PATTERNS);
      if ("String_Node_Str".equals(componet.getCategry().getName())) {
        type=ExpressionType.REGEXP;
        folder=getFolder(DQStructureManager.PATTERNS).getFolder(DQStructureManager.REGEX);
      }
 else       if ("String_Node_Str".equals(componet.getCategry().getName())) {
        type=ExpressionType.REGEXP;
        folder=getFolder(DQStructureManager.PATTERNS).getFolder(DQStructureManager.REGEX);
      }
 else       if ("String_Node_Str".equals(componet.getCategry().getName())) {
        type=ExpressionType.SQL_LIKE;
        folder=getFolder(DQStructureManager.PATTERNS).getFolder(DQStructureManager.SQL);
      }
      for (      File oneFile : files) {
        information.append(ImportFactory.importToStucture(oneFile,folder,type,true,true));
        information.append("String_Node_Str");
      }
    }
    Display.getDefault().asyncExec(new Runnable(){
      public void run(){
        ImportInfoDialog.openImportInformation(null,information);
      }
    }
);
    CorePlugin.getDefault().refreshDQView();
  }
}
Program: 139712
Project: 139712
Buggy source:
private String getTableName(ModelElement colA){
  TdColumn columnA=colA != null ? SwitchHelpers.COLUMN_SWITCH.doSwitch(colA) : null;
  return (columnA != null) ? ColumnHelper.getColumnSetFullName(columnA) : null;
}

Fixed version (ground truth):
private String getTableName(ModelElement col){
  TdColumn column=col != null ? SwitchHelpers.COLUMN_SWITCH.doSwitch(col) : null;
  return (column != null) ? ColumnHelper.getColumnSetFullName(column) : null;
}
Program: 139714
Project: 139714
Buggy source:
private String getColumnName(ModelElement colA){
  TdColumn columnA=colA != null ? SwitchHelpers.COLUMN_SWITCH.doSwitch(colA) : null;
  return columnA != null ? columnA.getName() : null;
}

Fixed version (ground truth):
private String getColumnName(ModelElement col){
  TdColumn column=col != null ? SwitchHelpers.COLUMN_SWITCH.doSwitch(col) : null;
  return column != null ? column.getName() : null;
}
Program: 139716
Project: 139716
Buggy source:
/** 
 * DOC scorreia Comment method "getCompletedString".
 * @param indicator
 * @param sqlExpression
 * @param colName
 * @param table
 * @param whereExpression
 * @throws AnalysisExecutionException
 */
private String getCompletedStringForQuantiles(Indicator indicator,Expression sqlExpression,String colName,String table,List<String> whereExpression) throws AnalysisExecutionException {
  String catalogOrSchema=getCatalogOrSchemaName(indicator.getAnalyzedElement());
  long count=getCount(cachedAnalysis,colName,table,catalogOrSchema,whereExpression);
  if (count == -1) {
    throw new AnalysisExecutionException(Messages.getString("String_Node_Str",dbms().toQualifiedName(catalogOrSchema,null,colName)));
  }
  if (count == 0) {
    this.errorMessage=Messages.getString("String_Node_Str",dbms().toQualifiedName(catalogOrSchema,null,colName));
    throw new AnalysisExecutionException(errorMessage);
  }
  Long midleCount=getOffsetInLimit(indicator,count);
  Integer nbRow=getNbReturnedRows(indicator,count);
  long nPlusSkip=midleCount + nbRow;
  return dbms().fillGenericQueryWithColumnTableLimitOffset(sqlExpression.getBody(),colName,table,String.valueOf(nbRow),String.valueOf(midleCount),String.valueOf(nPlusSkip));
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "getCompletedString".
 * @param indicator
 * @param sqlExpression
 * @param colName
 * @param table
 * @param whereExpression
 * @throws AnalysisExecutionException
 */
private String getCompletedStringForQuantiles(Indicator indicator,Expression sqlExpression,String colName,String table,List<String> whereExpression) throws AnalysisExecutionException {
  String catalogOrSchema=getCatalogOrSchemaName(indicator.getAnalyzedElement());
  long count=getCount(cachedAnalysis,colName,table,catalogOrSchema,whereExpression);
  if (count == -1) {
    this.errorMessage=Messages.getString("String_Node_Str",dbms().toQualifiedName(catalogOrSchema,null,colName));
    return null;
  }
  if (count == 0) {
    this.errorMessage=Messages.getString("String_Node_Str",dbms().toQualifiedName(catalogOrSchema,null,colName));
    return null;
  }
  Long midleCount=getOffsetInLimit(indicator,count);
  Integer nbRow=getNbReturnedRows(indicator,count);
  long nPlusSkip=midleCount + nbRow;
  return dbms().fillGenericQueryWithColumnTableLimitOffset(sqlExpression.getBody(),colName,table,String.valueOf(nbRow),String.valueOf(midleCount),String.valueOf(nPlusSkip));
}
Program: 139717
Project: 139717
Buggy source:
@Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
  monitor.beginTask(DefaultMessagesImpl.getString("String_Node_Str",analysis.getName()),IProgressMonitor.UNKNOWN);
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (listener != null) {
        listener.fireRuningItemChanged(false);
      }
    }
  }
);
  ReturnCode executed=null;
  AnalysisExecutorThread aet=new AnalysisExecutorThread(analysis,monitor);
  new Thread(aet).start();
  while (true) {
    if (aet.getExecuted() != null) {
      executed=aet.getExecuted();
      break;
    }
    if (monitor.isCanceled()) {
      executed=new ReturnCode(DefaultMessagesImpl.getString("String_Node_Str"),false);
      break;
    }
  }
  aet=null;
  monitor.done();
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (listener != null) {
        listener.fireRuningItemChanged(true);
      }
    }
  }
);
  return getResultStatus(executed);
}

Fixed version (ground truth):
@Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
  monitor.beginTask(DefaultMessagesImpl.getString("String_Node_Str",analysis.getName()),IProgressMonitor.UNKNOWN);
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (listener != null) {
        listener.fireRuningItemChanged(false);
      }
    }
  }
);
  ReturnCode executed=null;
  AnalysisExecutorThread aet=new AnalysisExecutorThread(analysis,monitor);
  new Thread(aet).start();
  while (true) {
    if (aet.getExecuted() != null) {
      executed=aet.getExecuted();
      break;
    }
    if (monitor.isCanceled()) {
      executed=new ReturnCode(DefaultMessagesImpl.getString("String_Node_Str"),false);
      break;
    }
  }
  aet=null;
  monitor.done();
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (listener != null) {
        listener.fireRuningItemChanged(true);
      }
    }
  }
);
  displayResultStatus(executed);
  return Status.OK_STATUS;
}
Program: 139719
Project: 139719
Buggy source:
public Collection<IndicatorDefinition> getAllUDIs(IFolder patternFodler){
  return Collections.EMPTY_LIST;
}

Fixed version (ground truth):
public Collection<IndicatorDefinition> getAllUDIs(IFolder patternFodler){
  if (resourcesNumberChanged) {
    try {
      searchAllUDIs(patternFodler);
    }
 catch (    CoreException e) {
      log.error(e,e);
    }
    resourcesNumberChanged=false;
  }
  return idsMap.values();
}
Program: 139720
Project: 139720
Buggy source:
@Override protected String getFileExtension(){
  return null;
}

Fixed version (ground truth):
@Override protected String getFileExtension(){
  return FactoriesUtil.UDI;
}
Program: 139721
Project: 139721
Buggy source:
public TypedReturnCode<IFile> createAndSaveCWMFile(ModelElement cwmElement){
  IndicatorDefinition indicatorDefinition=(IndicatorDefinition)cwmElement;
  indicatorDefinition.getSqlGenericExpression().add(getExpression());
  UDIHelper.setUDICategory(indicatorDefinition,DefinitionHandler.getInstance().getUserDefinedCountIndicatorCategory());
  IFolder folder=parameter.getFolderProvider().getFolderResource();
  return ElementWriterFactory.getInstance().createPatternWriter().create(indicatorDefinition,folder);
}

Fixed version (ground truth):
public TypedReturnCode<IFile> createAndSaveCWMFile(ModelElement cwmElement){
  IndicatorDefinition indicatorDefinition=(IndicatorDefinition)cwmElement;
  indicatorDefinition.getSqlGenericExpression().add(getExpression());
  UDIHelper.setUDICategory(indicatorDefinition,DefinitionHandler.getInstance().getUserDefinedCountIndicatorCategory());
  IFolder folder=parameter.getFolderProvider().getFolderResource();
  return ElementWriterFactory.getInstance().createUDIndicatorWriter().create(indicatorDefinition,folder);
}
Program: 139723
Project: 139723
Buggy source:
public IndicatorCategory getIndicatorCategoryByLabel(String label){
  if (USER_DEFINED_COUNT_CATEGORY_LABEL.equals(label)) {
    return getIndicatorCategory(USER_DEFINED_COUNT_CATEGORY);
  }
 else   if (USER_DEFINED_MATCH_CATEGORY_LABEL.equals(label)) {
    return getIndicatorCategory(USER_DEFINED_MATCH_CATEGORY);
  }
 else   if (USER_DEFINED_FREQUENCY_CATEGORY_LABEL.equals(label)) {
    return getIndicatorCategory(USER_DEFINED_FREQUENCY_CATEGORY);
  }
 else   if (USER_DEFINED_COMPARISON_CATEGORY_LABEL.equals(label)) {
    return getIndicatorCategory(USER_DEFINED_COMPARISON_CATEGORY);
  }
 else   if (USER_DEFINED_NOMINAL_CORRELATION_CATEGORY_LABEL.equals(label)) {
    return getIndicatorCategory(USER_DEFINED_NOMINAL_CORRELATION_CATEGORY);
  }
 else   if (USER_DEFINED_INTERVAL_CORRELATION_CATEGORY_LABEL.equals(label)) {
    return getIndicatorCategory(USER_DEFINED_INTERVAL_CORRELATION_CATEGORY);
  }
 else   if (USER_DEFINED_TIME_CORRELATION_CATEGORY_LABEL.equals(label)) {
    return getIndicatorCategory(USER_DEFINED_TIME_CORRELATION_CATEGORY);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public IndicatorCategory getIndicatorCategoryByLabel(String label){
  return getUserDefinedIndicatorCategoryMap().get(label);
}
Program: 139724
Project: 139724
Buggy source:
/** 
 * DOC jet Comment method "removeRegexFunction". <p>Just remove a UDF from .Talend.definition File.
 * @param dbmsName
 * @return
 */
public boolean removeRegexFunction(String dbmsName){
  IndicatorDefinition regexIndDef=this.getIndicatorDefinition(REGULAR_EXPRESSION_MATCHING);
  EList<Expression> sqlGenericExpression=regexIndDef.getSqlGenericExpression();
  for (  Expression expression : sqlGenericExpression) {
    if (dbmsName.equals(expression.getLanguage())) {
      sqlGenericExpression.remove(expression);
      DefinitionHandler.getInstance().saveResource();
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * DOC jet Comment method "removeRegexFunction". <p> Just remove a UDF from .Talend.definition File.
 * @param dbmsName
 * @return
 */
public boolean removeRegexFunction(String dbmsName){
  IndicatorDefinition regexIndDef=this.getIndicatorDefinition(REGULAR_EXPRESSION_MATCHING);
  EList<Expression> sqlGenericExpression=regexIndDef.getSqlGenericExpression();
  for (  Expression expression : sqlGenericExpression) {
    if (dbmsName.equals(expression.getLanguage())) {
      sqlGenericExpression.remove(expression);
      DefinitionHandler.getInstance().saveResource();
      return true;
    }
  }
  return false;
}