nus-yam/ex-repair huggingface dataset:
Program: 136521
Project: 136521
Buggy source:
/** 
 * check if the nameText is a dupilcate name.
 * @return
 */
protected ReturnCode canModifyName(ERepositoryObjectType objectType){
  String elementName=this.nameText.getText();
  Property oldProperty=null;
  oldProperty=getProperty();
  ReturnCode ret=new ReturnCode();
  if (oldProperty == null || objectType == null) {
    return ret;
  }
  if (PluginConstant.EMPTY_STRING.equals(elementName.trim())) {
    this.nameText.setText(oldProperty.getDisplayName());
    ret.setReturnCode(NAMECONNOTBEEMPTY,false);
    return ret;
  }
  boolean exist=PropertyHelper.existDuplicateName(elementName,oldProperty.getDisplayName(),objectType);
  if (exist) {
    Property duplicateObject=PropertyHelper.getDuplicateObject(elementName,objectType);
    IPath path=PropertyHelper.getItemPath(duplicateObject);
    if (duplicateObject.getItem().getState().isDeleted()) {
      path=new Path(path.segment(0)).append(new Path("String_Node_Str")).append(path.lastSegment());
    }
    ret.setReturnCode(DefaultMessagesImpl.getString("String_Node_Str",elementName,path.toOSString()),false);
    return ret;
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * check if the nameText is a dupilcate name.
 * @return
 */
protected ReturnCode canModifyName(ERepositoryObjectType objectType){
  String elementName=this.nameText.getText();
  Property oldProperty=null;
  oldProperty=getProperty();
  ReturnCode ret=new ReturnCode();
  if (oldProperty == null || objectType == null) {
    return ret;
  }
  if (PluginConstant.EMPTY_STRING.equals(elementName.trim())) {
    this.nameText.setText(oldProperty.getDisplayName());
    String NAMECONNOTBEEMPTY=DefaultMessagesImpl.getString("String_Node_Str");
    ret.setReturnCode(NAMECONNOTBEEMPTY,false);
    return ret;
  }
  boolean exist=PropertyHelper.existDuplicateName(elementName,oldProperty.getDisplayName(),objectType);
  if (exist) {
    Property duplicateObject=PropertyHelper.getDuplicateObject(elementName,objectType);
    IPath path=PropertyHelper.getItemPath(duplicateObject);
    if (duplicateObject.getItem().getState().isDeleted()) {
      path=new Path(path.segment(0)).append(new Path("String_Node_Str")).append(path.lastSegment());
    }
    ret.setReturnCode(DefaultMessagesImpl.getString("String_Node_Str",elementName,path.toOSString()),false);
    return ret;
  }
  return ret;
}
Program: 136523
Project: 136523
Buggy source:
private void createCatalogTableColumns(Table table){
  TableColumn tableColumn=new TableColumn(table,SWT.LEFT | SWT.FILL);
  tableColumn.setText(CATALOG);
  tableColumn.setWidth(COL1_WIDTH);
  createNbRowsCol(table,CATALOG);
  createCommonStatisticalColumns(table);
}

Fixed version (ground truth):
private void createCatalogTableColumns(Table table){
  TableColumn tableColumn=new TableColumn(table,SWT.LEFT | SWT.FILL);
  tableColumn.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  tableColumn.setWidth(COL1_WIDTH);
  createNbRowsCol(table,DefaultMessagesImpl.getString("String_Node_Str"));
  createCommonStatisticalColumns(table);
}
Program: 136524
Project: 136524
Buggy source:
private void createCatalogSchemaColumns(Table table){
  TableColumn tableColumn=new TableColumn(table,SWT.LEFT);
  tableColumn.setText(CATALOG);
  tableColumn.setWidth(COL1_WIDTH);
  createNbRowsCol(table,CATALOG);
  tableColumn=new TableColumn(table,SWT.LEFT);
  tableColumn.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  tableColumn.setWidth(COL_WIDTH);
  tableColumn=new TableColumn(table,SWT.LEFT);
  tableColumn.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  tableColumn.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  tableColumn.setWidth(COL_WIDTH);
  createCommonStatisticalColumns(table);
}

Fixed version (ground truth):
private void createCatalogSchemaColumns(Table table){
  TableColumn tableColumn=new TableColumn(table,SWT.LEFT);
  tableColumn.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  tableColumn.setWidth(COL1_WIDTH);
  createNbRowsCol(table,DefaultMessagesImpl.getString("String_Node_Str"));
  tableColumn=new TableColumn(table,SWT.LEFT);
  tableColumn.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  tableColumn.setWidth(COL_WIDTH);
  tableColumn=new TableColumn(table,SWT.LEFT);
  tableColumn.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  tableColumn.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  tableColumn.setWidth(COL_WIDTH);
  createCommonStatisticalColumns(table);
}
Program: 136525
Project: 136525
Buggy source:
private void createSchemaTableColumns(Table table){
  TableColumn tableColumn=new TableColumn(table,SWT.LEFT);
  tableColumn.setText(SCHEMA);
  tableColumn.setWidth(COL1_WIDTH);
  createNbRowsCol(table,SCHEMA);
  createCommonStatisticalColumns(table);
}

Fixed version (ground truth):
private void createSchemaTableColumns(Table table){
  TableColumn tableColumn=new TableColumn(table,SWT.LEFT);
  tableColumn.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  tableColumn.setWidth(COL1_WIDTH);
  createNbRowsCol(table,DefaultMessagesImpl.getString("String_Node_Str"));
  createCommonStatisticalColumns(table);
}
Program: 136527
Project: 136527
Buggy source:
/** 
 * DOC xqliu Comment method "addJoinElement".
 * @return
 */
public JoinElement addJoinElement(){
  JoinElement newJoinElement=RulesFactory.eINSTANCE.createJoinElement();
  newJoinElement.setOperator(DEFAULT_OPERATOR);
  this.myTableViewer.add(newJoinElement);
  this.myJoinElement.add(newJoinElement);
  this.masterPage.setDirty(true);
  return newJoinElement;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "addJoinElement".
 * @return
 */
public JoinElement addJoinElement(){
  JoinElement newJoinElement=RulesFactory.eINSTANCE.createJoinElement();
  newJoinElement.setOperator(PluginConstant.DEFAULT_OPERATOR);
  this.myTableViewer.add(newJoinElement);
  this.myJoinElement.add(newJoinElement);
  this.masterPage.setDirty(true);
  return newJoinElement;
}
Program: 136528
Project: 136528
Buggy source:
public Object getValue(Object element,String property){
  int columnIndex=columeNames.indexOf(property);
  Object result=null;
  JoinElement join=(JoinElement)element;
  TdColumn colA=(TdColumn)join.getColA();
  TdColumn colB=(TdColumn)join.getColB();
  ColumnSet tabA=colA == null ? null : ColumnHelper.getColumnSetOwner(colA);
  ColumnSet tabB=colB == null ? null : ColumnHelper.getColumnSetOwner(colB);
switch (columnIndex) {
case 0:
    result=tabA == null ? "String_Node_Str" : tabA.getName();
  break;
case 1:
result=join.getTableAliasA() == null ? "String_Node_Str" : join.getTableAliasA();
break;
case 2:
result=colA == null ? "String_Node_Str" : colA.getName();
break;
case 3:
String stringValue=join.getOperator();
int i=OPERATORS.length - 1;
while (!stringValue.equals(OPERATORS[i]) && i > 0) {
--i;
}
result=new Integer(i);
break;
case 4:
result=tabB == null ? "String_Node_Str" : tabB.getName();
break;
case 5:
result=join.getTableAliasB() == null ? "String_Node_Str" : join.getTableAliasB();
break;
case 6:
result=colB == null ? "String_Node_Str" : colB.getName();
break;
default :
result="String_Node_Str";
}
return result;
}

Fixed version (ground truth):
public Object getValue(Object element,String property){
  int columnIndex=columeNames.indexOf(property);
  Object result=null;
  JoinElement join=(JoinElement)element;
  TdColumn colA=(TdColumn)join.getColA();
  TdColumn colB=(TdColumn)join.getColB();
  ColumnSet tabA=colA == null ? null : ColumnHelper.getColumnSetOwner(colA);
  ColumnSet tabB=colB == null ? null : ColumnHelper.getColumnSetOwner(colB);
switch (columnIndex) {
case 0:
    result=tabA == null ? "String_Node_Str" : tabA.getName();
  break;
case 1:
result=join.getTableAliasA() == null ? "String_Node_Str" : join.getTableAliasA();
break;
case 2:
result=colA == null ? "String_Node_Str" : colA.getName();
break;
case 3:
String stringValue=join.getOperator();
int i=PluginConstant.OPERATORS.length - 1;
while (!stringValue.equals(PluginConstant.OPERATORS[i]) && i > 0) {
--i;
}
result=new Integer(i);
break;
case 4:
result=tabB == null ? "String_Node_Str" : tabB.getName();
break;
case 5:
result=join.getTableAliasB() == null ? "String_Node_Str" : join.getTableAliasB();
break;
case 6:
result=colB == null ? "String_Node_Str" : colB.getName();
break;
default :
result="String_Node_Str";
}
return result;
}
Program: 136529
Project: 136529
Buggy source:
public void modify(Object element,String property,Object value){
  int columnIndex=this.columeNames.indexOf(property);
  TableItem tableItem=(TableItem)element;
  if (tableItem != null) {
    JoinElement join=(JoinElement)tableItem.getData();
    if (join != null) {
      String valueString=String.valueOf(value).trim();
switch (columnIndex) {
case 1:
        join.setTableAliasA(valueString);
      break;
case 3:
    valueString=OPERATORS[((Integer)value).intValue()].trim();
  if (!join.getOperator().equals(valueString)) {
    join.setOperator(valueString);
  }
join.setOperator(valueString);
break;
case 5:
join.setTableAliasB(valueString);
break;
default :
}
tableViewer.update(join,null);
JoinConditionTableViewer.this.masterPage.setDirty(true);
}
}
}

Fixed version (ground truth):
public void modify(Object element,String property,Object value){
  int columnIndex=this.columeNames.indexOf(property);
  TableItem tableItem=(TableItem)element;
  if (tableItem != null) {
    JoinElement join=(JoinElement)tableItem.getData();
    if (join != null) {
      String valueString=String.valueOf(value).trim();
switch (columnIndex) {
case 1:
        join.setTableAliasA(valueString);
      break;
case 3:
    valueString=PluginConstant.OPERATORS[((Integer)value).intValue()].trim();
  if (!join.getOperator().equals(valueString)) {
    join.setOperator(valueString);
  }
join.setOperator(valueString);
break;
case 5:
join.setTableAliasB(valueString);
break;
default :
}
tableViewer.update(join,null);
JoinConditionTableViewer.this.masterPage.setDirty(true);
}
}
}
Program: 136531
Project: 136531
Buggy source:
/** 
 * DOC xqliu Comment method "createAddButton".
 * @param parent top composite
 */
private void createAddButton(Composite parent){
  final Button addButton=new Button(parent,SWT.NONE);
  addButton.setImage(ImageLib.getImage(ImageLib.ADD_ACTION));
  addButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  GridData labelGd=new GridData();
  labelGd.horizontalAlignment=SWT.CENTER;
  labelGd.widthHint=65;
  addButton.setLayoutData(labelGd);
  addButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      JoinElement newJoinElement=RulesFactory.eINSTANCE.createJoinElement();
      newJoinElement.setOperator(DEFAULT_OPERATOR);
      creatNewJoinElementLine(newJoinElement);
      tempJoinElements.add(newJoinElement);
      joinConditionSection.setExpanded(true);
      setDirty(true);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "createAddButton".
 * @param parent top composite
 */
private void createAddButton(Composite parent){
  final Button addButton=new Button(parent,SWT.NONE);
  addButton.setImage(ImageLib.getImage(ImageLib.ADD_ACTION));
  addButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  GridData labelGd=new GridData();
  labelGd.horizontalAlignment=SWT.CENTER;
  labelGd.widthHint=65;
  addButton.setLayoutData(labelGd);
  addButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      JoinElement newJoinElement=RulesFactory.eINSTANCE.createJoinElement();
      newJoinElement.setOperator(PluginConstant.DEFAULT_OPERATOR);
      creatNewJoinElementLine(newJoinElement);
      tempJoinElements.add(newJoinElement);
      joinConditionSection.setExpanded(true);
      setDirty(true);
    }
  }
);
}
Program: 136532
Project: 136532
Buggy source:
public JoinElement getJoinElement(){
  if (joinElement == null) {
    joinElement=RulesFactory.eINSTANCE.createJoinElement();
    joinElement.setOperator(DEFAULT_OPERATOR);
  }
  return joinElement;
}

Fixed version (ground truth):
public JoinElement getJoinElement(){
  if (joinElement == null) {
    joinElement=RulesFactory.eINSTANCE.createJoinElement();
    joinElement.setOperator(PluginConstant.DEFAULT_OPERATOR);
  }
  return joinElement;
}
Program: 136534
Project: 136534
Buggy source:
public void mouseDown(MouseEvent e){
  List<Indicator> indicatorsList=masterPage.getCurrentModelElement().getResults().getIndicators();
  SelectPatternsWizard wizard=new SelectPatternsWizard(indicatorsList);
  wizard.setFilterType(filterType);
  wizard.setOldTableInputList(ColumnSetAnalysisResultPage.this.tableFilterResult);
  WizardDialog dialog=new WizardDialog(null,wizard);
  dialog.setPageSize(300,400);
  wizard.setContainer(dialog);
  wizard.setWindowTitle(DefaultMessagesImpl.getString("String_Node_Str"));
  if (WizardDialog.OK == dialog.open()) {
    ColumnSetAnalysisResultPage.this.tableFilterResult=wizard.getPatternSelectPage().getTableInputList();
    filterType=wizard.getPatternSelectPage().getFilterType();
    columnsElementViewer.refresh();
  }
}

Fixed version (ground truth):
public void mouseDown(MouseEvent e){
  List<Indicator> indicatorsList=masterPage.getCurrentModelElement().getResults().getIndicators();
  SelectPatternsWizard wizard=new SelectPatternsWizard(indicatorsList);
  wizard.setFilterType(filterType);
  wizard.setOldTableInputList(ColumnSetAnalysisResultPage.this.tableFilterResult.getTableFilterResult());
  WizardDialog dialog=new WizardDialog(null,wizard);
  dialog.setPageSize(300,400);
  wizard.setContainer(dialog);
  wizard.setWindowTitle(DefaultMessagesImpl.getString("String_Node_Str"));
  if (WizardDialog.OK == dialog.open()) {
    ColumnSetAnalysisResultPage.this.tableFilterResult=new TableFilterResult(wizard.getPatternSelectPage().getTableInputList());
    filterType=wizard.getPatternSelectPage().getFilterType();
    columnsElementViewer.refresh();
    redrawController();
  }
}
Program: 136535
Project: 136535
Buggy source:
public List<Map<Integer,RegexpMatchingIndicator>> getTableFilterResult(){
  return tableFilterResult;
}

Fixed version (ground truth):
public List<Map<Integer,RegexpMatchingIndicator>> getTableFilterResult(){
  return tableFilterResult.getTableFilterResult();
}
Program: 136536
Project: 136536
Buggy source:
public void setTableFilterResult(List<Map<Integer,RegexpMatchingIndicator>> tableFilterResult){
  this.tableFilterResult=tableFilterResult;
}

Fixed version (ground truth):
public void setTableFilterResult(List<Map<Integer,RegexpMatchingIndicator>> tableFilterResult){
  this.tableFilterResult=new TableFilterResult(tableFilterResult);
}
Program: 136539
Project: 136539
Buggy source:
/** 
 * zshen Comment method "getMatchColor".
 * @param element
 * @param columnIndex
 * @return get the color of the element.
 */
private Color getMatchColor(Object element,int columnIndex){
  if (tableFilterResult != null) {
    for (    Map<Integer,RegexpMatchingIndicator> tableItem : this.tableFilterResult) {
      RegexpMatchingIndicator regMatIndicator=tableItem.get(columnIndex);
      if (regMatIndicator == null) {
        continue;
      }
      String regex=regMatIndicator.getRegex();
      Pattern p=java.util.regex.Pattern.compile(regex);
      if (element instanceof Object[]) {
        Object theElement=((Object[])element)[columnIndex];
        if (theElement == null) {
          theElement="String_Node_Str";
        }
        Matcher m=p.matcher(String.valueOf(theElement));
        if (!m.find()) {
          return new Color(null,255,0,0);
        }
      }
    }
  }
  return new Color(null,0,0,0);
}

Fixed version (ground truth):
/** 
 * zshen Comment method "getMatchColor".
 * @param element
 * @param columnIndex
 * @return get the color of the element.
 */
private Color getMatchColor(Object element,int columnIndex){
  if (tableFilterResult.getTableFilterResult() != null) {
    for (    Map<Integer,RegexpMatchingIndicator> tableItem : this.tableFilterResult.getTableFilterResult()) {
      RegexpMatchingIndicator regMatIndicator=tableItem.get(columnIndex);
      if (regMatIndicator == null) {
        continue;
      }
      String regex=regMatIndicator.getRegex();
      Pattern p=java.util.regex.Pattern.compile(regex);
      if (element instanceof Object[]) {
        Object theElement=((Object[])element)[columnIndex];
        if (theElement == null) {
          theElement="String_Node_Str";
        }
        Matcher m=p.matcher(String.valueOf(theElement));
        if (!m.find()) {
          return new Color(null,255,0,0);
        }
      }
    }
  }
  return new Color(null,0,0,0);
}
Program: 136540
Project: 136540
Buggy source:
/** 
 * DOC xqliu Comment method "saveNumberOfConnectionsPerAnalysis".
 * @throws DataprofilerCoreException
 */
protected void saveNumberOfConnectionsPerAnalysis() throws DataprofilerCoreException {
  String numberStr=numberOfConnectionsPerAnalysisText.getText().trim();
  if (StringUtils.isBlank(numberStr) || Integer.parseInt(numberStr) == 0) {
    throw new DataprofilerCoreException(DefaultMessagesImpl.getString("String_Node_Str",DefaultMessagesImpl.getString("String_Node_Str")));
  }
  TaggedValueHelper.setTaggedValue(getCurrentModelElement(),TdqAnalysisConnectionPool.NUMBER_OF_CONNECTIONS_PER_ANALYSIS,this.numberOfConnectionsPerAnalysisText.getText());
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "saveNumberOfConnectionsPerAnalysis".
 * @throws DataprofilerCoreException
 */
protected void saveNumberOfConnectionsPerAnalysis() throws DataprofilerCoreException {
  String numberStr=numberOfConnectionsPerAnalysisText.getText().trim();
  if (StringUtils.isBlank(numberStr) || Integer.parseInt(ContextHelper.getAnalysisContextValue(getCurrentModelElement(),numberStr)) == 0) {
    throw new DataprofilerCoreException(DefaultMessagesImpl.getString("String_Node_Str",DefaultMessagesImpl.getString("String_Node_Str")));
  }
  TaggedValueHelper.setTaggedValue(getCurrentModelElement(),TdqAnalysisConnectionPool.NUMBER_OF_CONNECTIONS_PER_ANALYSIS,this.numberOfConnectionsPerAnalysisText.getText());
}
Program: 136541
Project: 136541
Buggy source:
/** 
 * change Column Color By Current selected Keys.
 * @param currentMatchKeyColumn
 */
protected void changeColumnColorByCurrentKeys(List<String> currentKeyColumn,boolean isMatchKey){
  if (currentKeyColumn == null || currentKeyColumn.size() < 1) {
    setAllColumnColorToBlack();
    return;
  }
  String keyName=isMatchKey ? DataSampleTable.MATCH_EKY : DataSampleTable.BLOCK_EKY;
  for (  ModelElement column : getSelectedColumnsFromHandler()) {
    if (currentKeyColumn.contains(column.getName())) {
      sampleTable.changeColumnHeaderLabelColor(column.getName(),isMatchKey ? DataSampleTable.COLOR_RED : DataSampleTable.COLOR_GREEN,keyName);
    }
 else {
      sampleTable.changeColumnHeaderLabelColor(column.getName(),DataSampleTable.COLOR_BLACK,keyName);
    }
  }
  sampleTable.setNatTableFont(sampleTable.getNatTable());
  sampleTable.refresh();
}

Fixed version (ground truth):
/** 
 * change Column Color By Current selected Keys.
 * @param currentMatchKeyColumn
 */
protected void changeColumnColorByCurrentKeys(List<String> currentKeyColumn,boolean isMatchKey){
  if (currentKeyColumn == null || currentKeyColumn.size() < 1) {
    setAllColumnColorToBlack();
    return;
  }
  String keyName=isMatchKey ? DataSampleTable.MATCH_EKY : DataSampleTable.BLOCK_EKY;
  for (  ModelElement column : getSelectedColumnsFromHandler()) {
    if (currentKeyColumn.contains(column.getName())) {
      sampleTable.changeColumnHeaderLabelColor(column.getName(),isMatchKey ? GUIHelper.COLOR_RED : GUIHelper.COLOR_GREEN,keyName);
    }
 else {
      sampleTable.changeColumnHeaderLabelColor(column.getName(),GUIHelper.COLOR_BLACK,keyName);
    }
  }
  sampleTable.setNatTableFont(sampleTable.getNatTable());
  sampleTable.refresh();
}
Program: 136542
Project: 136542
Buggy source:
/** 
 * handle the add/delete column for the BlockKey Selection.
 * @param columnName
 */
private void handleBlockKeySelection(String columnName){
  Boolean isAdded=Boolean.FALSE;
  try {
    isAdded=this.blockingKeySection.isKeyDefinitionAdded(columnName);
  }
 catch (  Exception e) {
    log.error(e.getMessage());
  }
  if (isAdded) {
    blockingKeySection.removeBlockingKey(columnName);
    sampleTable.changeColumnHeaderLabelColor(columnName,DataSampleTable.COLOR_BLACK,DataSampleTable.BLOCK_EKY);
  }
 else {
    blockingKeySection.createBlockingKey(columnName);
    sampleTable.changeColumnHeaderLabelColor(columnName,DataSampleTable.COLOR_GREEN,DataSampleTable.BLOCK_EKY);
  }
}

Fixed version (ground truth):
/** 
 * handle the add/delete column for the BlockKey Selection.
 * @param columnName
 */
private void handleBlockKeySelection(String columnName){
  Boolean isAdded=Boolean.FALSE;
  try {
    isAdded=this.blockingKeySection.isKeyDefinitionAdded(columnName);
  }
 catch (  Exception e) {
    log.error(e.getMessage());
  }
  if (isAdded) {
    blockingKeySection.removeBlockingKey(columnName);
    sampleTable.changeColumnHeaderLabelColor(columnName,GUIHelper.COLOR_BLACK,DataSampleTable.BLOCK_EKY);
  }
 else {
    blockingKeySection.createBlockingKey(columnName);
    sampleTable.changeColumnHeaderLabelColor(columnName,GUIHelper.COLOR_GREEN,DataSampleTable.BLOCK_EKY);
  }
}
Program: 136543
Project: 136543
Buggy source:
private void setAllColumnColorToBlack(){
  for (  ModelElement column : getSelectedColumnsFromHandler()) {
    sampleTable.changeColumnHeaderLabelColor(column.getName(),DataSampleTable.COLOR_BLACK,PluginConstant.EMPTY_STRING);
  }
  sampleTable.setNatTableFont(sampleTable.getNatTable());
  sampleTable.refresh();
}

Fixed version (ground truth):
private void setAllColumnColorToBlack(){
  for (  ModelElement column : getSelectedColumnsFromHandler()) {
    sampleTable.changeColumnHeaderLabelColor(column.getName(),GUIHelper.COLOR_BLACK,PluginConstant.EMPTY_STRING);
  }
  sampleTable.setNatTableFont(sampleTable.getNatTable());
  sampleTable.refresh();
}
Program: 136544
Project: 136544
Buggy source:
/** 
 * handle the add/remove column for the Match Key Selection.
 * @param columnName
 */
private void handleMatchKeySelection(String columnName){
  try {
    Boolean isAdded=isKeyAlreadyAdded(columnName);
    if (isAdded) {
      removeCurrentKeyFromCurrentMatchRule(columnName);
      sampleTable.changeColumnHeaderLabelColor(columnName,DataSampleTable.COLOR_BLACK,DataSampleTable.MATCH_EKY);
    }
 else {
      addCurrentKeyFromCurrentMatchRule(columnName);
      sampleTable.changeColumnHeaderLabelColor(columnName,DataSampleTable.COLOR_RED,DataSampleTable.MATCH_EKY);
    }
  }
 catch (  Exception e) {
    log.error(e,e);
    MessageDialog.openWarning(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
  }
}

Fixed version (ground truth):
/** 
 * handle the add/remove column for the Match Key Selection.
 * @param columnName
 */
private void handleMatchKeySelection(String columnName){
  try {
    Boolean isAdded=isKeyAlreadyAdded(columnName);
    if (isAdded) {
      removeCurrentKeyFromCurrentMatchRule(columnName);
      sampleTable.changeColumnHeaderLabelColor(columnName,GUIHelper.COLOR_BLACK,DataSampleTable.MATCH_EKY);
    }
 else {
      addCurrentKeyFromCurrentMatchRule(columnName);
      sampleTable.changeColumnHeaderLabelColor(columnName,GUIHelper.COLOR_RED,DataSampleTable.MATCH_EKY);
    }
  }
 catch (  Exception e) {
    log.error(e,e);
    MessageDialog.openWarning(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
  }
}
Program: 136545
Project: 136545
Buggy source:
/** 
 * Create page links "Previous 1 2 ...10 Next" with   {@link GC}.
 * @param parent
 */
private void createRightContainer(Composite parent){
  Composite right=createComposite(parent,SWT.BORDER);
  GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
  if (!keepLeft) {
    gridData=new GridData(SWT.END,SWT.CENTER,true,false,2,1);
    gridData.widthHint=760;
  }
  right.setLayoutData(gridData);
  GridLayout layout=new GridLayout();
  layout.marginHeight=0;
  right.setLayout(layout);
  navigationPage=new ColumnSetNavigationPageGraphics(right,SWT.NONE,configurator){
    @Override protected void handleSelection(    NavigationPageGraphicsItem pageItem){
      Integer newCurrentPage=null;
      if (!pageItem.isEnabled()) {
        return;
      }
      if (pageItem.isNext()) {
        newCurrentPage=getController().getCurrentPage() + 1;
      }
 else       if (pageItem.isPrevious()) {
        newCurrentPage=getController().getCurrentPage() - 1;
      }
 else {
        newCurrentPage=pageItem.getIndex();
      }
      if (newCurrentPage != null) {
        getController().setCurrentPage(newCurrentPage);
      }
    }
  }
;
  navigationPage.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}

Fixed version (ground truth):
/** 
 * Create page links "Previous 1 2 ...10 Next" with   {@link GC}.
 * @param parent
 */
private void createRightContainer(Composite parent){
  Composite right=createComposite(parent,SWT.NONE);
  GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
  if (!keepLeft) {
    gridData=new GridData(SWT.END,SWT.CENTER,true,false,2,1);
    gridData.widthHint=760;
  }
  right.setLayoutData(gridData);
  GridLayout layout=new GridLayout();
  layout.marginHeight=0;
  right.setLayout(layout);
  navigationPage=new ColumnSetNavigationPageGraphics(right,SWT.NONE,configurator){
    @Override protected void handleSelection(    NavigationPageGraphicsItem pageItem){
      Integer newCurrentPage=null;
      if (!pageItem.isEnabled()) {
        return;
      }
      if (pageItem.isNext()) {
        newCurrentPage=getController().getCurrentPage() + 1;
      }
 else       if (pageItem.isPrevious()) {
        newCurrentPage=getController().getCurrentPage() - 1;
      }
 else {
        newCurrentPage=pageItem.getIndex();
      }
      if (newCurrentPage != null) {
        getController().setCurrentPage(newCurrentPage);
      }
    }
  }
;
  navigationPage.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
Program: 136547
Project: 136547
Buggy source:
@Override public boolean setInstantiatedExpression(Expression expression){
  int index=0;
  for (  RowCountIndicator rci : this.rowCountIndiSet) {
    rci.setInstantiatedExpression(expression);
    index++;
  }
  if (index == 0 || index != rowCountIndiSet.size()) {
    return false;
  }
  return super.setInstantiatedExpression(expression);
}

Fixed version (ground truth):
@Override public boolean setInstantiatedExpression(Expression expression){
  int index=0;
  for (  RowCountIndicator rci : this.rowCountIndiSet) {
    TdExpression copySqlExpression=BooleanExpressionHelper.createTdExpression(expression.getLanguage(),expression.getBody());
    rci.setInstantiatedExpression(copySqlExpression);
    index++;
  }
  if (index == 0 || index != rowCountIndiSet.size()) {
    return false;
  }
  return super.setInstantiatedExpression(expression);
}
Program: 136548
Project: 136548
Buggy source:
@Override public List<IRepositoryNode> getChildren(){
  EList<Package> dataPackage=getDfConnection().getDataPackage();
  if (dataPackage != null && dataPackage.size() > 0) {
    Package pack=dataPackage.get(0);
    if (pack instanceof RecordFile) {
      return filterResultsIfAny(createRepositoryNodeSchema());
    }
  }
  return new ArrayList<IRepositoryNode>();
}

Fixed version (ground truth):
@Override public List<IRepositoryNode> getChildren(){
  DelimitedFileConnection dfConnection=getDfConnection();
  if (dfConnection != null) {
    EList<Package> dataPackage=dfConnection.getDataPackage();
    if (dataPackage != null && dataPackage.size() > 0) {
      Package pack=dataPackage.get(0);
      if (pack instanceof RecordFile) {
        return filterResultsIfAny(createRepositoryNodeSchema());
      }
    }
  }
  return new ArrayList<IRepositoryNode>();
}
Program: 136549
Project: 136549
Buggy source:
public DelimitedFileConnection getDfConnection(){
  DelimitedFileConnection dfConnection=null;
  Property property=getObject().getProperty();
  dfConnection=(DelimitedFileConnection)((DelimitedFileConnectionItem)property.getItem()).getConnection();
  return dfConnection;
}

Fixed version (ground truth):
public DelimitedFileConnection getDfConnection(){
  DelimitedFileConnection dfConnection=null;
  Property property=getObject().getProperty();
  Item item=property.getItem();
  if (item instanceof DelimitedFileConnectionItem) {
    dfConnection=(DelimitedFileConnection)((DelimitedFileConnectionItem)item).getConnection();
  }
  return dfConnection;
}
Program: 136550
Project: 136550
Buggy source:
/** 
 * check whether the connection is available.
 * @param datamanager
 * @return boolean
 */
public static boolean checkConnection(DataManager datamanager){
  Connection analysisDataProvider=ConnectionUtils.getConnectionFromDatamanager(datamanager);
  ReturnCode connectionAvailable=isConnectionAvailable(analysisDataProvider);
  if (!connectionAvailable.isOk()) {
    log.error(connectionAvailable.getMessage());
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * check whether the connection is available.
 * @param datamanager
 * @param analysisName
 * @return boolean
 */
public static boolean checkConnection(DataManager datamanager,String analysisName){
  Connection analysisDataProvider=ConnectionUtils.getConnectionFromDatamanager(datamanager);
  ReturnCode connectionAvailable=isConnectionAvailable(analysisDataProvider);
  if (!connectionAvailable.isOk()) {
    log.error(connectionAvailable.getMessage());
    MessageDialogWithToggle.openWarning(Display.getCurrent().getActiveShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str",analysisName));
    return false;
  }
  return true;
}
Program: 136551
Project: 136551
Buggy source:
public List<Object[]> executeQuery(DataManager connection,List<ModelElement> analysedElements,String where) throws SQLException {
  getDataFromTable().clear();
  try {
    beginQuery();
  }
 catch (  Exception e1) {
    log.error(e1.getMessage(),e1);
    return getDataFromTable();
  }
  DelimitedFileConnection delimitedFileconnection=(DelimitedFileConnection)connection;
  String path=JavaSqlFactory.getURL(delimitedFileconnection);
  IPath iPath=new Path(path);
  try {
    File file=iPath.toFile();
    if (!file.exists()) {
      return null;
    }
    if (Escape.CSV.equals(delimitedFileconnection.getEscapeType())) {
      useCsvReader(file,delimitedFileconnection,analysedElements);
    }
 else {
      useFileInputDelimited(analysedElements,delimitedFileconnection);
    }
    endQuery();
  }
 catch (  IOException e) {
    log.error(e.getMessage(),e);
  }
catch (  Exception e) {
    log.error(e.getMessage(),e);
  }
  return getDataFromTable();
}

Fixed version (ground truth):
public List<Object[]> executeQuery(DataManager connection,List<ModelElement> analysedElements,String where) throws SQLException {
  getDataFromTable().clear();
  try {
    beginQuery();
  }
 catch (  Exception e1) {
    log.error(e1.getMessage(),e1);
    return getDataFromTable();
  }
  DelimitedFileConnection delimitedFileconnection=(DelimitedFileConnection)connection;
  String path=JavaSqlFactory.getURL(delimitedFileconnection);
  IPath iPath=new Path(path);
  try {
    File file=iPath.toFile();
    if (!file.exists()) {
      return new ArrayList<Object[]>();
    }
    if (Escape.CSV.equals(delimitedFileconnection.getEscapeType())) {
      useCsvReader(file,delimitedFileconnection,analysedElements);
    }
 else {
      useFileInputDelimited(analysedElements,delimitedFileconnection);
    }
    endQuery();
  }
 catch (  IOException e) {
    log.error(e.getMessage(),e);
  }
catch (  Exception e) {
    log.error(e.getMessage(),e);
  }
  return getDataFromTable();
}
Program: 136552
Project: 136552
Buggy source:
@Override public boolean storeIndicator(String elementToAnalyze,Indicator indicator){
  boolean ok=true;
  final List<Indicator> indicatorLeaves=IndicatorHelper.getIndicatorLeaves(indicator);
  this.allIndicators.addAll(indicatorLeaves);
  for (  Indicator leaf : indicatorLeaves) {
    if (!MultiMapHelper.addUniqueObjectToListMap(elementToAnalyze,leaf,elementToIndicators)) {
      ok=false;
    }
  }
  return ok;
}

Fixed version (ground truth):
@Override public boolean storeIndicator(String elementToAnalyze,Indicator indicator){
  boolean ok=true;
  final List<Indicator> indicatorLeaves=IndicatorHelper.getIndicatorLeaves(indicator);
  for (  Indicator leaf : indicatorLeaves) {
    if (!this.allIndicators.contains(leaf) && !MultiMapHelper.addUniqueObjectToListMap(elementToAnalyze,leaf,elementToIndicators)) {
      ok=false;
    }
  }
  this.allIndicators.addAll(indicatorLeaves);
  return ok;
}
Program: 136553
Project: 136553
Buggy source:
/** 
 * Method "getIndicatorLeaves".
 * @param result
 * @return all the leaf indicators
 */
public static List<Indicator> getIndicatorLeaves(AnalysisResult result){
  List<Indicator> leafIndicators=new ArrayList<Indicator>();
  EList<Indicator> indicators=result.getIndicators();
  for (  Indicator indicator : indicators) {
    leafIndicators.addAll(getIndicatorLeaves(indicator));
  }
  return leafIndicators;
}

Fixed version (ground truth):
/** 
 * Method "getIndicatorLeaves".
 * @param result
 * @return all the leaf indicators
 */
public static List<Indicator> getIndicatorLeaves(AnalysisResult result){
  List<Indicator> leafIndicators=new ArrayList<>();
  EList<Indicator> indicators=result.getIndicators();
  RowCountIndicatorsAdapter.getInstance().clear();
  for (  Indicator indicator : indicators) {
    for (    Indicator indi : getIndicatorLeaves(indicator)) {
      if (!leafIndicators.contains(indi)) {
        leafIndicators.add(indi);
      }
    }
  }
  return leafIndicators;
}
Program: 136554
Project: 136554
Buggy source:
/** 
 * DOC zshen Comment method "getCurrentModelElement".
 */
private ModelElement getCurrentModelElement(){
  IEditorInput editorInput=this.getEditorInput();
  if (editorInput instanceof FileEditorInput) {
    FileEditorInput fileEditorInput=(FileEditorInput)editorInput;
    IFile file=fileEditorInput.getFile();
    if (FactoriesUtil.isDQRuleFile(file.getFileExtension())) {
      return DQRuleResourceFileHelper.getInstance().findIndicatorDefinition(file);
    }
  }
 else   if (editorInput instanceof BusinessRuleItemEditorInput) {
    return ((BusinessRuleItemEditorInput)editorInput).getModel();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "getCurrentModelElement".
 */
private ModelElement getCurrentModelElement(){
  IEditorInput editorInput=this.getEditorInput();
  if (editorInput instanceof FileEditorInput) {
    FileEditorInput fileEditorInput=(FileEditorInput)editorInput;
    IFile file=fileEditorInput.getFile();
    if (FactoriesUtil.isDQRuleFile(file.getFileExtension())) {
      return DQRuleResourceFileHelper.getInstance().findIndicatorDefinition(file);
    }
  }
 else   if (editorInput instanceof BusinessRuleItemEditorInput) {
    return ((BusinessRuleItemEditorInput)editorInput).getModel();
  }
 else   if (editorInput instanceof MatchRuleItemEditorInput) {
    return ((MatchRuleItemEditorInput)editorInput).getMatchRule();
  }
  return null;
}
Program: 136555
Project: 136555
Buggy source:
/** 
 * the modelelement can belong to current project or referenced project.
 * @param analysis
 * @return
 */
private static org.talend.core.model.general.Project getInWhichProject(ModelElement modelElement){
  if (modelElement instanceof DatabaseConnection || modelElement instanceof DelimitedFileConnection) {
    if (modelElement.eIsProxy()) {
      modelElement=(ModelElement)EObjectHelper.resolveObject(modelElement);
    }
    String projectName=modelElement.eResource().getURI().segment(1);
    java.util.Set<Project> allProjects=ProxyRepositoryManager.getInstance().getAllProjects();
    for (    Project project : allProjects) {
      if (project.getTechnicalLabel().equals(projectName)) {
        return project;
      }
    }
  }
  Property property=PropertyHelper.getProperty(modelElement);
  org.talend.core.model.properties.Project project=ProjectManager.getInstance().getProject(property);
  return new org.talend.core.model.general.Project(project);
}

Fixed version (ground truth):
/** 
 * the modelelement can belong to current project or referenced project.
 * @param analysis
 * @return
 */
private static org.talend.core.model.general.Project getInWhichProject(ModelElement modelElement){
  if (modelElement instanceof DatabaseConnection || modelElement instanceof DelimitedFileConnection) {
    if (modelElement.eIsProxy()) {
      modelElement=(ModelElement)EObjectHelper.resolveObject(modelElement);
    }
    String projectName=EObjectHelper.getURI(modelElement).segment(1);
    java.util.Set<Project> allProjects=ProxyRepositoryManager.getInstance().getAllProjects();
    for (    Project project : allProjects) {
      if (project.getTechnicalLabel().equals(projectName)) {
        return project;
      }
    }
  }
  Property property=PropertyHelper.getProperty(modelElement);
  org.talend.core.model.properties.Project project=ProjectManager.getInstance().getProject(property);
  return new org.talend.core.model.general.Project(project);
}
Program: 136556
Project: 136556
Buggy source:
private Boolean setIndicatorDefinition(Indicator indicator,String definitionLabel){
  IndicatorDefinition indicatorDefinition=DefinitionHandler.getInstance().getIndicatorDefinition(definitionLabel);
  if (indicatorDefinition == null) {
    return false;
  }
  indicator.setIndicatorDefinition(indicatorDefinition);
  return true;
}

Fixed version (ground truth):
private Boolean setIndicatorDefinition(Indicator indicator,String definitionLabel){
  if (definitionLabel == null) {
    return false;
  }
  IndicatorDefinition indicatorDefinition=DefinitionHandler.getInstance().getIndicatorDefinition(definitionLabel);
  if (indicatorDefinition == null) {
    return false;
  }
  indicator.setIndicatorDefinition(indicatorDefinition);
  return true;
}
Program: 136559
Project: 136559
Buggy source:
/** 
 * Test method for  {@link org.talend.dataprofiler.ecos.service.EcosystemService#getRevisionList(java.lang.String,java.lang.String)}.
 */
@Test public void testGetRevisionList(){
  try {
    List<RevisionInfo> revisionList=EcosystemService.getRevisionList("String_Node_Str","String_Node_Str");
    Assert.assertTrue("String_Node_Str",revisionList.size() >= 14);
  }
 catch (  Exception e) {
    fail(e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Test method for  {@link org.talend.dataprofiler.ecos.service.EcosystemService#getRevisionList(java.lang.String,java.lang.String)} .
 */
@Test public void testGetRevisionList(){
  try {
    List<RevisionInfo> revisionList=EcosystemService.getRevisionList("String_Node_Str","String_Node_Str");
    Assert.assertTrue("String_Node_Str",revisionList.size() >= 14);
  }
 catch (  Exception e) {
    fail(e.getMessage());
  }
}
Program: 136560
Project: 136560
Buggy source:
/** 
 * Test method for  {@link org.talend.dataprofiler.core.ui.views.provider.ResourceViewLabelProvider#getFileCount(org.eclipse.core.resources.IFolder,java.lang.String[])}
 */
@Test public void testGetFileCount(){
  deleteCurrentProject();
  IFolder anaFolder=initFolder(EResourceConstant.ANALYSIS.getPath());
  IFolder repFolder=initFolder(EResourceConstant.REPORTS.getPath());
  ResourceViewLabelProvider reViewLabelProvider=new ResourceViewLabelProvider();
  int AnalysisNum=reViewLabelProvider.getFileCount(anaFolder,filterExtensions);
  int reportNum=reViewLabelProvider.getFileCount(repFolder,filterExtensions);
  assertEquals(AnalysisNum,3);
  assertEquals(reportNum,3);
}

Fixed version (ground truth):
/** 
 * Test method for  {@link org.talend.dataprofiler.core.ui.views.provider.ResourceViewLabelProvider#getFileCount(org.eclipse.core.resources.IFolder,java.lang.String[])}
 */
@Test public void testGetFileCount(){
  IFolder anaFolder=initFolder(EResourceConstant.ANALYSIS.getPath());
  IFolder repFolder=initFolder(EResourceConstant.REPORTS.getPath());
  ResourceViewLabelProvider reViewLabelProvider=new ResourceViewLabelProvider();
  int AnalysisNum=reViewLabelProvider.getFileCount(anaFolder,filterExtensions);
  int reportNum=reViewLabelProvider.getFileCount(repFolder,filterExtensions);
  assertEquals(AnalysisNum,3);
  assertEquals(reportNum,3);
}
Program: 136561
Project: 136561
Buggy source:
/** 
 * DOC mzhao 2009-06-12 feature 5887 Comment method "removeSupplierDependenciesBetweenModels". This method removes supplier dependencies. See   {@link DependenciesHandler#removeDependenciesBetweenModels(ModelElement,List)}
 * @param elementFromRemove
 * @param elementToRemove
 * @return
 */
public List<Resource> removeSupplierDependenciesBetweenModels(ModelElement elementFromRemove,List<? extends ModelElement> elementToRemove){
  EList<Dependency> supplierDependencies;
  List<Resource> toRemoveResources=new ArrayList<Resource>();
  for (  ModelElement modelElement : elementToRemove) {
    toRemoveResources.add(modelElement.eResource());
  }
  supplierDependencies=elementFromRemove.getSupplierDependency();
  List<Resource> modifiedResources=new ArrayList<Resource>();
  for (  Dependency dependency : supplierDependencies) {
    EList<ModelElement> client=dependency.getClient();
    Iterator<ModelElement> dependencyIterator=client.iterator();
    while (dependencyIterator.hasNext()) {
      Resource clientResource=dependencyIterator.next().eResource();
      if (clientResource != null) {
        if (toRemoveResources.contains(clientResource)) {
          modifiedResources.add(clientResource);
          dependencyIterator.remove();
        }
      }
    }
  }
  return modifiedResources;
}

Fixed version (ground truth):
/** 
 * This method removes supplier dependencies. See  {@link DependenciesHandler#removeDependenciesBetweenModels(ModelElement,List)}
 * @param rule
 * @param analyses
 * @return
 */
public boolean removeSupplierDependenciesBetweenModels(ModelElement rule,List<? extends ModelElement> analyses){
  List<Resource> toRemoveResources=new ArrayList<Resource>();
  for (  ModelElement modelElement : analyses) {
    toRemoveResources.add(modelElement.eResource());
  }
  EList<Dependency> supplierDependencies=rule.getSupplierDependency();
  for (  Dependency dependency : supplierDependencies) {
    EList<ModelElement> client=dependency.getClient();
    Iterator<ModelElement> dependencyIterator=client.iterator();
    while (dependencyIterator.hasNext()) {
      Resource clientResource=dependencyIterator.next().eResource();
      if (clientResource != null) {
        if (toRemoveResources.contains(clientResource)) {
          dependencyIterator.remove();
        }
      }
    }
  }
  return true;
}
Program: 136562
Project: 136562
Buggy source:
/** 
 * DOC zshen Comment method "removeClientDependency".
 * @param client
 * @param supplier
 */
private void removeClientDependency(ModelElement client,ModelElement supplier){
  for (  Dependency dependency : client.getClientDependency()) {
    if (dependency.getKind() != null && USAGE.compareTo(dependency.getKind()) == 0) {
      EObject resolvedObject=ResourceHelper.resolveObject(dependency.getSupplier(),supplier);
      if (resolvedObject != null) {
        client.getClientDependency().remove(dependency);
        return;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "removeClientDependency".
 * @param client
 * @param supplier
 */
public void removeClientDependency(ModelElement client,ModelElement supplier){
  for (  Dependency dependency : client.getClientDependency()) {
    if (dependency.getKind() != null && USAGE.compareTo(dependency.getKind()) == 0) {
      EObject resolvedObject=ResourceHelper.resolveObject(dependency.getSupplier(),supplier);
      if (resolvedObject != null) {
        client.getClientDependency().remove(dependency);
        return;
      }
    }
  }
}
Program: 136563
Project: 136563
Buggy source:
@Override protected ReturnCode removeDependencies(Item item){
  ReturnCode rc=new ReturnCode();
  TDQAnalysisItem anaItem=(TDQAnalysisItem)item;
  Analysis analysis=anaItem.getAnalysis();
  List<Property> clintDependency=DependenciesHandler.getInstance().getClintDependency(anaItem.getProperty());
  List<ModelElement> clientDepListByResultList=getClientDepListByResult(analysis);
  for (  Property currentClient : clintDependency) {
    ModelElement modelElement=PropertyHelper.getModelElement(currentClient);
    if (!clientDepListByResultList.contains(modelElement)) {
      boolean isSuccess=DependenciesHandler.getInstance().removeDependenciesBetweenModel(analysis,modelElement);
      if (isSuccess) {
        try {
          ProxyRepositoryFactory.getInstance().getRepositoryFactoryFromProvider().getResourceManager().saveResource(modelElement.eResource());
        }
 catch (        PersistenceException e) {
          log.error(e,e);
          rc.setOk(false);
          rc.setMessage(e.getMessage());
        }
      }
 else {
        rc.setOk(false);
        rc.setMessage(Messages.getString("String_Node_Str",analysis.getName(),modelElement.getName()));
      }
    }
  }
  return rc;
}

Fixed version (ground truth):
@Override protected ReturnCode removeDependencies(Item item){
  ReturnCode rc=new ReturnCode();
  TDQAnalysisItem anaItem=(TDQAnalysisItem)item;
  Analysis analysis=anaItem.getAnalysis();
  List<Property> clintDependency=DependenciesHandler.getInstance().getClintDependency(anaItem.getProperty());
  List<ModelElement> clientDepListByResultList=DependenciesHandler.getInstance().getClientDepListByResult(analysis);
  for (  Property currentClient : clintDependency) {
    ModelElement modelElement=PropertyHelper.getModelElement(currentClient);
    if (!clientDepListByResultList.contains(modelElement)) {
      boolean isSuccess=DependenciesHandler.getInstance().removeDependenciesBetweenModel(analysis,modelElement);
      if (isSuccess) {
        try {
          ProxyRepositoryFactory.getInstance().getRepositoryFactoryFromProvider().getResourceManager().saveResource(modelElement.eResource());
        }
 catch (        PersistenceException e) {
          log.error(e,e);
          rc.setOk(false);
          rc.setMessage(e.getMessage());
        }
      }
 else {
        rc.setOk(false);
        rc.setMessage(Messages.getString("String_Node_Str",analysis.getName(),modelElement.getName()));
      }
    }
  }
  return rc;
}
Program: 136565
Project: 136565
Buggy source:
private void saveIndicatorDefintion(String uuid,String name) throws PersistenceException {
  IndicatorDefinition createIndicatorDefinition=DefinitionFactory.eINSTANCE.createIndicatorDefinition();
  TDQIndicatorDefinitionItem createTDQIndicatorDefinitionItem=PropertiesFactory.eINSTANCE.createTDQIndicatorDefinitionItem();
  createTDQIndicatorDefinitionItem.setIndicatorDefinition(createIndicatorDefinition);
  Property createProperty=org.talend.core.model.properties.PropertiesFactory.eINSTANCE.createProperty();
  createProperty.setLabel(name);
  createTDQIndicatorDefinitionItem.setProperty(createProperty);
  createProperty.setId(uuid);
  ProxyRepositoryFactory.getInstance().create(createTDQIndicatorDefinitionItem,new Path(ERepositoryObjectType.TDQ_SYSTEM_INDICATORS.getFolder()).removeFirstSegments(2),false);
}

Fixed version (ground truth):
private void saveIndicatorDefintion(String uuid,String name) throws PersistenceException {
  IndicatorDefinition createIndicatorDefinition=DefinitionFactory.eINSTANCE.createIndicatorDefinition();
  TDQIndicatorDefinitionItem createTDQIndicatorDefinitionItem=PropertiesFactory.eINSTANCE.createTDQIndicatorDefinitionItem();
  createTDQIndicatorDefinitionItem.setIndicatorDefinition(createIndicatorDefinition);
  Property createProperty=org.talend.core.model.properties.PropertiesFactory.eINSTANCE.createProperty();
  createProperty.setLabel(name);
  createIndicatorDefinition.setLabel(name);
  createIndicatorDefinition.setName(name);
  createTDQIndicatorDefinitionItem.setProperty(createProperty);
  createProperty.setId(uuid);
  ProxyRepositoryFactory.getInstance().create(createTDQIndicatorDefinitionItem,new Path(ERepositoryObjectType.TDQ_SYSTEM_INDICATORS.getFolder()).removeFirstSegments(2),false);
}