nus-yam/ex-repair huggingface dataset:
Program: 137251
Project: 137251
Buggy source:
@Override public void createPartControl(Composite parent){
  GridLayout layout=new GridLayout();
  parent.setLayoutData(new GridData(GridData.FILL_BOTH));
  parent.setLayout(layout);
  makeAction();
  createCoolBar(parent);
  tableView=new TableViewer(parent,SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
  Table table=tableView.getTable();
  MenuManager popupMenu=new MenuManager();
  popupMenu.add(exportAction);
  Menu menu=popupMenu.createContextMenu(table);
  table.setMenu(menu);
  exportAction.setTable(table);
  GridDataFactory.fillDefaults().grab(true,true).align(SWT.FILL,SWT.FILL).applyTo(table);
  if (this.getEditorInput() instanceof DrillDownEditorInput) {
    DrillDownEditorInput ddEditorInput=(DrillDownEditorInput)this.getEditorInput();
    if (ddEditorInput.getCurrIndicator().isSaveTempDataToFile()) {
      initTableViewerForMapDB(parent,table,ddEditorInput);
    }
 else {
      initTableViewerForJava(table,ddEditorInput);
    }
    for (    TableColumn packColumn : table.getColumns()) {
      packColumn.pack();
    }
  }
}

Fixed version (ground truth):
@Override public void createPartControl(Composite parent){
  GridLayout layout=new GridLayout();
  parent.setLayoutData(new GridData(GridData.FILL_BOTH));
  parent.setLayout(layout);
  makeAction();
  createCoolBar(parent);
  tableView=new TableViewer(parent,SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
  Table table=tableView.getTable();
  MenuManager popupMenu=new MenuManager();
  popupMenu.add(exportAction);
  Menu menu=popupMenu.createContextMenu(table);
  table.setMenu(menu);
  exportAction.setTable(table);
  GridDataFactory.fillDefaults().grab(true,true).align(SWT.FILL,SWT.FILL).applyTo(table);
  if (this.getEditorInput() instanceof DrillDownEditorInput) {
    DrillDownEditorInput ddEditorInput=(DrillDownEditorInput)this.getEditorInput();
    if (ddEditorInput.getCurrIndicator().isUsedMapDBMode()) {
      initTableViewerForMapDB(parent,table,ddEditorInput);
    }
 else {
      initTableViewerForJava(table,ddEditorInput);
    }
    for (    TableColumn packColumn : table.getColumns()) {
      packColumn.pack();
    }
  }
}
Program: 137254
Project: 137254
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void setBlockSize2frequency(TreeMap<Object,Long> newBlockSize2frequency){
  TreeMap<Object,Long> oldBlockSize2frequency=blockSize2frequency;
  blockSize2frequency=newBlockSize2frequency;
  if (eNotificationRequired())   eNotify(new ENotificationImpl(this,Notification.SET,ColumnsetPackage.BLOCK_KEY_INDICATOR__BLOCK_SIZE2FREQUENCY,oldBlockSize2frequency,blockSize2frequency));
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public void setBlockSize2frequency(TreeMap<Object,Long> newBlockSize2frequency){
  TreeMap<Object,Long> oldBlockSize2frequency=blockSize2frequency;
  blockSize2frequency=newBlockSize2frequency;
  if (eNotificationRequired()) {
    eNotify(new ENotificationImpl(this,Notification.SET,ColumnsetPackage.BLOCK_KEY_INDICATOR__BLOCK_SIZE2FREQUENCY,oldBlockSize2frequency,blockSize2frequency));
  }
}
Program: 137255
Project: 137255
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public String toString(){
  if (eIsProxy())   return super.toString();
  StringBuffer result=new StringBuffer(super.toString());
  result.append("String_Node_Str");
  result.append(blockSize2frequency);
  result.append(')');
  return result.toString();
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public String toString(){
  if (eIsProxy()) {
    return super.toString();
  }
  StringBuffer result=new StringBuffer(super.toString());
  result.append("String_Node_Str");
  result.append(blockSize2frequency);
  result.append(')');
  return result.toString();
}
Program: 137256
Project: 137256
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public TreeMap<Object,Long> getBlockSize2frequency(){
  return blockSize2frequency;
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public TreeMap<Object,Long> getBlockSize2frequency(){
  return blockSize2frequency;
}
Program: 137257
Project: 137257
Buggy source:
/** 
 * if the DriverClassName is empty or Jar File Path is invalid return false.
 * @param dbConn a General JDBC database connection
 * @return
 */
public static ReturnCode checkGeneralJdbcJarFilePathDriverClassName(DatabaseConnection dbConn){
  ReturnCode returnCode=new ReturnCode();
  String driverClass=dbConn.getDriverClass();
  String driverJarPath=dbConn.getDriverJarPath();
  if (dbConn.isContextMode()) {
    driverClass=getOriginalConntextValue(dbConn,driverClass);
    driverJarPath=getOriginalConntextValue(dbConn,driverJarPath);
  }
  if (driverClass == null || driverClass.trim().equals("String_Node_Str")) {
    returnCode.setOk(false);
    returnCode.setMessage(Messages.getString("String_Node_Str"));
  }
 else {
    if (driverJarPath == null || driverJarPath.trim().equals("String_Node_Str")) {
      returnCode.setOk(false);
      returnCode.setMessage(Messages.getString("String_Node_Str"));
    }
 else {
      String[] splits=driverJarPath.split("String_Node_Str");
      for (      String str : splits) {
        if (str != null && str.trim().length() > 0) {
          File jarFile=new File(str);
          if (!jarFile.exists() || jarFile.isDirectory()) {
            returnCode.setOk(false);
            returnCode.setMessage(Messages.getString("String_Node_Str"));
            break;
          }
        }
      }
    }
  }
  return returnCode;
}

Fixed version (ground truth):
/** 
 * if the DriverClassName is empty or Jar File Path is invalid return false.
 * @param dbConn a General JDBC database connection
 * @return
 */
public static ReturnCode checkGeneralJdbcJarFilePathDriverClassName(DatabaseConnection dbConn){
  ReturnCode returnCode=new ReturnCode();
  String driverClass=JavaSqlFactory.getDriverClass(dbConn);
  String driverJarPath=JavaSqlFactory.getDriverJarPath(dbConn);
  if (driverClass == null || driverClass.trim().equals("String_Node_Str")) {
    returnCode.setOk(false);
    returnCode.setMessage(Messages.getString("String_Node_Str"));
  }
 else {
    if (driverJarPath == null || driverJarPath.trim().equals("String_Node_Str")) {
      returnCode.setOk(false);
      returnCode.setMessage(Messages.getString("String_Node_Str"));
    }
 else {
      String[] splits=driverJarPath.split("String_Node_Str");
      for (      String str : splits) {
        if (str != null && str.trim().length() > 0) {
          File jarFile=new File(str);
          if (!jarFile.exists() || jarFile.isDirectory()) {
            returnCode.setOk(false);
            returnCode.setMessage(Messages.getString("String_Node_Str"));
            break;
          }
        }
      }
    }
  }
  return returnCode;
}
Program: 137259
Project: 137259
Buggy source:
/** 
 * if the connection has sid return false, else return true (don't need the TaggedValue any more).
 * @param element
 * @return
 */
public static boolean getRetrieveAllMetadata(ModelElement element){
  if (element != null && element instanceof Connection) {
    if (element instanceof DatabaseConnection) {
      DatabaseConnection dbConn=(DatabaseConnection)element;
      String sid=getSID(dbConn);
      if (sid != null && !"String_Node_Str".equals(sid.trim())) {
        TaggedValue taggedValue=TaggedValueHelper.getTaggedValue(TaggedValueHelper.RETRIEVE_ALL,element.getTaggedValue());
        if (taggedValue != null) {
          String value=taggedValue.getValue();
          if (value.equals("String_Node_Str")) {
            return true;
          }
        }
        if (ConnectionHelper.isOracle(dbConn) || isPostgresql(dbConn)) {
          String uiSchema=dbConn.getUiSchema();
          if (uiSchema != null && !"String_Node_Str".equals(uiSchema.trim())) {
            return false;
          }
 else {
            return true;
          }
        }
 else {
          return false;
        }
      }
 else {
        return true;
      }
    }
 else     if (element instanceof MDMConnection) {
      MDMConnection mdmConn=(MDMConnection)element;
      String context=mdmConn.getContext();
      if (context != null && !"String_Node_Str".equals(context.trim())) {
        return false;
      }
 else {
        return true;
      }
    }
 else     if (element instanceof FileConnection) {
      return true;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * if the connection has sid return false, else return true (don't need the TaggedValue any more).
 * @param element
 * @return
 */
public static boolean getRetrieveAllMetadata(ModelElement element){
  if (element != null && element instanceof Connection) {
    if (element instanceof DatabaseConnection) {
      DatabaseConnection dbConn=(DatabaseConnection)element;
      String sid=JavaSqlFactory.getSID(dbConn);
      if (sid != null && !"String_Node_Str".equals(sid.trim())) {
        TaggedValue taggedValue=TaggedValueHelper.getTaggedValue(TaggedValueHelper.RETRIEVE_ALL,element.getTaggedValue());
        if (taggedValue != null) {
          String value=taggedValue.getValue();
          if (value.equals("String_Node_Str")) {
            return true;
          }
        }
        if (ConnectionHelper.isOracle(dbConn) || isPostgresql(dbConn)) {
          String uiSchema=dbConn.getUiSchema();
          if (uiSchema != null && !"String_Node_Str".equals(uiSchema.trim())) {
            return false;
          }
 else {
            return true;
          }
        }
 else {
          return false;
        }
      }
 else {
        return true;
      }
    }
 else     if (element instanceof MDMConnection) {
      MDMConnection mdmConn=(MDMConnection)element;
      String context=mdmConn.getContext();
      if (context != null && !"String_Node_Str".equals(context.trim())) {
        return false;
      }
 else {
        return true;
      }
    }
 else     if (element instanceof FileConnection) {
      return true;
    }
  }
  return true;
}
Program: 137261
Project: 137261
Buggy source:
public List<Object[]> executeQuery(DataManager connection,List<ModelElement> analysedElements){
  dataFromTable.clear();
  try {
    beginQuery();
  }
 catch (  Exception e1) {
    log.error(e1.getMessage(),e1);
    return dataFromTable;
  }
  DelimitedFileConnection delimitedFileconnection=(DelimitedFileConnection)connection;
  String path=AnalysisExecutorHelper.getFilePath(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 {
      int[] analysedColumnIndex=getAnalysedColumnPositionInFileTable(analysedElements,delimitedFileconnection);
      FileInputDelimited fileInputDelimited=AnalysisExecutorHelper.createFileInputDelimited(delimitedFileconnection);
      int index=0;
      while (fileInputDelimited.nextRecord()) {
        index++;
        int columsCount=analysedElements.size();
        String[] rowValues=new String[columsCount];
        for (int i=0; i < columsCount; i++) {
          rowValues[i]=fileInputDelimited.get(analysedColumnIndex[i]);
        }
        handleRow(rowValues);
        if (limit > 0 && index >= limit) {
          break;
        }
      }
      fileInputDelimited.close();
    }
    endQuery();
  }
 catch (  IOException e) {
    log.error(e.getMessage(),e);
  }
catch (  Exception e) {
    log.error(e.getMessage(),e);
  }
  return dataFromTable;
}

Fixed version (ground truth):
public List<Object[]> executeQuery(DataManager connection,List<ModelElement> analysedElements){
  dataFromTable.clear();
  try {
    beginQuery();
  }
 catch (  Exception e1) {
    log.error(e1.getMessage(),e1);
    return dataFromTable;
  }
  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 {
      int[] analysedColumnIndex=getAnalysedColumnPositionInFileTable(analysedElements,delimitedFileconnection);
      FileInputDelimited fileInputDelimited=AnalysisExecutorHelper.createFileInputDelimited(delimitedFileconnection);
      int index=0;
      while (fileInputDelimited.nextRecord()) {
        index++;
        int columsCount=analysedElements.size();
        String[] rowValues=new String[columsCount];
        for (int i=0; i < columsCount; i++) {
          rowValues[i]=fileInputDelimited.get(analysedColumnIndex[i]);
        }
        handleRow(rowValues);
        if (limit > 0 && index >= limit) {
          break;
        }
      }
      fileInputDelimited.close();
    }
    endQuery();
  }
 catch (  IOException e) {
    log.error(e.getMessage(),e);
  }
catch (  Exception e) {
    log.error(e.getMessage(),e);
  }
  return dataFromTable;
}
Program: 137262
Project: 137262
Buggy source:
/** 
 * DOC qiongli Comment method "initializeCsvReader".
 * @param csvReader
 * @param connection
 */
public static void initializeCsvReader(DelimitedFileConnection delimitedFileconnection,CsvReader csvReader){
  String rowSep=delimitedFileconnection.getRowSeparatorValue();
  if (delimitedFileconnection.isContextMode()) {
    rowSep=ConnectionUtils.getOriginalConntextValue(delimitedFileconnection,rowSep);
  }
  if (!rowSep.equals("String_Node_Str") && !rowSep.equals("String_Node_Str")) {
    csvReader.setRecordDelimiter(ParameterUtil.trimParameter(rowSep).charAt(0));
  }
  csvReader.setSkipEmptyRecords(true);
  String textEnclosure=delimitedFileconnection.getTextEnclosure();
  if (textEnclosure != null && textEnclosure.length() > 0) {
    csvReader.setTextQualifier(ParameterUtil.trimParameter(textEnclosure).charAt(0));
  }
 else {
    csvReader.setUseTextQualifier(false);
  }
  String escapeChar=delimitedFileconnection.getEscapeChar();
  if (escapeChar == null || escapeChar.equals("String_Node_Str") || escapeChar.equals("String_Node_Str")) {
    csvReader.setEscapeMode(CsvReader.ESCAPE_MODE_BACKSLASH);
  }
 else {
    csvReader.setEscapeMode(CsvReader.ESCAPE_MODE_DOUBLED);
  }
}

Fixed version (ground truth):
/** 
 * DOC qiongli Comment method "initializeCsvReader".
 * @param csvReader
 * @param connection
 */
public static void initializeCsvReader(DelimitedFileConnection delimitedFileconnection,CsvReader csvReader){
  String rowSep=JavaSqlFactory.getRowSeparatorValue(delimitedFileconnection);
  if (rowSep != null && !rowSep.equals("String_Node_Str") && !rowSep.equals("String_Node_Str")) {
    csvReader.setRecordDelimiter(ParameterUtil.trimParameter(rowSep).charAt(0));
  }
  csvReader.setSkipEmptyRecords(true);
  String textEnclosure=delimitedFileconnection.getTextEnclosure();
  if (textEnclosure != null && textEnclosure.length() > 0) {
    csvReader.setTextQualifier(ParameterUtil.trimParameter(textEnclosure).charAt(0));
  }
 else {
    csvReader.setUseTextQualifier(false);
  }
  String escapeChar=delimitedFileconnection.getEscapeChar();
  if (escapeChar == null || escapeChar.equals("String_Node_Str") || escapeChar.equals("String_Node_Str")) {
    csvReader.setEscapeMode(CsvReader.ESCAPE_MODE_BACKSLASH);
  }
 else {
    csvReader.setEscapeMode(CsvReader.ESCAPE_MODE_DOUBLED);
  }
}
Program: 137264
Project: 137264
Buggy source:
public static CsvReader createCsvReader(File file,DelimitedFileConnection delimitedFileconnection) throws UnsupportedEncodingException, FileNotFoundException {
  String separator=delimitedFileconnection.getFieldSeparatorValue();
  String encoding=delimitedFileconnection.getEncoding();
  if (delimitedFileconnection.isContextMode()) {
    separator=ConnectionUtils.getOriginalConntextValue(delimitedFileconnection,separator);
    encoding=ConnectionUtils.getOriginalConntextValue(delimitedFileconnection,encoding);
  }
  return new CsvReader(new BufferedReader(new InputStreamReader(new java.io.FileInputStream(file),encoding == null ? "String_Node_Str" : encoding)),ParameterUtil.trimParameter(separator).charAt(0));
}

Fixed version (ground truth):
public static CsvReader createCsvReader(File file,DelimitedFileConnection delimitedFileconnection) throws UnsupportedEncodingException, FileNotFoundException {
  String separator=JavaSqlFactory.getFieldSeparatorValue(delimitedFileconnection);
  String encoding=JavaSqlFactory.getEncoding(delimitedFileconnection);
  return new CsvReader(new BufferedReader(new InputStreamReader(new java.io.FileInputStream(file),encoding == null ? "String_Node_Str" : encoding)),ParameterUtil.trimParameter(separator).charAt(0));
}
Program: 137265
Project: 137265
Buggy source:
private void useCsvReader(CsvReader csvReader,File file,DelimitedFileConnection dfCon,List<ModelElement> analysisElementList) throws Exception {
  AnalysisExecutorHelper.initializeCsvReader(dfCon,csvReader);
  long currentRecord=0;
  int limitValue=AnalysisExecutorHelper.getLimitValue(dfCon);
  while (csvReader.readRecord()) {
    currentRecord=csvReader.getCurrentRecord();
    if (!continueRun() || limitValue != 0 && currentRecord > limitValue - 1) {
      break;
    }
    if (dfCon.isFirstLineCaption() && currentRecord == 0) {
      continue;
    }
    String[] rowValues=csvReader.getValues();
    this.orgnizeObjectsToHandel(dfCon.getFilePath(),rowValues,currentRecord + 1,analysisElementList,dfCon.getFieldSeparatorValue());
  }
}

Fixed version (ground truth):
private void useCsvReader(CsvReader csvReader,File file,DelimitedFileConnection dfCon,List<ModelElement> analysisElementList) throws Exception {
  AnalysisExecutorHelper.initializeCsvReader(dfCon,csvReader);
  long currentRecord=0;
  int limitValue=JavaSqlFactory.getLimitValue(dfCon);
  while (csvReader.readRecord()) {
    currentRecord=csvReader.getCurrentRecord();
    if (!continueRun() || limitValue != 0 && currentRecord > limitValue - 1) {
      break;
    }
    if (dfCon.isFirstLineCaption() && currentRecord == 0) {
      continue;
    }
    String[] rowValues=csvReader.getValues();
    this.orgnizeObjectsToHandel(dfCon.getFilePath(),rowValues,currentRecord + 1,analysisElementList,dfCon.getFieldSeparatorValue());
  }
}
Program: 137269
Project: 137269
Buggy source:
@Override public double getMatchingWeight(String[] record1,String[] record2){
  double result=0;
  for (int j=0; j < getUsedIndicesNotblocked().length; j++) {
    int usedIdx=usedIndicesNotblocked[j];
    double pa=computeMatchingWeight(usedIdx,record1,record2);
    result+=pa * attributeWeights[usedIdx];
  }
  return result;
}

Fixed version (ground truth):
@Override public double getMatchingWeight(String[] record1,String[] record2){
  double result=0;
  if (blockedIndices != null) {
    for (int i=0; i < super.blockedIndices.length; i++) {
      int blockedIdx=blockedIndices[i];
      double pa=computeMatchingWeight(blockedIdx,record1,record2);
      if (pa < super.blockingThreshold) {
        return 0;
      }
      result+=pa * attributeWeights[blockedIdx];
    }
  }
  for (int j=0; j < getUsedIndicesNotblocked().length; j++) {
    int usedIdx=usedIndicesNotblocked[j];
    double pa=computeMatchingWeight(usedIdx,record1,record2);
    result+=pa * attributeWeights[usedIdx];
  }
  return result;
}
Program: 137270
Project: 137270
Buggy source:
@Override public boolean handle(Object data){
  String[] values=(String[])data;
  Boolean isMaster=Boolean.valueOf(values[masterColumnIndex]);
  Integer groupSize=Integer.valueOf(values[groupSizeColumnIndex]);
  if (isMaster) {
    if (null == groupSize2groupFrequency.get(values[groupSizeColumnIndex])) {
      groupSize2groupFrequency.put(values[groupSizeColumnIndex],1l);
    }
 else {
      long freq=groupSize2groupFrequency.get(values[groupSizeColumnIndex]) + 1;
      groupSize2groupFrequency.put(values[groupSizeColumnIndex],freq);
    }
    if (builtInMatchRuleDefinition != null && groupSize > 1) {
      double groupScore=Double.valueOf(values[groupQualityColumnIndex]);
      double confidenceThreshold=builtInMatchRuleDefinition.getMatchGroupQualityThreshold();
      if (groupScore >= confidenceThreshold) {
        matchedRecordCount=matchedRecordCount + groupSize;
      }
 else {
        suspectRecordCount=suspectRecordCount + groupSize;
      }
    }
  }
  if (T_SWOOSH_ALG_NAME.equals(getBuiltInMatchRuleDefinition().getRecordLinkageAlgorithm())) {
    if (!(isMaster && groupSize > 1)) {
      count++;
    }
  }
 else {
    count++;
  }
  return Boolean.TRUE;
}

Fixed version (ground truth):
@Override public boolean handle(Object data){
  String[] values=(String[])data;
  Boolean isMaster=Boolean.valueOf(values[masterColumnIndex]);
  Integer groupSize=StringUtils.isEmpty(values[groupSizeColumnIndex]) ? 0 : Integer.valueOf(values[groupSizeColumnIndex]);
  if (isMaster) {
    if (null == groupSize2groupFrequency.get(values[groupSizeColumnIndex])) {
      groupSize2groupFrequency.put(values[groupSizeColumnIndex],1l);
    }
 else {
      long freq=groupSize2groupFrequency.get(values[groupSizeColumnIndex]) + 1;
      groupSize2groupFrequency.put(values[groupSizeColumnIndex],freq);
    }
    if (builtInMatchRuleDefinition != null && groupSize > 1) {
      double groupScore=Double.valueOf(values[groupQualityColumnIndex]);
      double confidenceThreshold=builtInMatchRuleDefinition.getMatchGroupQualityThreshold();
      if (groupScore >= confidenceThreshold) {
        matchedRecordCount=matchedRecordCount + groupSize;
      }
 else {
        suspectRecordCount=suspectRecordCount + groupSize;
      }
    }
  }
  if (T_SWOOSH_ALG_NAME.equals(getBuiltInMatchRuleDefinition().getRecordLinkageAlgorithm())) {
    if (!(isMaster && groupSize > 1)) {
      count++;
    }
  }
 else {
    count++;
  }
  return Boolean.TRUE;
}
Program: 137276
Project: 137276
Buggy source:
@Override protected void createFormContent(IManagedForm managedForm){
  this.form=managedForm.getForm();
  Composite body=form.getBody();
  body.setLayout(new GridLayout());
  sForm=new SashForm(body,SWT.NULL);
  sForm.setLayoutData(new GridData(GridData.FILL_BOTH));
  topComp=toolkit.createComposite(sForm);
  topComp.setLayoutData(new GridData(GridData.FILL_BOTH));
  topComp.setLayout(new GridLayout());
  metadataSection=creatMetadataSection(form,topComp);
  metadataSection.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  metadataSection.setDescription(DefaultMessagesImpl.getString("String_Node_Str"));
  form.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  createAnalysisColumnsSection(form,topComp);
  createIndicatorsSection(form,topComp);
  createDataFilterSection(form,topComp);
  dataFilterComp.addPropertyChangeListener(this);
  Composite exeEngineComp=createExecuteEngineSection(form,topComp,analyzedColumns,columnSetAnalysisHandler.getAnalysis().getParameters());
  createStoreDataCheck(exeEngineComp);
  if (!EditorPreferencePage.isHideGraphics()) {
    previewComp=toolkit.createComposite(sForm);
    previewComp.setLayoutData(new GridData(GridData.FILL_BOTH));
    previewComp.setLayout(new GridLayout());
    previewComp.addControlListener(new ControlAdapter(){
      @Override public void controlResized(      ControlEvent e){
        super.controlResized(e);
        sForm.redraw();
        form.reflow(true);
      }
    }
);
    createPreviewSection(form,previewComp);
  }
}

Fixed version (ground truth):
@Override protected void createFormContent(IManagedForm managedForm){
  this.form=managedForm.getForm();
  Composite body=form.getBody();
  body.setLayout(new GridLayout());
  sForm=new SashForm(body,SWT.NULL);
  sForm.setLayoutData(new GridData(GridData.FILL_BOTH));
  topComp=toolkit.createComposite(sForm);
  topComp.setLayoutData(new GridData(GridData.FILL_BOTH));
  topComp.setLayout(new GridLayout());
  metadataSection=creatMetadataSection(form,topComp);
  metadataSection.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  metadataSection.setDescription(DefaultMessagesImpl.getString("String_Node_Str"));
  form.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  createAnalysisColumnsSection(form,topComp);
  createIndicatorsSection(form,topComp);
  createDataFilterSection(form,topComp);
  dataFilterComp.addPropertyChangeListener(this);
  Composite exeEngineComp=createExecuteEngineSection(form,topComp,analyzedColumns,columnSetAnalysisHandler.getAnalysis().getParameters());
  createStoreDataCheck(exeEngineComp);
  createContextGroupSection(form,topComp);
  if (!EditorPreferencePage.isHideGraphics()) {
    previewComp=toolkit.createComposite(sForm);
    previewComp.setLayoutData(new GridData(GridData.FILL_BOTH));
    previewComp.setLayout(new GridLayout());
    previewComp.addControlListener(new ControlAdapter(){
      @Override public void controlResized(      ControlEvent e){
        super.controlResized(e);
        sForm.redraw();
        form.reflow(true);
      }
    }
);
    createPreviewSection(form,previewComp);
  }
}
Program: 137277
Project: 137277
Buggy source:
@Override protected void pageChange(int newPageIndex){
  super.pageChange(newPageIndex);
  if (newPageIndex == RESULT_PAGE_INDEX) {
    if (masterPage.isDirty()) {
      masterPage.doSave(null);
    }
    setSaveActionButtonState(false);
  }
  if (isRefreshResultPage) {
    resultPage.refresh(getMasterPage());
    isRefreshResultPage=false;
  }
 else {
    EventManager.getInstance().publish(masterPage.analysisItem.getAnalysis(),EventEnum.DQ_DYNAMIC_SWITCH_MASTER_RESULT_PAGE,null);
  }
}

Fixed version (ground truth):
@Override protected void pageChange(int newPageIndex){
  super.pageChange(newPageIndex);
  if (newPageIndex == RESULT_PAGE_INDEX) {
    if (masterPage.isDirty()) {
      masterPage.doSave(null);
    }
    setSaveActionButtonState(false);
  }
  if (isRefreshResultPage) {
    resultPage.refresh(getMasterPage());
    isRefreshResultPage=false;
  }
 else {
    EventManager.getInstance().publish(resultPage.getAnalysisHandler().getAnalysis(),EventEnum.DQ_DYNAMIC_SWITCH_MASTER_RESULT_PAGE,null);
  }
}
Program: 137278
Project: 137278
Buggy source:
@Override public void doSave(IProgressMonitor monitor){
  if (masterPage != null && masterPage.isDirty()) {
    masterPage.doSave(monitor);
    setPartName(masterPage.getIntactElemenetName());
  }
  setEditorObject(getMasterPage().getAnalysisRepNode());
  super.doSave(monitor);
}

Fixed version (ground truth):
@Override public void doSave(IProgressMonitor monitor){
  if (masterPage != null && masterPage.isDirty()) {
    masterPage.doSave(monitor);
    setPartName(masterPage.getIntactElemenetName());
    if (contextManager instanceof JobContextManager) {
      JobContextManager jobContextManager=(JobContextManager)contextManager;
      jobContextManager.setModified(masterPage.isDirty());
    }
  }
  setEditorObject(getMasterPage().getAnalysisRepNode());
  super.doSave(monitor);
}
Program: 137279
Project: 137279
Buggy source:
/** 
 * DOC msjian Comment method "setLastRunContext".
 * @param lastRunContext
 * @param analysis
 * @return
 */
public static boolean setLastRunContext(String lastRunContext,Analysis analysis){
  return TaggedValueHelper.setTaggedValue(analysis,TaggedValueHelper.REP_LAST_RUN_CONTEXT,lastRunContext);
}

Fixed version (ground truth):
/** 
 * DOC msjian Comment method "setLastRunContext".
 * @param lastRunContext
 * @param analysis
 * @return
 */
public static boolean setLastRunContext(String lastRunContext,Analysis analysis){
  return TaggedValueHelper.setTaggedValue(analysis,TaggedValueHelper.ANA_LAST_RUN_CONTEXT,lastRunContext);
}
Program: 137281
Project: 137281
Buggy source:
@Override protected void addValueToDataset(DefaultCategoryDataset customerdataset,FrequencyExt freqExt,String keyLabel){
  customerdataset.addValue(freqExt.getFrequency(),"String_Node_Str",keyLabel);
  ((DefaultCategoryDataset)secondDataset).addValue(BenfordLawFrequencyState.formalValues[Integer.valueOf(keyLabel)],"String_Node_Str",keyLabel);
}

Fixed version (ground truth):
@Override protected void addValueToDataset(DefaultCategoryDataset customerdataset,FrequencyExt freqExt,String keyLabel){
  customerdataset.addValue(freqExt.getFrequency(),"String_Node_Str",keyLabel);
  if (!BenfordLawFrequencyIndicatorImpl.INVALID.equals(keyLabel)) {
    ((DefaultCategoryDataset)secondDataset).addValue(BenfordLawFrequencyState.formalValues[Integer.valueOf(keyLabel) - 1],"String_Node_Str",keyLabel);
  }
}
Program: 137282
Project: 137282
Buggy source:
/** 
 * <!-- begin-user-doc --> count the occur times for 1~9 at the beginning of every numbers. <!-- end-user-doc -->
 * @generated NOT
 */
@Override public boolean handle(Object data){
  this.count++;
  if (data == null) {
    setValue("String_Node_Str");
    return true;
  }
  int isInvalid=isInvalid(data);
  if (isInvalid == 0) {
    setValue("String_Node_Str");
  }
 else   if (isInvalid < 0) {
    setValue("String_Node_Str");
  }
 else {
    setValue(String.valueOf(data).substring(0,1));
  }
  return true;
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> count the occur times for 1~9 at the beginning of every numbers. <!-- end-user-doc -->
 * @generated NOT
 */
@Override public boolean handle(Object data){
  this.count++;
  if (data == null) {
    setValue(INVALID);
    return true;
  }
  int isInvalid=isInvalid(data);
  if (isInvalid == 0) {
    setValue("String_Node_Str");
  }
 else   if (isInvalid < 0) {
    setValue(INVALID);
  }
 else {
    setValue(String.valueOf(data).substring(0,1));
  }
  return true;
}
Program: 137283
Project: 137283
Buggy source:
/** 
 * handle some special cases for SQL engine: <ul> <li>when there are null values;</li> <li>when there miss some numbers between 1~9;</li> <li>when the column is double, the leading digit maybe 0;</li> <li>when the column is string type, when the leading is not 1~9, all counted into "invalid" one.</li> </ul>
 */
private void handleSpecialCharacterAndMissingValues(){
  if (isChecked && valueToFreq.size() < 1) {
    return;
  }
  long counted=0L;
  List<Object> invalid=new ArrayList<Object>();
  List<Object> lengthMore=new ArrayList<Object>();
  for (  Object val : valueToFreq.keySet()) {
    if (isInvalid(val) < 0) {
      invalid.add(val);
      Long freq=this.valueToFreq.get(val);
      counted=(freq == null) ? counted : counted + freq;
    }
 else     if (String.valueOf(val).length() > 1) {
      lengthMore.add(val);
    }
  }
  if (invalid.size() > 0) {
    for (    Object val : invalid) {
      valueToFreq.remove(val);
    }
    valueToFreq.put("String_Node_Str",counted);
  }
  if (lengthMore.size() > 0) {
    for (    Object val : lengthMore) {
      String k=String.valueOf(val).substring(0,1);
      Long freq=this.valueToFreq.get(val);
      valueToFreq.remove(val);
      valueToFreq.put(k,freq);
    }
  }
  for (int i=1; i < 10; i++) {
    Long value=valueToFreq.get(String.valueOf(i));
    if (value == null) {
      valueToFreq.put(String.valueOf(i),0L);
    }
  }
  isChecked=true;
}

Fixed version (ground truth):
/** 
 * handle some special cases for SQL engine: <ul> <li>when there are null values;</li> <li>when there miss some numbers between 1~9;</li> <li>when the column is double, the leading digit maybe 0;</li> <li>when the column is string type, when the leading is not 1~9, all counted into "invalid" one.</li> </ul>
 */
private void handleSpecialCharacterAndMissingValues(){
  if (isChecked && valueToFreq.size() < 1) {
    return;
  }
  long counted=0L;
  List<Object> invalid=new ArrayList<Object>();
  List<Object> lengthMore=new ArrayList<Object>();
  for (  Object val : valueToFreq.keySet()) {
    if (isInvalid(val) < 0) {
      invalid.add(val);
      Long freq=this.valueToFreq.get(val);
      counted=(freq == null) ? counted : counted + freq;
    }
 else     if (String.valueOf(val).length() > 1) {
      lengthMore.add(val);
    }
  }
  if (invalid.size() > 0) {
    for (    Object val : invalid) {
      valueToFreq.remove(val);
    }
    valueToFreq.put(INVALID,counted);
  }
  if (lengthMore.size() > 0) {
    for (    Object val : lengthMore) {
      String k=String.valueOf(val).substring(0,1);
      Long freq=this.valueToFreq.get(val);
      valueToFreq.remove(val);
      valueToFreq.put(k,freq);
    }
  }
  for (int i=1; i < 10; i++) {
    Long value=valueToFreq.get(String.valueOf(i));
    if (value == null) {
      valueToFreq.put(String.valueOf(i),0L);
    }
  }
  isChecked=true;
}
Program: 137284
Project: 137284
Buggy source:
/** 
 * get NumberOfConnections Per Analysis with the real value.
 * @return
 */
public int getNumberOfConnectionsPerAnalysis(){
  int num=TdqAnalysisConnectionPool.CONNECTIONS_PER_ANALYSIS_DEFAULT_LENGTH;
  if (this.analysis != null) {
    TaggedValue taggedValue=TaggedValueHelper.getTaggedValue(TdqAnalysisConnectionPool.NUMBER_OF_CONNECTIONS_PER_ANALYSIS,this.analysis.getTaggedValue());
    if (taggedValue != null) {
      try {
        num=Integer.valueOf(ContextHelper.getAnalysisContextValue(analysis,taggedValue.getValue()));
      }
 catch (      NumberFormatException e) {
        log.debug(e);
      }
    }
  }
  return num;
}

Fixed version (ground truth):
/** 
 * get NumberOfConnections Per Analysis with the real value.
 * @return
 */
public int getNumberOfConnectionsPerAnalysis() throws NumberFormatException {
  int num=TdqAnalysisConnectionPool.CONNECTIONS_PER_ANALYSIS_DEFAULT_LENGTH;
  if (this.analysis != null) {
    TaggedValue taggedValue=TaggedValueHelper.getTaggedValue(TdqAnalysisConnectionPool.NUMBER_OF_CONNECTIONS_PER_ANALYSIS,this.analysis.getTaggedValue());
    if (taggedValue != null) {
      num=Integer.valueOf(ContextHelper.getAnalysisContextValue(analysis,taggedValue.getValue()));
    }
  }
  return num;
}
Program: 137285
Project: 137285
Buggy source:
@Override protected void addValueToDataset(DefaultCategoryDataset customerdataset,FrequencyExt freqExt,String keyLabel){
  customerdataset.addValue(freqExt.getFrequency(),"String_Node_Str",keyLabel);
  if (!BenfordLawFrequencyIndicatorImpl.INVALID.equals(keyLabel)) {
    ((DefaultCategoryDataset)secondDataset).addValue(BenfordLawFrequencyState.formalValues[Integer.valueOf(keyLabel) - 1],"String_Node_Str",keyLabel);
  }
 else {
    ((DefaultCategoryDataset)secondDataset).addValue(BenfordLawFrequencyState.formalValues[9],"String_Node_Str",keyLabel);
  }
}

Fixed version (ground truth):
@Override protected void addValueToDataset(DefaultCategoryDataset customerdataset,FrequencyExt freqExt,String keyLabel){
  customerdataset.addValue(freqExt.getFrequency(),"String_Node_Str",keyLabel);
  if (!BenfordLawFrequencyIndicatorImpl.INVALID.equals(keyLabel) && !"String_Node_Str".equals(keyLabel)) {
    ((DefaultCategoryDataset)secondDataset).addValue(BenfordLawFrequencyState.formalValues[Integer.valueOf(keyLabel) - 1],"String_Node_Str",keyLabel);
  }
 else {
    ((DefaultCategoryDataset)secondDataset).addValue(BenfordLawFrequencyState.formalValues[9],"String_Node_Str",keyLabel);
  }
}
Program: 137286
Project: 137286
Buggy source:
/** 
 * 1)The current node is under: hadoop/hadoopcluster, need to get the folder to shown as child: hadoop/hdfs, hadoop/hive, 2) only show hdfs or hive folder, when it has children.
 */
@Override public List<IRepositoryNode> getChildren(){
  List<IRepositoryNode> children=new ArrayList<IRepositoryNode>();
  HDFSOfHCFolderRepNode hdfsFolder=new HDFSOfHCFolderRepNode(this.getObject(),this.getParent(),ENodeType.SIMPLE_FOLDER);
  HiveOfHCFolderRepNode hiveFolder=new HiveOfHCFolderRepNode(this.getObject(),this.getParent(),ENodeType.SIMPLE_FOLDER);
  addSubFolder(children,hdfsFolder);
  addSubFolder(children,hiveFolder);
  return children;
}

Fixed version (ground truth):
/** 
 * 1)The current node is under: hadoop/hadoopcluster, need to get the folder to shown as child: hadoop/hdfs, hadoop/hive, 2) only show hdfs or hive folder, when it has children.
 */
@Override public List<IRepositoryNode> getChildren(){
  List<IRepositoryNode> children=new ArrayList<IRepositoryNode>();
  HDFSOfHCFolderRepNode hdfsFolder=new HDFSOfHCFolderRepNode(this.getObject(),this,ENodeType.SIMPLE_FOLDER);
  HiveOfHCFolderRepNode hiveFolder=new HiveOfHCFolderRepNode(this.getObject(),this,ENodeType.SIMPLE_FOLDER);
  addSubFolder(children,hdfsFolder);
  addSubFolder(children,hiveFolder);
  return children;
}
Program: 137287
Project: 137287
Buggy source:
@Override public List<IRepositoryNode> getChildren(boolean withDeleted){
  try {
    super.getChildren().clear();
    RootContainer<String,IRepositoryViewObject> tdqViewObjects=ProxyRepositoryFactory.getInstance().getTdqRepositoryViewObjects(HadoopClusterRepositoryNodeType.HADOOPCLUSTER,RepositoryNodeHelper.getPath(this).toString());
    for (    Container<String,IRepositoryViewObject> container : tdqViewObjects.getSubContainer()) {
      Folder folder=new Folder((Property)container.getProperty(),HadoopClusterRepositoryNodeType.HADOOPCLUSTER);
      if (!withDeleted && folder.isDeleted()) {
        continue;
      }
      HadoopClusterSubFolderRepNode childNodeFolder=new HadoopClusterSubFolderRepNode(folder,this,ENodeType.SIMPLE_FOLDER);
      childNodeFolder.setProperties(EProperties.LABEL,HadoopClusterRepositoryNodeType.HADOOPCLUSTER);
      childNodeFolder.setProperties(EProperties.CONTENT_TYPE,HadoopClusterRepositoryNodeType.HADOOPCLUSTER);
      super.getChildren().add(childNodeFolder);
    }
    for (    IRepositoryViewObject viewObject : tdqViewObjects.getMembers()) {
      if (!withDeleted && viewObject.isDeleted()) {
        continue;
      }
      HadoopClusterConnectionRepNode repNode=new HadoopClusterConnectionRepNode(viewObject,this,ENodeType.REPOSITORY_ELEMENT);
      repNode.setProperties(EProperties.LABEL,HadoopClusterRepositoryNodeType.HADOOPCLUSTER);
      repNode.setProperties(EProperties.CONTENT_TYPE,HadoopClusterRepositoryNodeType.HADOOPCLUSTER);
      viewObject.setRepositoryNode(repNode);
      super.getChildren().add(repNode);
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return filterResultsIfAny(super.getChildren());
}

Fixed version (ground truth):
@Override public List<IRepositoryNode> getChildren(boolean withDeleted){
  try {
    super.getChildren().clear();
    RootContainer<String,IRepositoryViewObject> tdqViewObjects=ProxyRepositoryFactory.getInstance().getTdqRepositoryViewObjects(HadoopClusterRepositoryNodeType.HADOOPCLUSTER,RepositoryNodeHelper.getPath(this).toString());
    for (    IRepositoryViewObject viewObject : tdqViewObjects.getMembers()) {
      if (!withDeleted && viewObject.isDeleted()) {
        continue;
      }
      HadoopClusterConnectionRepNode repNode=new HadoopClusterConnectionRepNode(viewObject,this,ENodeType.REPOSITORY_ELEMENT);
      repNode.setProperties(EProperties.LABEL,HadoopClusterRepositoryNodeType.HADOOPCLUSTER);
      repNode.setProperties(EProperties.CONTENT_TYPE,HadoopClusterRepositoryNodeType.HADOOPCLUSTER);
      viewObject.setRepositoryNode(repNode);
      super.getChildren().add(repNode);
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return filterResultsIfAny(super.getChildren());
}
Program: 137288
Project: 137288
Buggy source:
public CreateDBConnectionAction(){
  RepositoryNode node=(RepositoryNode)RepositoryNodeHelper.getMetadataFolderNode(EResourceConstant.DB_CONNECTIONS);
  super.node=node;
}

Fixed version (ground truth):
public CreateDBConnectionAction(){
  RepositoryNode node2=(RepositoryNode)RepositoryNodeHelper.getMetadataFolderNode(EResourceConstant.DB_CONNECTIONS);
  super.node=node2;
}
Program: 137289
Project: 137289
Buggy source:
@Override protected IWizard createWizard(){
  RepositoryNode dbRootNode=(RepositoryNode)node.getRoot().getRootRepositoryNode(ERepositoryObjectType.METADATA_CONNECTIONS);
  HadoopClusterConnectionItem hcConnectionItem=HCRepositoryUtil.getHCConnectionItemFromRepositoryNode(node);
  Map<String,String> initMap=new HashMap<String,String>();
  initConnectionParameters(initMap,hcConnectionItem);
  return new DatabaseWizard(PlatformUI.getWorkbench(),true,dbRootNode,getExistingNames(),initMap);
}

Fixed version (ground truth):
@Override protected IWizard createWizard(){
  RepositoryNode dbRootNode=RepositoryNodeHelper.getDBConnectionRootNode();
  HadoopClusterConnectionItem hcConnectionItem=HCRepositoryUtil.getHCConnectionItemFromRepositoryNode(node);
  Map<String,String> initMap=new HashMap<String,String>();
  initConnectionParameters(initMap,hcConnectionItem);
  return new DatabaseWizard(PlatformUI.getWorkbench(),true,dbRootNode,getExistingNames(),initMap);
}
Program: 137291
Project: 137291
Buggy source:
/** 
 * Test method for   {@link org.talend.dq.dbms.DbmsLanguageFactory#isHive(java.lang.String)}.
 */
@Test public void testIsHive(){
  String hive="String_Node_Str";
  Assert.isTrue(DbmsLanguageFactory.isHive(hive));
  hive="String_Node_Str";
  Assert.isTrue(DbmsLanguageFactory.isHive(hive));
  hive="String_Node_Str";
  Assert.isTrue(DbmsLanguageFactory.isHive(hive));
  hive="String_Node_Str";
  Assert.isTrue(!DbmsLanguageFactory.isHive(hive));
  hive="String_Node_Str";
  Assert.isTrue(!DbmsLanguageFactory.isHive(hive));
}

Fixed version (ground truth):
/** 
 * Test method for   {@link org.talend.dq.dbms.DbmsLanguageFactory#isHive(java.lang.String)}.
 */
@Test public void testIsHive(){
  String hive="String_Node_Str";
  Assert.assertEquals(true,DbmsLanguageFactory.isHive(hive));
  hive="String_Node_Str";
  Assert.assertEquals(true,DbmsLanguageFactory.isHive(hive));
  hive="String_Node_Str";
  Assert.assertEquals(true,DbmsLanguageFactory.isHive(hive));
  hive="String_Node_Str";
  Assert.assertEquals(false,DbmsLanguageFactory.isHive(hive));
  hive="String_Node_Str";
  Assert.assertEquals(false,DbmsLanguageFactory.isHive(hive));
}
Program: 137295
Project: 137295
Buggy source:
/** 
 * @param object
 * @return SupplierDependencygetClintDependency here will contain system indicators so only will be used by export case
 */
public List<Property> getClintDependencyForExport(ModelElement object){
  List<Property> result=new ArrayList<Property>();
  Property property=PropertyHelper.getProperty(object);
  if (property != null) {
    result=iterateClientDependencies(property);
    if (object instanceof Analysis) {
      result.addAll(getSystemIndicaotrOfAnalysis(property));
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @param object
 * @return SupplierDependencygetClintDependency here will contain system indicators so only will be used by export case
 */
public List<Property> getClintDependencyForExport(ModelElement object){
  List<Property> result=new ArrayList<Property>();
  Property property=PropertyHelper.getProperty(object);
  if (property != null) {
    result=iterateClientDependencies(property);
    if (object instanceof Analysis) {
      result.addAll(getSystemIndicaotrOfAnalysis(property));
    }
 else {
      List<Property> tempList=new ArrayList<Property>();
      tempList.addAll(result);
      for (      Property pro : tempList) {
        if (TDQAnalysisItem.class.isInstance(pro.getItem())) {
          result.addAll(getSystemIndicaotrOfAnalysis(pro));
        }
      }
    }
  }
  return result;
}
Program: 137296
Project: 137296
Buggy source:
/** 
 * @param object
 * @return SupplierDependencygetClintDependency here will contain system indicators so only will be used by export case
 */
public List<Property> getClintDependencyForExport(ModelElement object){
  List<Property> result=new ArrayList<Property>();
  Property property=PropertyHelper.getProperty(object);
  if (property != null) {
    result=iterateClientDependencies(property);
    if (object instanceof Analysis) {
      result.addAll(getSystemIndicaotrOfAnalysis(property));
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @param object
 * @return SupplierDependencygetClintDependency here will contain system indicators so only will be used by export case
 */
public List<Property> getClintDependencyForExport(ModelElement object){
  List<Property> result=new ArrayList<Property>();
  Property property=PropertyHelper.getProperty(object);
  if (property != null) {
    result=iterateClientDependencies(property);
    if (object instanceof Analysis) {
      result.addAll(getSystemIndicaotrOfAnalysis(property));
    }
 else {
      List<Property> tempList=new ArrayList<Property>();
      tempList.addAll(result);
      for (      Property pro : tempList) {
        if (TDQAnalysisItem.class.isInstance(pro.getItem())) {
          result.addAll(getSystemIndicaotrOfAnalysis(pro));
        }
      }
    }
  }
  return result;
}
Program: 137297
Project: 137297
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> getClientDepListByResultList=getClientDepListByResult(analysis);
  for (  Property currentClient : clintDependency) {
    ModelElement modelElement=PropertyHelper.getModelElement(currentClient);
    if (!getClientDepListByResultList.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=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: 137298
Project: 137298
Buggy source:
/** 
 * get Client Dependency List.
 * @param Analysis the analysis which we want to save
 * @return The list all of client dependency(Pattern UDI Connection DQRule)
 */
private List<ModelElement> getClientDepListByResult(Analysis analysis){
  List<ModelElement> clientDependencyList=new ArrayList<ModelElement>();
  DataManager connection=analysis.getContext().getConnection();
  clientDependencyList.addAll(AnalysisHelper.getUserDefinedIndicators(analysis));
  clientDependencyList.addAll(AnalysisHelper.getPatterns(analysis));
  if (connection != null) {
    clientDependencyList.add(connection);
  }
  return clientDependencyList;
}

Fixed version (ground truth):
/** 
 * get Client Dependency List.
 * @param Analysis the analysis which we want to save
 * @return The list all of client dependency(Pattern UDI Connection DQRule)
 */
private List<ModelElement> getClientDepListByResult(Analysis analysis){
  List<ModelElement> clientDependencyList=new ArrayList<ModelElement>();
  DataManager connection=analysis.getContext().getConnection();
  if (connection != null) {
    clientDependencyList.addAll(AnalysisHelper.getUserDefinedIndicators(analysis));
    clientDependencyList.addAll(AnalysisHelper.getPatterns(analysis));
    clientDependencyList.add(connection);
  }
  return clientDependencyList;
}