nus-yam/ex-repair huggingface dataset:
Program: 138480
Project: 138480
Buggy source:
/** 
 * DOC qiongli Comment method "physicalDeleteDependencies".
 * @param dependences
 * @return
 */
private boolean physicalDeleteDependencies(List<ModelElement> dependences){
  boolean isSucceed=true;
  try {
    for (    ModelElement mod : dependences) {
      List<ModelElement> subDependences=EObjectHelper.getDependencyClients(mod);
      if (subDependences != null && !subDependences.isEmpty()) {
        isSucceed=physicalDeleteDependencies(subDependences);
      }
      if (!isSucceed) {
        return false;
      }
      currentNode=RepositoryNodeHelper.recursiveFind(mod);
      if (currentNode != null && !RepositoryNodeHelper.isStateDeleted(currentNode)) {
        if (currentNode.getObject() != null)         CorePlugin.getDefault().closeEditorIfOpened(currentNode.getObject().getProperty());
        super.run();
        CorePlugin.getDefault().refreshDQView();
      }
      currentNode=findRepNodeInRecBin(currentNode);
      if (currentNode != null) {
        super.run();
        IFile propertyFile=PropertyHelper.getPropertyFile(mod);
        if (propertyFile != null && propertyFile.exists()) {
          isSucceed=false;
        }
 else {
          EObjectHelper.removeDependencys(mod);
        }
      }
    }
  }
 catch (  Exception exc) {
    log.error(exc,exc);
    return false;
  }
  return isSucceed;
}

Fixed version (ground truth):
/** 
 * DOC qiongli Comment method "physicalDeleteDependencies".
 * @param dependences
 * @return
 */
private boolean physicalDeleteDependencies(List<ModelElement> dependences){
  boolean isSucceed=true;
  try {
    for (    ModelElement mod : dependences) {
      List<ModelElement> subDependences=EObjectHelper.getDependencyClients(mod);
      if (subDependences != null && !subDependences.isEmpty()) {
        isSucceed=physicalDeleteDependencies(subDependences);
      }
      if (!isSucceed) {
        return false;
      }
      RepositoryNode tempNode=RepositoryNodeHelper.recursiveFind(mod);
      if (tempNode != null && !RepositoryNodeHelper.isStateDeleted(tempNode)) {
        if (tempNode.getObject() != null) {
          CorePlugin.getDefault().closeEditorIfOpened(tempNode.getObject().getProperty().getItem());
        }
        excuteSuperRun(tempNode);
        CorePlugin.getDefault().refreshDQView();
      }
      tempNode=RepositoryNodeHelper.recursiveFind(mod);
      if (tempNode != null) {
        excuteSuperRun(tempNode);
        IFile propertyFile=PropertyHelper.getPropertyFile(mod);
        if (propertyFile != null && propertyFile.exists()) {
          isSucceed=false;
        }
 else {
          EObjectHelper.removeDependencys(mod);
        }
      }
    }
  }
 catch (  Exception exc) {
    log.error(exc,exc);
    return false;
  }
  return isSucceed;
}
Program: 138481
Project: 138481
Buggy source:
private void closeEditors(Object[] selections){
  for (  Object obj : selections) {
    if (obj instanceof RepositoryNode) {
      RepositoryNode node=(RepositoryNode)obj;
      if (node.getObject() != null) {
        CorePlugin.getDefault().closeEditorIfOpened(node.getObject().getProperty());
      }
    }
  }
}

Fixed version (ground truth):
private void closeEditors(ISelection selection){
  Object[] objs=((IStructuredSelection)selection).toArray();
  for (  Object obj : objs) {
    if (obj instanceof RepositoryNode) {
      RepositoryNode node=(RepositoryNode)obj;
      if (node.getObject() != null) {
        CorePlugin.getDefault().closeEditorIfOpened(node.getObject().getProperty().getItem());
      }
    }
  }
}
Program: 138482
Project: 138482
Buggy source:
@Override public void run(){
  ISelection selection=this.getSelection();
  Object[] objs=((IStructuredSelection)selection).toArray();
  for (  Object obj : objs) {
    if (obj instanceof RepositoryNode) {
      RepositoryNode node=(RepositoryNode)obj;
      boolean isStateDeleted=RepositoryNodeHelper.isStateDeleted(node);
      if (!isStateDeleted) {
        closeEditors(objs);
        currentNode=null;
        super.run();
        break;
      }
      if (node.getType() == ENodeType.SIMPLE_FOLDER) {
        List<IRepositoryNode> newLs=new ArrayList<IRepositoryNode>();
        findRepNodesByFolderNode(node,newLs);
        for (        IRepositoryNode subNode : newLs) {
          if (showDependenciesDialog((RepositoryNode)subNode)) {
            currentNode=(RepositoryNode)subNode;
            super.run();
          }
        }
      }
 else {
        if (showDependenciesDialog(node)) {
          EObjectHelper.removeDependencys(RepositoryNodeHelper.getModelElementFromRepositoryNode(node));
          currentNode=node;
          super.run();
        }
      }
    }
  }
  CorePlugin.getDefault().refreshDQView();
  CorePlugin.getDefault().refreshWorkSpace();
}

Fixed version (ground truth):
@Override public void run(){
  ISelection selection=this.getSelection();
  for (  Object obj : ((IStructuredSelection)selection).toArray()) {
    if (obj instanceof RepositoryNode) {
      RepositoryNode node=(RepositoryNode)obj;
      boolean isStateDeleted=RepositoryNodeHelper.isStateDeleted(node);
      if (!isStateDeleted) {
        closeEditors(selection);
        excuteSuperRun(null);
        break;
      }
      if (node.getType() == ENodeType.SIMPLE_FOLDER) {
        List<IRepositoryNode> newLs=new ArrayList<IRepositoryNode>();
        findRepNodesByFolderNode(node,newLs);
        for (        IRepositoryNode subNode : newLs) {
          if (showDependenciesDialog((RepositoryNode)subNode)) {
            excuteSuperRun((RepositoryNode)subNode);
          }
        }
        excuteSuperRun(node);
      }
 else {
        if (showDependenciesDialog(node)) {
          EObjectHelper.removeDependencys(RepositoryNodeHelper.getModelElementFromRepositoryNode(node));
          excuteSuperRun(node);
        }
      }
    }
  }
  CorePlugin.getDefault().refreshDQView();
  CorePlugin.getDefault().refreshWorkSpace();
}
Program: 138483
Project: 138483
Buggy source:
/** 
 * DOC xqliu Comment method "getPath".
 * @param element
 * @param itemPath
 * @return
 */
private IPath getPath(ModelElement element,IPath itemPath){
  IPath path=new Path("String_Node_Str");
  if (element instanceof DatabaseConnection) {
    path=itemPath.makeRelativeTo(ResourceManager.getTDQConnectionFolder().getFullPath());
  }
 else   if (element instanceof MDMConnection) {
    path=itemPath.makeRelativeTo(ResourceManager.getMDMConnectionFolder().getFullPath());
  }
 else   if (element instanceof Analysis) {
    path=itemPath.makeRelativeTo(ResourceManager.getAnalysisFolder().getFullPath());
    if (path.isEmpty()) {
      return itemPath;
    }
  }
 else   if (element instanceof Report) {
    path=itemPath.makeRelativeTo(ResourceManager.getReportsFolder().getFullPath());
    if (path.isEmpty()) {
      return itemPath;
    }
  }
 else   if (element instanceof IndicatorDefinition) {
    if (element instanceof WhereRule) {
      path=itemPath.makeRelativeTo(ResourceManager.getRulesSQLFolder().getFullPath());
    }
 else {
      path=itemPath.makeRelativeTo(ResourceManager.getIndicatorFolder().getFullPath());
    }
  }
 else   if (element instanceof Pattern) {
    path=itemPath.makeRelativeTo(ResourceManager.getPatternFolder().getFullPath());
  }
  return path;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "getPath".
 * @param element
 * @param itemPath
 * @return
 */
private IPath getPath(ModelElement element,IPath itemPath){
  IPath path=new Path("String_Node_Str");
  if (element instanceof DatabaseConnection) {
    path=itemPath.makeRelativeTo(ResourceManager.getTDQConnectionFolder().getFullPath());
  }
 else   if (element instanceof MDMConnection) {
    path=itemPath.makeRelativeTo(ResourceManager.getMDMConnectionFolder().getFullPath());
  }
 else   if (element instanceof Analysis) {
    path=itemPath.makeRelativeTo(ResourceManager.getAnalysisFolder().getFullPath());
  }
 else   if (element instanceof Report) {
    path=itemPath.makeRelativeTo(ResourceManager.getReportsFolder().getFullPath());
  }
 else   if (element instanceof IndicatorDefinition) {
    if (element instanceof WhereRule) {
      path=itemPath.makeRelativeTo(ResourceManager.getRulesSQLFolder().getFullPath());
    }
 else {
      path=itemPath.makeRelativeTo(ResourceManager.getIndicatorFolder().getFullPath());
    }
  }
 else   if (element instanceof Pattern) {
    path=itemPath.makeRelativeTo(ResourceManager.getPatternFolder().getFullPath());
  }
  return path;
}
Program: 138485
Project: 138485
Buggy source:
/** 
 * Method "addColumnToAnalyze".
 * @param column
 * @return
 */
public boolean addIndicator(List<ModelElement> columns,Indicator indicator){
  for (  ModelElement tdColumn : columns) {
    if (!analysis.getContext().getAnalysedElements().contains(tdColumn)) {
      analysis.getContext().getAnalysedElements().add(tdColumn);
    }
  }
  analysis.getResults().getIndicators().add(indicator);
  initializeIndicator(indicator);
  DataManager connection=analysis.getContext().getConnection();
  if (connection == null) {
    for (    ModelElement element : columns) {
      TdColumn tdColumn=SwitchHelpers.COLUMN_SWITCH.doSwitch(element);
      log.error("String_Node_Str");
      connection=ConnectionHelper.getTdDataProvider(tdColumn);
      analysis.getContext().setConnection(connection);
    }
  }
  TypedReturnCode<Dependency> rc=DependenciesHandler.getInstance().setDependencyOn(analysis,connection);
  if (rc.isOk()) {
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Method "addColumnToAnalyze".
 * @param column
 * @return
 */
public boolean addIndicator(List<MetadataColumn> columns,Indicator indicator){
  for (  ModelElement tdColumn : columns) {
    if (!analysis.getContext().getAnalysedElements().contains(tdColumn)) {
      analysis.getContext().getAnalysedElements().add(tdColumn);
    }
  }
  analysis.getResults().getIndicators().add(indicator);
  initializeIndicator(indicator);
  DataManager connection=analysis.getContext().getConnection();
  if (connection == null) {
    for (    ModelElement element : columns) {
      TdColumn tdColumn=SwitchHelpers.COLUMN_SWITCH.doSwitch(element);
      log.error("String_Node_Str");
      connection=ConnectionHelper.getTdDataProvider(tdColumn);
      analysis.getContext().setConnection(connection);
    }
  }
  TypedReturnCode<Dependency> rc=DependenciesHandler.getInstance().setDependencyOn(analysis,connection);
  if (rc.isOk()) {
  }
  return true;
}
Program: 138488
Project: 138488
Buggy source:
public String getQueryStirng(ModelElement column,Analysis ana,EList<ModelElement> nominalList,String columnName,String columnValue){
  setAnalysis(ana);
  String queryString=SELECT_ALL_FROM + getFullyQualifiedTableName(column);
  int col=columnName.indexOf("String_Node_Str");
  int val=columnValue.indexOf("String_Node_Str");
  for (  ModelElement nominal : nominalList) {
    final TdColumn tdColumn=(TdColumn)nominal;
    if (col > 0 && val > 0) {
      String[] name=columnName.split("String_Node_Str");
      String[] value=columnValue.split("String_Node_Str");
      for (int i=0; i < name.length; i++) {
        String where=dbmsLanguage.and();
        if (i == 0) {
          where=dbmsLanguage.where();
        }
        queryString=buildWhereClause(queryString,tdColumn,name[i],value[i],where);
      }
    }
 else {
      queryString=buildWhereClause(queryString,tdColumn,columnName.trim(),columnValue,dbmsLanguage.where());
    }
  }
  return queryString;
}

Fixed version (ground truth):
public String getQueryStirng(MetadataColumn column,Analysis ana,EList<MetadataColumn> nominalList,String columnName,String columnValue){
  setAnalysis(ana);
  String queryString=SELECT_ALL_FROM + getFullyQualifiedTableName(column);
  int col=columnName.indexOf("String_Node_Str");
  int val=columnValue.indexOf("String_Node_Str");
  for (  ModelElement nominal : nominalList) {
    final TdColumn tdColumn=(TdColumn)nominal;
    if (col > 0 && val > 0) {
      String[] name=columnName.split("String_Node_Str");
      String[] value=columnValue.split("String_Node_Str");
      for (int i=0; i < name.length; i++) {
        String where=dbmsLanguage.and();
        if (i == 0) {
          where=dbmsLanguage.where();
        }
        queryString=buildWhereClause(queryString,tdColumn,name[i],value[i],where);
      }
    }
 else {
      queryString=buildWhereClause(queryString,tdColumn,columnName.trim(),columnValue,dbmsLanguage.where());
    }
  }
  return queryString;
}
Program: 138489
Project: 138489
Buggy source:
protected Collection<Analysis> searchAllAnalysis(IFolder folder) throws ClassNotFoundException {
  Collection<Analysis> analyses=new ArrayList<Analysis>();
  try {
    for (    IResource resource : folder.members()) {
      if (resource.getType() == IResource.FOLDER) {
        if (!resource.getName().startsWith("String_Node_Str")) {
          analyses.addAll(searchAllAnalysis(folder.getFolder(resource.getName())));
        }
        continue;
      }
      IFile file=(IFile)resource;
      if (null != file.getFileExtension() && file.getFileExtension().equals(FactoriesUtil.ANA)) {
        URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
        Resource eResource=null;
        try {
          eResource=EMFSharedResources.getInstance().getResource(uri,true);
        }
 catch (        Exception e) {
          eResource=EMFSharedResources.getInstance().getResource(uri,true);
        }
        if (eResource.getContents().size() > 0) {
          analyses.add((Analysis)eResource.getContents().get(0));
        }
 else {
          log.error("String_Node_Str" + eResource);
        }
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  return analyses;
}

Fixed version (ground truth):
protected Collection<Analysis> searchAllAnalysis(IFolder folder) throws ClassNotFoundException {
  Collection<Analysis> analyses=new ArrayList<Analysis>();
  try {
    for (    IResource resource : folder.members()) {
      if (resource.getType() == IResource.FOLDER) {
        if (!resource.getName().startsWith("String_Node_Str")) {
          analyses.addAll(searchAllAnalysis(folder.getFolder(resource.getName())));
        }
        continue;
      }
      IFile file=(IFile)resource;
      if (null != file.getFileExtension() && file.getFileExtension().equals(FactoriesUtil.ANA)) {
        URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
        Resource eResource=null;
        try {
          eResource=EMFSharedResources.getInstance().getResource(uri,true);
        }
 catch (        Exception e) {
        }
        if (eResource.getContents().size() > 0) {
          analyses.add((Analysis)eResource.getContents().get(0));
        }
 else {
          log.error("String_Node_Str" + eResource);
        }
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  return analyses;
}
Program: 138490
Project: 138490
Buggy source:
/** 
 * Method "createKey" creates a key with the concatenation of the values of the first n columns of the given list.
 * @param nominalColumns
 * @param n
 * @return a key
 */
private static String createKey(EList<ModelElement> nominalColumns,int n){
  StringBuilder builder=new StringBuilder();
  for (int i=0; i < n; i++) {
    builder.append(nominalColumns.get(i).getName()).append("String_Node_Str");
  }
  return builder.toString();
}

Fixed version (ground truth):
/** 
 * Method "createKey" creates a key with the concatenation of the values of the first n columns of the given list.
 * @param nominalColumns
 * @param n
 * @return a key
 */
private static String createKey(EList<MetadataColumn> nominalColumns,int n){
  StringBuilder builder=new StringBuilder();
  for (int i=0; i < n; i++) {
    builder.append(nominalColumns.get(i).getName()).append("String_Node_Str");
  }
  return builder.toString();
}
Program: 138491
Project: 138491
Buggy source:
/** 
 * Method "fillDataset" fills in the data sets.
 * @param nominalColumns the nominal columns
 * @param listRows the rows (=result set)
 * @param firstNumericColumnIdx the index of the first numeric column
 * @return a map [key -> aggregated values] where identifies a level of aggregation
 */
private static Map<String,ValueAggregator> fillDataset(final EList<ModelElement> nominalColumns,final List<Object[]> listRows,final int firstNumericColumnIdx){
  Map<String,ValueAggregator> valueAggregators=new HashMap<String,ValueAggregator>();
  int xPos=firstNumericColumnIdx;
  int yPos=firstNumericColumnIdx + 1;
  int zPos=firstNumericColumnIdx + 2;
  for (int i=nominalColumns.size(); i > 0; i--) {
    String key=createKey(nominalColumns,i);
    for (    Object[] row : listRows) {
      final Object xobj=row[xPos];
      final Double xValue=xobj != null ? Double.valueOf(String.valueOf(xobj)) : null;
      final Object yobj=row[yPos];
      final Double yValue=yobj != null ? Double.valueOf(String.valueOf(yobj)) : null;
      final Object zobj=row[zPos];
      final Double zValue=zobj != null ? Double.valueOf(String.valueOf(zobj)) : null;
      ValueAggregator valueAggregator=valueAggregators.get(key);
      if (valueAggregator == null) {
        valueAggregator=new ValueAggregator();
        valueAggregators.put(key,valueAggregator);
      }
      MultipleKey multipleKey=new MultipleKey(row,i);
      valueAggregator.addValue(multipleKey,new Double[]{xValue,yValue,zValue});
    }
  }
  return valueAggregators;
}

Fixed version (ground truth):
/** 
 * Method "fillDataset" fills in the data sets.
 * @param nominalColumns the nominal columns
 * @param listRows the rows (=result set)
 * @param firstNumericColumnIdx the index of the first numeric column
 * @return a map [key -> aggregated values] where identifies a level of aggregation
 */
private static Map<String,ValueAggregator> fillDataset(final EList<MetadataColumn> nominalColumns,final List<Object[]> listRows,final int firstNumericColumnIdx){
  Map<String,ValueAggregator> valueAggregators=new HashMap<String,ValueAggregator>();
  int xPos=firstNumericColumnIdx;
  int yPos=firstNumericColumnIdx + 1;
  int zPos=firstNumericColumnIdx + 2;
  for (int i=nominalColumns.size(); i > 0; i--) {
    String key=createKey(nominalColumns,i);
    for (    Object[] row : listRows) {
      final Object xobj=row[xPos];
      final Double xValue=xobj != null ? Double.valueOf(String.valueOf(xobj)) : null;
      final Object yobj=row[yPos];
      final Double yValue=yobj != null ? Double.valueOf(String.valueOf(yobj)) : null;
      final Object zobj=row[zPos];
      final Double zValue=zobj != null ? Double.valueOf(String.valueOf(zobj)) : null;
      ValueAggregator valueAggregator=valueAggregators.get(key);
      if (valueAggregator == null) {
        valueAggregator=new ValueAggregator();
        valueAggregators.put(key,valueAggregator);
      }
      MultipleKey multipleKey=new MultipleKey(row,i);
      valueAggregator.addValue(multipleKey,new Double[]{xValue,yValue,zValue});
    }
  }
  return valueAggregators;
}
Program: 138492
Project: 138492
Buggy source:
/** 
 */
private static Map<String,DateValueAggregate> fillGanttDataset(final EList<ModelElement> nominalColumns,final List<Object[]> listRows,final int firstDateColumnIdx){
  Map<String,DateValueAggregate> valueAggregators=new TreeMap<String,DateValueAggregate>();
  int minPos=firstDateColumnIdx;
  int maxPos=firstDateColumnIdx + 1;
  for (int i=nominalColumns.size(); i > 0; i--) {
    String key=createKey(nominalColumns,i);
    for (    Object[] row : listRows) {
      final Object minObj=row[minPos];
      final Date minDate=minObj != null ? (Date)minObj : null;
      final Object maxobj=row[maxPos];
      final Date maxDate=maxobj != null ? (Date)maxobj : null;
      DateValueAggregate valueAggregator=valueAggregators.get(key);
      if (valueAggregator == null) {
        valueAggregator=new DateValueAggregate();
        valueAggregators.put(key,valueAggregator);
      }
      MultipleKey multipleKey=new MultipleKey(row,i);
      valueAggregator.addValue(multipleKey,new Date[]{minDate,maxDate});
    }
  }
  return valueAggregators;
}

Fixed version (ground truth):
/** 
 */
private static Map<String,DateValueAggregate> fillGanttDataset(final EList<MetadataColumn> nominalColumns,final List<Object[]> listRows,final int firstDateColumnIdx){
  Map<String,DateValueAggregate> valueAggregators=new TreeMap<String,DateValueAggregate>();
  int minPos=firstDateColumnIdx;
  int maxPos=firstDateColumnIdx + 1;
  for (int i=nominalColumns.size(); i > 0; i--) {
    String key=createKey(nominalColumns,i);
    for (    Object[] row : listRows) {
      final Object minObj=row[minPos];
      final Date minDate=minObj != null ? (Date)minObj : null;
      final Object maxobj=row[maxPos];
      final Date maxDate=maxobj != null ? (Date)maxobj : null;
      DateValueAggregate valueAggregator=valueAggregators.get(key);
      if (valueAggregator == null) {
        valueAggregator=new DateValueAggregate();
        valueAggregators.put(key,valueAggregator);
      }
      MultipleKey multipleKey=new MultipleKey(row,i);
      valueAggregator.addValue(multipleKey,new Date[]{minDate,maxDate});
    }
  }
  return valueAggregators;
}
Program: 138497
Project: 138497
Buggy source:
public HideSeriesChartComposite(Composite comp,Analysis ana,ColumnSetMultiValueIndicator indicator,ModelElement column,boolean isNeedUtility){
  super(comp,SWT.NONE);
  this.analysis=ana;
  this.indicator=indicator;
  this.column=column;
  this.isNeedUtility=isNeedUtility;
  this.setCursor(new Cursor(Display.getDefault(),SWT.CURSOR_HAND));
  this.setToolTipText("String_Node_Str");
  createHideSeriesArea();
  addSpecifiedListeners();
  GridData gd=new GridData();
  gd.heightHint=indicator.getAnalyzedColumns().size() * 30 < 230 ? 230 : indicator.getAnalyzedColumns().size() * 30;
  gd.widthHint=460;
  this.setLayoutData(gd);
}

Fixed version (ground truth):
public HideSeriesChartComposite(Composite comp,Analysis ana,ColumnSetMultiValueIndicator indicator,MetadataColumn column,boolean isNeedUtility){
  super(comp,SWT.NONE);
  this.analysis=ana;
  this.indicator=indicator;
  this.column=column;
  this.isNeedUtility=isNeedUtility;
  this.setCursor(new Cursor(Display.getDefault(),SWT.CURSOR_HAND));
  this.setToolTipText("String_Node_Str");
  createHideSeriesArea();
  addSpecifiedListeners();
  GridData gd=new GridData();
  gd.heightHint=indicator.getAnalyzedColumns().size() * 30 < 230 ? 230 : indicator.getAnalyzedColumns().size() * 30;
  gd.widthHint=460;
  this.setLayoutData(gd);
}
Program: 138499
Project: 138499
Buggy source:
private void addMenuOnGantChart(ChartEntity chartEntity,Menu menu){
  if (chartEntity instanceof CategoryItemEntity) {
    CategoryItemEntity itemEntity=(CategoryItemEntity)chartEntity;
    String seriesK=itemEntity.getRowKey().toString();
    String seriesLabel=itemEntity.getColumnKey().toString();
    EList<ModelElement> nominalList=indicator.getNominalColumns();
    final String sql=MultiColumnSetValueExplorer.getInstance().getQueryStirng(column,analysis,nominalList,seriesK,seriesLabel);
    MenuItem item=new MenuItem(menu,SWT.PUSH);
    item.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    item.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        Display.getDefault().asyncExec(new Runnable(){
          public void run(){
            Connection tdDataProvider=SwitchHelpers.CONNECTION_SWITCH.doSwitch(analysis.getContext().getConnection());
            String query=sql;
            String editorName=ColumnHelper.getColumnSetOwner(column).getName();
            CorePlugin.getDefault().runInDQViewer(tdDataProvider,query,editorName);
          }
        }
);
      }
    }
);
  }
}

Fixed version (ground truth):
private void addMenuOnGantChart(ChartEntity chartEntity,Menu menu){
  if (chartEntity instanceof CategoryItemEntity) {
    CategoryItemEntity itemEntity=(CategoryItemEntity)chartEntity;
    String seriesK=itemEntity.getRowKey().toString();
    String seriesLabel=itemEntity.getColumnKey().toString();
    EList<MetadataColumn> nominalList=indicator.getNominalColumns();
    final String sql=MultiColumnSetValueExplorer.getInstance().getQueryStirng(column,analysis,nominalList,seriesK,seriesLabel);
    MenuItem item=new MenuItem(menu,SWT.PUSH);
    item.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    item.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        Display.getDefault().asyncExec(new Runnable(){
          public void run(){
            Connection tdDataProvider=SwitchHelpers.CONNECTION_SWITCH.doSwitch(analysis.getContext().getConnection());
            String query=sql;
            String editorName=ColumnHelper.getColumnSetOwner(column).getName();
            CorePlugin.getDefault().runInDQViewer(tdDataProvider,query,editorName);
          }
        }
);
      }
    }
);
  }
}
Program: 138500
Project: 138500
Buggy source:
/** 
 * zshen.
 * @return the input of table.
 */
private List<Map<Integer,RegexpMatchingIndicator>> organizeTableInput(){
  List<Map<Integer,RegexpMatchingIndicator>> returnList=new ArrayList<Map<Integer,RegexpMatchingIndicator>>();
  AllMatchIndicatorImpl allMatchIndicator=this.selectPatternsWizard.getAllMatchIndicator();
  if (allMatchIndicator == null) {
    return returnList;
  }
  List<ModelElement> analysisColumns=this.selectPatternsWizard.getAllMatchIndicator().getAnalyzedColumns();
  List<RegexpMatchingIndicator> regexpMatchingIndicatorList=this.selectPatternsWizard.getAllMatchIndicator().getCompositeRegexMatchingIndicators();
  for (  RegexpMatchingIndicator regexIndicator : regexpMatchingIndicatorList) {
    int index=analysisColumns.indexOf(regexIndicator.getAnalyzedElement());
    Map<Integer,RegexpMatchingIndicator> returnMap=getMapLocation(returnList,index);
    returnMap.put(index,regexIndicator);
    if (returnMap.size() == 1) {
      returnList.add(returnMap);
    }
  }
  return returnList;
}

Fixed version (ground truth):
/** 
 * zshen.
 * @return the input of table.
 */
private List<Map<Integer,RegexpMatchingIndicator>> organizeTableInput(){
  List<Map<Integer,RegexpMatchingIndicator>> returnList=new ArrayList<Map<Integer,RegexpMatchingIndicator>>();
  AllMatchIndicatorImpl allMatchIndicator=this.selectPatternsWizard.getAllMatchIndicator();
  if (allMatchIndicator == null) {
    return returnList;
  }
  List<MetadataColumn> analysisColumns=this.selectPatternsWizard.getAllMatchIndicator().getAnalyzedColumns();
  List<RegexpMatchingIndicator> regexpMatchingIndicatorList=this.selectPatternsWizard.getAllMatchIndicator().getCompositeRegexMatchingIndicators();
  for (  RegexpMatchingIndicator regexIndicator : regexpMatchingIndicatorList) {
    int index=analysisColumns.indexOf(regexIndicator.getAnalyzedElement());
    Map<Integer,RegexpMatchingIndicator> returnMap=getMapLocation(returnList,index);
    returnMap.put(index,regexIndicator);
    if (returnMap.size() == 1) {
      returnList.add(returnMap);
    }
  }
  return returnList;
}
Program: 138501
Project: 138501
Buggy source:
public void createControl(Composite parent){
  List<ModelElement> analysisColumns=this.selectPatternsWizard.getSsIndicator().getAnalyzedColumns();
  GridTableViewer tableView=new GridTableViewer(parent,SWT.NONE);
  this.table=tableView.getGrid();
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  for (  ModelElement analysisColumn : analysisColumns) {
    GridColumn tableCum=new GridColumn(table,SWT.CHECK);
    tableCum.setText(analysisColumn.getName());
  }
  tableView.setContentProvider(new PatternSelectContentProvider());
  tableView.setLabelProvider(new PatternSelectLabelProvider());
  this.tableInputList=organizeTableInput();
  tableView.setInput(tableInputList);
  for (  GridColumn tableCum : table.getColumns()) {
    tableCum.pack();
  }
  inItitemCheck();
  this.setControl(parent);
  this.setPageComplete(true);
}

Fixed version (ground truth):
public void createControl(Composite parent){
  List<MetadataColumn> analysisColumns=this.selectPatternsWizard.getSsIndicator().getAnalyzedColumns();
  GridTableViewer tableView=new GridTableViewer(parent,SWT.NONE);
  this.table=tableView.getGrid();
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  for (  ModelElement analysisColumn : analysisColumns) {
    GridColumn tableCum=new GridColumn(table,SWT.CHECK);
    tableCum.setText(analysisColumn.getName());
  }
  tableView.setContentProvider(new PatternSelectContentProvider());
  tableView.setLabelProvider(new PatternSelectLabelProvider());
  this.tableInputList=organizeTableInput();
  tableView.setInput(tableInputList);
  for (  GridColumn tableCum : table.getColumns()) {
    tableCum.pack();
  }
  inItitemCheck();
  this.setControl(parent);
  this.setPageComplete(true);
}
Program: 138502
Project: 138502
Buggy source:
@Override public void openEditor(Item item){
  TDQPatternItem patternItem=(TDQPatternItem)item;
  String subfolderPath=patternItem.getState().getPath();
  String folderPath=ResourceManager.getIndicatorFolder().getFullPath().toString();
  Path path=new Path(folderPath);
  Path append=(Path)path.append(new Path(subfolderPath)).append(new Path(patternItem.getFilename()));
  IPath removeLastSegments=append.removeFirstSegments(1);
  IFile fileEditorInput=ResourceManager.getRootProject().getFile(removeLastSegments);
  try {
    IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(),fileEditorInput,true);
  }
 catch (  PartInitException e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
@Override public void openEditor(Item item){
  PatternItemEditorInput analysisEditorInput=new PatternItemEditorInput(item);
  CorePlugin.getDefault().openEditor(analysisEditorInput,PatternEditor.class.getName());
}
Program: 138503
Project: 138503
Buggy source:
@Override public void openEditor(Item item){
  TDQBusinessRuleItem ruleItem=(TDQBusinessRuleItem)item;
  String folderPath=ruleItem.getState().getPath();
  if (folderPath.equals("String_Node_Str")) {
    folderPath=ResourceManager.getRulesSQLFolder().toString();
  }
  Path path=new Path(folderPath);
  Path append=(Path)path.append(new Path(ruleItem.getFilename()));
  IPath removeLastSegments=append.removeFirstSegments(2);
  IFile fileEditorInput=ResourceManager.getRootProject().getFile(removeLastSegments);
  try {
    IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(),fileEditorInput,true);
  }
 catch (  PartInitException e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
@Override public void openEditor(Item item){
  BusinessRuleItemEditorInput dqRuleEditorInput=new BusinessRuleItemEditorInput(item);
  CorePlugin.getDefault().openEditor(dqRuleEditorInput,DQRuleEditor.class.getName());
}
Program: 138504
Project: 138504
Buggy source:
@Override public void openEditor(Item item){
  TDQIndicatorDefinitionItem indicatorItem=(TDQIndicatorDefinitionItem)item;
  String subfolderPath=indicatorItem.getState().getPath();
  String folderPath=ResourceManager.getIndicatorFolder().getFullPath().toString();
  Path path=new Path(folderPath);
  Path append=(Path)path.append(new Path(subfolderPath)).append(new Path(indicatorItem.getFilename()));
  IPath removeLastSegments=append.removeFirstSegments(1);
  IFile fileEditorInput=ResourceManager.getRootProject().getFile(removeLastSegments);
  try {
    IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(),fileEditorInput,true);
  }
 catch (  PartInitException e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
@Override public void openEditor(Item item){
  IndicatorDefinitionItemEditorInput udiEditorInput=new IndicatorDefinitionItemEditorInput(item);
  CorePlugin.getDefault().openEditor(udiEditorInput,IndicatorEditor.class.getName());
}
Program: 138506
Project: 138506
Buggy source:
public static void removeDependencys(IResource... resources){
  for (  IResource selectedObj : resources) {
    IFile file=((IFile)selectedObj);
    if (file.getFileExtension() == null) {
      continue;
    }
    ModelElement elementToDelete=getModelElement(file);
    if (elementToDelete != null) {
      List<Resource> modifiedResources=DependenciesHandler.getInstance().clearDependencies(elementToDelete);
      for (      Resource resource : modifiedResources) {
        EMFUtil.saveSingleResource(resource);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC qiongli Comment method "removeDependencys".
 * @param elementToDelete
 */
public static void removeDependencys(ModelElement elementToDelete){
  if (elementToDelete != null) {
    List<Resource> modifiedResources=DependenciesHandler.getInstance().clearDependencies(elementToDelete);
    for (    Resource resource : modifiedResources) {
      EMFUtil.saveSingleResource(resource);
    }
  }
}
Program: 138507
Project: 138507
Buggy source:
/** 
 * ADD mzhao 15750 , build dq metadata tree, get connection root node.
 */
public static List<IRepositoryNode> getConnectionRepositoryNodes(){
  RepositoryNode node=getRootNode(ERepositoryObjectType.METADATA);
  List<IRepositoryNode> connNodes=new ArrayList<IRepositoryNode>();
  if (node != null) {
    List<IRepositoryNode> childrens=node.getChildren();
    for (    IRepositoryNode subNode : childrens) {
      if (subNode instanceof DBConnectionFolderRepNode || subNode instanceof DFConnectionFolderRepNode || subNode instanceof MDMConnectionFolderRepNode) {
        connNodes.addAll(getModelElementFromFolder(subNode));
      }
    }
  }
  return connNodes;
}

Fixed version (ground truth):
/** 
 * ADD mzhao 15750 , build dq metadata tree, get connection root node.
 */
public static List<IRepositoryNode> getConnectionRepositoryNodes(boolean withDeleted){
  RepositoryNode node=getRootNode(ERepositoryObjectType.METADATA);
  List<IRepositoryNode> connNodes=new ArrayList<IRepositoryNode>();
  if (node != null) {
    List<IRepositoryNode> childrens=node.getChildren();
    for (    IRepositoryNode subNode : childrens) {
      if (subNode instanceof DBConnectionFolderRepNode || subNode instanceof DFConnectionFolderRepNode || subNode instanceof MDMConnectionFolderRepNode) {
        connNodes.addAll(getModelElementFromFolder(subNode,withDeleted));
      }
    }
  }
  return connNodes;
}
Program: 138508
Project: 138508
Buggy source:
public static List<IRepositoryNode> getDBConnectionRepositoryNodes(){
  RepositoryNode node=getRootNode(ERepositoryObjectType.METADATA);
  List<IRepositoryNode> connNodes=new ArrayList<IRepositoryNode>();
  if (node != null) {
    List<IRepositoryNode> childrens=node.getChildren();
    for (    IRepositoryNode subNode : childrens) {
      if (subNode instanceof DBConnectionFolderRepNode) {
        connNodes.addAll(getModelElementFromFolder(subNode));
      }
    }
  }
  return connNodes;
}

Fixed version (ground truth):
public static List<IRepositoryNode> getDBConnectionRepositoryNodes(boolean withDeleted){
  RepositoryNode node=getRootNode(ERepositoryObjectType.METADATA);
  List<IRepositoryNode> connNodes=new ArrayList<IRepositoryNode>();
  if (node != null) {
    List<IRepositoryNode> childrens=node.getChildren();
    for (    IRepositoryNode subNode : childrens) {
      if (subNode instanceof DBConnectionFolderRepNode) {
        connNodes.addAll(getModelElementFromFolder(subNode,withDeleted));
      }
    }
  }
  return connNodes;
}
Program: 138509
Project: 138509
Buggy source:
/** 
 * Add zshen 15750 get all the Connection Node from one folder node.
 * @param folderNode any node
 * @return
 */
private static List<IRepositoryNode> getModelElementFromFolder(IRepositoryNode folderNode){
  List<IRepositoryNode> repositoryNodeList=new ArrayList<IRepositoryNode>();
  if (isFolderNode(folderNode.getType())) {
    for (    IRepositoryNode thefolderNode : folderNode.getChildren()) {
      repositoryNodeList.addAll(getModelElementFromFolder(thefolderNode));
    }
  }
 else {
    repositoryNodeList.add(folderNode);
  }
  return repositoryNodeList;
}

Fixed version (ground truth):
/** 
 * Add zshen 15750 get all the Connection Node from one folder node.
 * @param folderNode any node
 * @return
 */
private static List<IRepositoryNode> getModelElementFromFolder(IRepositoryNode folderNode,boolean withDelted){
  List<IRepositoryNode> repositoryNodeList=new ArrayList<IRepositoryNode>();
  if (isFolderNode(folderNode.getType())) {
    for (    IRepositoryNode thefolderNode : folderNode.getChildren(withDelted)) {
      repositoryNodeList.addAll(getModelElementFromFolder(thefolderNode,withDelted));
    }
  }
 else {
    repositoryNodeList.add(folderNode);
  }
  return repositoryNodeList;
}
Program: 138510
Project: 138510
Buggy source:
public static List<IRepositoryNode> getDataProfilingRepositoryNodes(){
  RepositoryNode node=getRootNode(ERepositoryObjectType.TDQ_DATA_PROFILING);
  List<IRepositoryNode> dataProfilingNodes=new ArrayList<IRepositoryNode>();
  if (node != null) {
    List<IRepositoryNode> childrens=node.getChildren();
    for (    IRepositoryNode subNode : childrens) {
      if (subNode instanceof AnalysisFolderRepNode || subNode instanceof ReportFolderRepNode) {
        dataProfilingNodes.addAll(getModelElementFromFolder(subNode));
      }
    }
  }
  return dataProfilingNodes;
}

Fixed version (ground truth):
public static List<IRepositoryNode> getDataProfilingRepositoryNodes(boolean withDeleted){
  RepositoryNode node=getRootNode(ERepositoryObjectType.TDQ_DATA_PROFILING);
  List<IRepositoryNode> dataProfilingNodes=new ArrayList<IRepositoryNode>();
  if (node != null) {
    List<IRepositoryNode> childrens=node.getChildren();
    for (    IRepositoryNode subNode : childrens) {
      if (subNode instanceof AnalysisFolderRepNode || subNode instanceof ReportFolderRepNode) {
        dataProfilingNodes.addAll(getModelElementFromFolder(subNode,withDeleted));
      }
    }
  }
  return dataProfilingNodes;
}
Program: 138511
Project: 138511
Buggy source:
public static List<IRepositoryNode> getPatternsRepositoryNodes(){
  RepositoryNode node=getRootNode(ERepositoryObjectType.TDQ_LIBRARIES);
  List<IRepositoryNode> patternsNodes=new ArrayList<IRepositoryNode>();
  if (node != null) {
    List<IRepositoryNode> childrens=node.getChildren();
    for (    IRepositoryNode subNode : childrens) {
      if (EResourceConstant.PATTERNS.getName().equals((subNode.getObject().getLabel()))) {
        List<IRepositoryNode> subChildren=subNode.getChildren();
        for (        IRepositoryNode patternsNode : subChildren) {
          if (patternsNode instanceof PatternRegexFolderRepNode || patternsNode instanceof PatternSqlFolderRepNode) {
            patternsNodes.addAll(getModelElementFromFolder(patternsNode));
          }
        }
        return patternsNodes;
      }
    }
  }
  return patternsNodes;
}

Fixed version (ground truth):
public static List<IRepositoryNode> getPatternsRepositoryNodes(boolean withDeleted){
  RepositoryNode node=getRootNode(ERepositoryObjectType.TDQ_LIBRARIES);
  List<IRepositoryNode> patternsNodes=new ArrayList<IRepositoryNode>();
  if (node != null) {
    List<IRepositoryNode> childrens=node.getChildren();
    for (    IRepositoryNode subNode : childrens) {
      if (EResourceConstant.PATTERNS.getName().equals((subNode.getObject().getLabel()))) {
        List<IRepositoryNode> subChildren=subNode.getChildren();
        for (        IRepositoryNode patternsNode : subChildren) {
          if (patternsNode instanceof PatternRegexFolderRepNode || patternsNode instanceof PatternSqlFolderRepNode) {
            patternsNodes.addAll(getModelElementFromFolder(patternsNode,withDeleted));
          }
        }
        return patternsNodes;
      }
    }
  }
  return patternsNodes;
}
Program: 138512
Project: 138512
Buggy source:
public static List<IRepositoryNode> getUdisRepositoryNodes(){
  RepositoryNode node=getRootNode(ERepositoryObjectType.TDQ_LIBRARIES);
  List<IRepositoryNode> udisNodes=new ArrayList<IRepositoryNode>();
  if (node != null) {
    List<IRepositoryNode> childrens=node.getChildren();
    for (    IRepositoryNode subNode : childrens) {
      if (EResourceConstant.INDICATORS.getName().equals((subNode.getObject().getLabel())) || EResourceConstant.RULES.getName().equals((subNode.getObject().getLabel()))) {
        List<IRepositoryNode> subChildren=subNode.getChildren();
        for (        IRepositoryNode udisNode : subChildren) {
          if (udisNode instanceof UserDefIndicatorFolderRepNode || udisNode instanceof RulesFolderRepNode) {
            udisNodes.addAll(getModelElementFromFolder(udisNode));
          }
        }
      }
    }
  }
  return udisNodes;
}

Fixed version (ground truth):
public static List<IRepositoryNode> getUdisRepositoryNodes(boolean withDeleted){
  RepositoryNode node=getRootNode(ERepositoryObjectType.TDQ_LIBRARIES);
  List<IRepositoryNode> udisNodes=new ArrayList<IRepositoryNode>();
  if (node != null) {
    List<IRepositoryNode> childrens=node.getChildren();
    for (    IRepositoryNode subNode : childrens) {
      if (EResourceConstant.INDICATORS.getName().equals((subNode.getObject().getLabel())) || EResourceConstant.RULES.getName().equals((subNode.getObject().getLabel()))) {
        List<IRepositoryNode> subChildren=subNode.getChildren();
        for (        IRepositoryNode udisNode : subChildren) {
          if (udisNode instanceof UserDefIndicatorFolderRepNode || udisNode instanceof RulesFolderRepNode) {
            udisNodes.addAll(getModelElementFromFolder(udisNode,withDeleted));
          }
        }
      }
    }
  }
  return udisNodes;
}
Program: 138515
Project: 138515
Buggy source:
public AnalysisColumnSetTreeViewer(Composite parent,ColumnSetMasterPage masterPage){
  absMasterPage=masterPage;
  viewKey=VIEWER_KEY;
  parentComp=parent;
  tree=createTree(parent);
  tree.setData(this);
  columnSetMultiValueList=new ArrayList<IRepositoryNode>();
  this.masterPage=masterPage;
  this.createButtonSection(parent.getParent());
  this.setElements(masterPage.getCurrentModelElementIndicators());
  this.setDirty(false);
  AbstractColumnDropTree treeViewer=masterPage.getTreeViewer();
  if (treeViewer != null && treeViewer instanceof AnalysisColumnSetTreeViewer) {
    setTreeViewer=(AnalysisColumnSetTreeViewer)treeViewer;
  }
}

Fixed version (ground truth):
public AnalysisColumnSetTreeViewer(Composite parent,ColumnSetMasterPage masterPage){
  absMasterPage=masterPage;
  viewKey=VIEWER_KEY;
  parentComp=parent;
  tree=createTree(parent);
  tree.setData(this);
  columnSetMultiValueList=new ArrayList<IRepositoryNode>();
  this.masterPage=masterPage;
  this.createButtonSection(parent.getParent());
  this.setElements(masterPage.getCurrentModelElementIndicators());
  this.setDirty(false);
  AbstractColumnDropTree treeViewer=null == masterPage.getTreeViewer() ? this : masterPage.getTreeViewer();
  if (treeViewer != null && treeViewer instanceof AnalysisColumnSetTreeViewer) {
    setTreeViewer=(AnalysisColumnSetTreeViewer)treeViewer;
  }
}
Program: 138517
Project: 138517
Buggy source:
/** 
 * Set the pattern and regularExpression value to the corresponding field, it can be called after the control created.
 * @param pattern
 * @param regularExpression
 */
public void setPatternExpression(PatternMasterDetailsPage editorPage,Pattern editorPattern,RegularExpression regularExpression){
  this.editorPage=editorPage;
  pattern=editorPattern;
  this.regularExpression=regularExpression;
  if (PluginConstant.EMPTY_STRING.equals(regularText)) {
    return;
  }
  this.regularText.setText(regularExpression.getExpression().getBody());
  this.saveButton.setEnabled(true);
  this.createPatternButton.setEnabled(true);
}

Fixed version (ground truth):
/** 
 * Set the pattern and regularExpression value to the corresponding field, it can be called after the control created.
 * @param pattern
 * @param regularExpression
 */
public void setPatternExpression(PatternMasterDetailsPage editorPage,Pattern editorPattern,RegularExpression regularExpression){
  this.editorPage=editorPage;
  pattern=editorPattern;
  this.regularExpression=regularExpression;
  String body=regularExpression.getExpression().getBody();
  this.regularText.setText(body == null ? "String_Node_Str" : body);
  this.saveButton.setEnabled(true);
  this.createPatternButton.setEnabled(true);
  if (regularExpression != null) {
    String language=regularExpression.getExpression().getLanguage();
    isJavaEngine=StringUtils.equalsIgnoreCase(language,PatternLanguageType.JAVA.getName());
    buttonJava.setSelection(isJavaEngine);
    buttonSql.setEnabled(!isJavaEngine);
    buttonSql.setSelection(!isJavaEngine);
    dbCombo.setEnabled(buttonSql.getSelection());
  }
}
Program: 138520
Project: 138520
Buggy source:
@Override public void openEditor(Item item){
  PatternItemEditorInput analysisEditorInput=new PatternItemEditorInput(item);
  CorePlugin.getDefault().openEditor(analysisEditorInput,PatternEditor.class.getName());
}

Fixed version (ground truth):
@Override public void openEditor(Item item){
  TDQPatternItem patternItem=(TDQPatternItem)item;
  String subfolderPath=patternItem.getState().getPath();
  String folderPath=ResourceManager.getIndicatorFolder().getFullPath().toString();
  Path path=new Path(folderPath);
  Path append=(Path)path.append(new Path(subfolderPath)).append(new Path(patternItem.getFilename()));
  IPath removeLastSegments=append.removeFirstSegments(1);
  IFile fileEditorInput=ResourceManager.getRootProject().getFile(removeLastSegments);
  try {
    IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(),fileEditorInput,true);
  }
 catch (  PartInitException e) {
    log.error(e,e);
  }
}
Program: 138521
Project: 138521
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj instanceof AbstractItemEditorInput) {
    AbstractItemEditorInput other=(AbstractItemEditorInput)obj;
    return StringUtils.equals(item.getProperty().getLabel(),other.item.getProperty().getLabel());
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj instanceof AbstractItemEditorInput) {
    AbstractItemEditorInput other=(AbstractItemEditorInput)obj;
    boolean isEqualsId=item.getProperty().getId().equals(other.item.getProperty().getId());
    if (isEqualsId) {
      if (StringUtils.equals(item.getProperty().getLabel(),other.item.getProperty().getLabel())) {
        if (item.getProperty().getVersion().equals(other.item.getProperty().getVersion())) {
          return true;
        }
      }
    }
 else     return false;
  }
  return false;
}
Program: 138522
Project: 138522
Buggy source:
@Override public void openEditor(Item item){
  AnalysisItemEditorInput analysisEditorInput=new AnalysisItemEditorInput(item);
  DBConnectionRepNode connectionRepNode=getParameter().getConnectionRepNode();
  analysisEditorInput.setConnectionNode(connectionRepNode);
  CorePlugin.getDefault().openEditor(analysisEditorInput,AnalysisEditor.class.getName());
}

Fixed version (ground truth):
@Override public void openEditor(Item item){
  TDQAnalysisItem anaItem=(TDQAnalysisItem)item;
  String folderPath=anaItem.getState().getPath();
  Path path=new Path(folderPath);
  Path append=(Path)path.append(new Path(anaItem.getFilename()));
  IPath removeLastSegments=append.removeFirstSegments(1);
  IFile fileEditorInput=ResourceManager.getRootProject().getFile(removeLastSegments);
  try {
    IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(),fileEditorInput,true);
  }
 catch (  PartInitException e) {
    log.error(e,e);
  }
}
Program: 138523
Project: 138523
Buggy source:
@Override public void openEditor(Item item){
  BusinessRuleItemEditorInput dqRuleEditorInput=new BusinessRuleItemEditorInput(item);
  CorePlugin.getDefault().openEditor(dqRuleEditorInput,DQRuleEditor.class.getName());
}

Fixed version (ground truth):
@Override public void openEditor(Item item){
  TDQBusinessRuleItem ruleItem=(TDQBusinessRuleItem)item;
  String folderPath=ruleItem.getState().getPath();
  if (folderPath.equals("String_Node_Str")) {
    folderPath=ResourceManager.getRulesSQLFolder().toString();
  }
  Path path=new Path(folderPath);
  Path append=(Path)path.append(new Path(ruleItem.getFilename()));
  IPath removeLastSegments=append.removeFirstSegments(2);
  IFile fileEditorInput=ResourceManager.getRootProject().getFile(removeLastSegments);
  try {
    IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(),fileEditorInput,true);
  }
 catch (  PartInitException e) {
    log.error(e,e);
  }
}