nus-yam/ex-repair huggingface dataset:
Program: 138301
Project: 138301
Buggy source:
/** 
 * set a csv file.
 * @param csvFile
 * @return whether the file be loaded.
 */
public boolean setCsvFile(File csvFile){
  quotesError=false;
  hasPatternHeaders=false;
  try {
    reader=new CsvReader(new FileReader(csvFile),CURRENT_SEPARATOR);
  }
 catch (  FileNotFoundException e1) {
    e1.printStackTrace();
    return false;
  }
  reader.setEscapeMode(CsvReader.ESCAPE_MODE_BACKSLASH);
  reader.setUseTextQualifier(useTextQualifier);
  try {
    reader.readHeaders();
    String[] headers=reader.getHeaders();
    hasPatternHeaders=checkFileHeader(headers);
    createHeader(headers);
  }
 catch (  IOException e1) {
    e1.printStackTrace();
  }
  viewer.setInput(reader);
  return true;
}

Fixed version (ground truth):
/** 
 * set a csv file.
 * @param csvFile
 * @return whether the file be loaded.
 */
public boolean setCsvFile(File csvFile){
  quotesError=false;
  hasPatternHeaders=false;
  try {
    reader=new CsvReader(new FileReader(csvFile),CURRENT_SEPARATOR);
  }
 catch (  FileNotFoundException e1) {
    e1.printStackTrace();
    return false;
  }
  reader.setEscapeMode(CsvReader.ESCAPE_MODE_DOUBLED);
  reader.setUseTextQualifier(useTextQualifier);
  try {
    reader.readHeaders();
    String[] headers=reader.getHeaders();
    hasPatternHeaders=checkFileHeader(headers);
    createHeader(headers);
  }
 catch (  IOException e1) {
    e1.printStackTrace();
  }
  viewer.setInput(reader);
  return true;
}
Program: 138302
Project: 138302
Buggy source:
@Override public void write(IPath resPath,IPath desPath) throws IOException, CoreException {
  File file=getBasePath().toFile();
  if (!file.exists()) {
    file.createNewFile();
  }
  tempMap.put(resPath.toFile(),desPath.toOSString());
}

Fixed version (ground truth):
@Override public void write(IPath resPath,IPath desPath) throws IOException, CoreException {
  File file=getBasePath().toFile();
  if (!file.exists()) {
    file.createNewFile();
  }
  tempMap.put(resPath.toFile(),desPath.toPortableString());
}
Program: 138303
Project: 138303
Buggy source:
/** 
 * DOC bZhou Comment method "isTOPFile".
 * @param file
 * @return
 */
private boolean isValidDirectory(File file){
  if (!file.getName().startsWith("String_Node_Str")) {
    IPath filePath=new Path(file.getAbsolutePath());
    for (    EResourceConstant constant : EResourceConstant.getTopConstants()) {
      if (filePath.toString().indexOf(constant.getPath()) > 0) {
        String lastSeg=filePath.lastSegment();
        if (constant == EResourceConstant.METADATA) {
          return lastSeg.equals(constant.getName()) || lastSeg.equals(EResourceConstant.DB_CONNECTIONS.getName()) || lastSeg.equals(EResourceConstant.MDM_CONNECTIONS.getName())|| lastSeg.equals(EResourceConstant.FILEDELIMITED.getName());
        }
 else         if (constant == EResourceConstant.LIBRARIES) {
          return !lastSeg.equals(EResourceConstant.JRXML_TEMPLATE.getName());
        }
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isTOPFile".
 * @param file
 * @return
 */
private boolean isValidDirectory(File file){
  if (!file.getName().startsWith("String_Node_Str")) {
    IPath filePath=new Path(file.getAbsolutePath());
    String pathStr=filePath.toPortableString();
    for (    EResourceConstant constant : EResourceConstant.getTopConstants()) {
      if (filePath.toString().indexOf(constant.getPath()) > 0) {
        String lastSeg=filePath.lastSegment();
        if (constant == EResourceConstant.METADATA) {
          return lastSeg.equals(constant.getName()) || pathStr.contains(EResourceConstant.DB_CONNECTIONS.getPath()) || pathStr.contains(EResourceConstant.MDM_CONNECTIONS.getPath())|| pathStr.contains(EResourceConstant.FILEDELIMITED.getPath());
        }
 else         if (constant == EResourceConstant.LIBRARIES) {
          return !lastSeg.equals(EResourceConstant.JRXML_TEMPLATE.getName());
        }
        return true;
      }
    }
  }
  return false;
}
Program: 138305
Project: 138305
Buggy source:
@Override public ItemRecord computeInput(IPath path){
  sourcePath=path.removeFileExtension();
  try {
    FilesUtils.createFolder(sourcePath.toFile());
    FilesUtils.unzip(path.toOSString(),sourcePath.toOSString());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  File libFolder=DqFileUtils.getFile(sourcePath.toFile(),EResourceConstant.LIBRARIES.getName(),true);
  IPath projectPath=new Path(libFolder.getParentFile().getAbsolutePath());
  return super.computeInput(projectPath);
}

Fixed version (ground truth):
@Override public ItemRecord computeInput(IPath path){
  sourcePath=path.removeFileExtension();
  try {
    FilesUtils.createFolder(sourcePath.toFile());
    FilesUtils.unzip(path.toOSString(),sourcePath.toOSString());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  File libFolder=DqFileUtils.getFile(sourcePath.toFile(),EResourceConstant.LIBRARIES.getName(),true);
  if (libFolder != null && libFolder.exists()) {
    IPath projectPath=new Path(libFolder.getParentFile().getAbsolutePath());
    return super.computeInput(projectPath);
  }
  return null;
}
Program: 138307
Project: 138307
Buggy source:
/** 
 * DOC qiongli Comment method "createColumnAnalysis".bug 16252.
 * @param newTree
 */
private void createColumnAnalysis(Tree newTree){
  TreeItem[] items=newTree.getSelection();
  if (items.length > 0) {
    TreePath[] paths=new TreePath[items.length];
    for (int i=0; i < items.length; i++) {
      TdColumn tdColumn=(TdColumn)items[i].getData("String_Node_Str");
      paths[i]=new TreePath(new Object[]{tdColumn});
    }
    CreateColumnAnalysisAction analysisAction=new CreateColumnAnalysisAction();
    analysisAction.setSelection(new TreeSelection(paths));
    analysisAction.run();
  }
}

Fixed version (ground truth):
/** 
 * DOC qiongli Comment method "createColumnAnalysis".bug 16252.
 * @param newTree
 */
private void createColumnAnalysis(Tree newTree){
  TreeItem[] items=newTree.getSelection();
  if (items.length > 0) {
    TreePath[] paths=new TreePath[items.length];
    for (int i=0; i < items.length; i++) {
      ColumnIndicator data=(ColumnIndicator)items[i].getData("String_Node_Str");
      IRepositoryNode modelElementRepositoryNode=data.getModelElementRepositoryNode();
      paths[i]=new TreePath(new Object[]{modelElementRepositoryNode});
    }
    CreateColumnAnalysisAction analysisAction=new CreateColumnAnalysisAction();
    analysisAction.setSelection(new TreeSelection(paths));
    analysisAction.run();
  }
}
Program: 138308
Project: 138308
Buggy source:
/** 
 * DOC bZhou Comment method "removeAliasInSQLExplorer".
 * @param dataproviders
 */
public void removeAliasInSQLExplorer(DataProvider... dataproviders){
  SQLExplorerPlugin sqlPlugin=SQLExplorerPlugin.getDefault();
  AliasManager aliasManager=sqlPlugin.getAliasManager();
  for (  DataProvider dataProvider : dataproviders) {
    try {
      aliasManager.loadAliases();
      String aliasName=dataProvider.getName();
      Alias alias=aliasManager.getAlias(aliasName);
      if (alias != null) {
        aliasManager.removeAlias(aliasName);
      }
    }
 catch (    Exception e) {
      log.error(e,e);
    }
  }
  aliasManager.modelChanged();
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "removeAliasInSQLExplorer".
 * @param dataproviders
 */
public void removeAliasInSQLExplorer(DataProvider... dataproviders){
  SQLExplorerPlugin sqlPlugin=SQLExplorerPlugin.getDefault();
  AliasManager aliasManager=sqlPlugin.getAliasManager();
  for (  DataProvider dataProvider : dataproviders) {
    try {
      aliasManager.loadAliases();
      String aliasName=dataProvider.getName();
      Alias alias=aliasManager.getAlias(aliasName);
      if (alias != null) {
        aliasManager.removeAlias(aliasName);
        aliasManager.saveAliases();
      }
    }
 catch (    Exception e) {
      log.error(e,e);
    }
  }
  aliasManager.modelChanged();
}
Program: 138309
Project: 138309
Buggy source:
public void saveAnalysis() throws DataprofilerCoreException {
  this.analysis.setName(this.analysis.getName().replace("String_Node_Str","String_Node_Str"));
  if (isConnectionAnalysis()) {
    AnalysisHelper.setReloadDatabases(analysis,reloadDatabasesBtn.getSelection());
  }
  EList<Domain> dataFilters=analysis.getParameters().getDataFilter();
  if (!this.tableFilterText.getText().equals(DomainHelper.getTablePattern(dataFilters))) {
    DomainHelper.setDataFilterTablePattern(dataFilters,tableFilterText.getText());
    latestTableFilterValue=this.tableFilterText.getText();
  }
  if (!this.viewFilterText.getText().equals(DomainHelper.getViewPattern(dataFilters))) {
    DomainHelper.setDataFilterViewPattern(dataFilters,viewFilterText.getText());
    latestViewFilterValue=this.viewFilterText.getText();
  }
  this.updateAnalysisClientDependency();
  ReturnCode saved=new ReturnCode(false);
  IEditorInput editorInput=this.getEditorInput();
  if (editorInput instanceof AnalysisItemEditorInput) {
    AnalysisItemEditorInput analysisInput=(AnalysisItemEditorInput)editorInput;
    TDQAnalysisItem tdqAnalysisItem=analysisInput.getTDQAnalysisItem();
    tdqAnalysisItem.getProperty().setLabel(analysis.getName());
    this.nameText.setText(analysis.getName());
    saved=ElementWriterFactory.getInstance().createAnalysisWrite().save(tdqAnalysisItem);
  }
  if (saved.isOk()) {
    log.info("String_Node_Str" + analysis.getFileName());
  }
}

Fixed version (ground truth):
public void saveAnalysis() throws DataprofilerCoreException {
  this.analysis.setName(this.analysis.getName().replace("String_Node_Str","String_Node_Str"));
  if (isConnectionAnalysis()) {
    AnalysisHelper.setReloadDatabases(analysis,reloadDatabasesBtn.getSelection());
  }
  EList<Domain> dataFilters=analysis.getParameters().getDataFilter();
  if (!this.tableFilterText.getText().equals(DomainHelper.getTablePattern(dataFilters))) {
    DomainHelper.setDataFilterTablePattern(dataFilters,tableFilterText.getText());
    latestTableFilterValue=this.tableFilterText.getText();
  }
  if (!this.viewFilterText.getText().equals(DomainHelper.getViewPattern(dataFilters))) {
    DomainHelper.setDataFilterViewPattern(dataFilters,viewFilterText.getText());
    latestViewFilterValue=this.viewFilterText.getText();
  }
  this.updateAnalysisClientDependency();
  ReturnCode saved=new ReturnCode(false);
  IEditorInput editorInput=this.getEditorInput();
  if (editorInput instanceof AnalysisItemEditorInput) {
    AnalysisItemEditorInput analysisInput=(AnalysisItemEditorInput)editorInput;
    TDQAnalysisItem tdqAnalysisItem=analysisInput.getTDQAnalysisItem();
    if (tdqAnalysisItem.eIsProxy()) {
      tdqAnalysisItem=(TDQAnalysisItem)EObjectHelper.resolveObject(tdqAnalysisItem);
    }
    tdqAnalysisItem.getProperty().setLabel(analysis.getName());
    this.nameText.setText(analysis.getName());
    saved=ElementWriterFactory.getInstance().createAnalysisWrite().save(tdqAnalysisItem);
  }
  if (saved.isOk()) {
    log.info("String_Node_Str" + analysis.getFileName());
  }
}
Program: 138315
Project: 138315
Buggy source:
/** 
 * @return query string for full table select
 */
private String createTableSelect(){
  TableNode node=(TableNode)_selectedNodes[0];
  StringBuffer query=new StringBuffer("String_Node_Str");
  String sep="String_Node_Str";
  List columnNames=node.getColumnNames();
  Iterator it=columnNames.iterator();
  while (it.hasNext()) {
    query.append(sep);
    String column=(String)it.next();
    query.append(quote(column,getQuoteString(node)));
    sep="String_Node_Str";
  }
  query.append("String_Node_Str");
  query.append(node.getQualifiedName());
  return query.toString();
}

Fixed version (ground truth):
/** 
 * @return query string for full table select
 */
private String createTableSelect(){
  TableNode node=(TableNode)_selectedNodes[0];
  StringBuffer query=new StringBuffer("String_Node_Str");
  String sep="String_Node_Str";
  List columnNames=node.getColumnNames();
  Iterator it=columnNames.iterator();
  while (it.hasNext()) {
    query.append(sep);
    String column=(String)it.next();
    query.append(quote(column,getQuoteString(node)));
    sep="String_Node_Str";
  }
  query.append("String_Node_Str");
  query.append(fixTableName(node.getQualifiedName()));
  return query.toString();
}
Program: 138316
Project: 138316
Buggy source:
/** 
 * @return query string for full table select
 */
private String createColumnSelect(){
  StringBuffer query=new StringBuffer("String_Node_Str");
  String sep="String_Node_Str";
  String table="String_Node_Str";
  for (int i=0; i < _selectedNodes.length; i++) {
    INode node=_selectedNodes[i];
    if (node instanceof ColumnNode) {
      ColumnNode column=(ColumnNode)node;
      if (table.length() == 0) {
        table=column.getQualifiedParentTableName();
      }
      if (column.getQualifiedParentTableName().equals(table)) {
        query.append(sep);
        query.append(quote(column.getName(),getQuoteString(column)));
        sep="String_Node_Str";
      }
    }
  }
  query.append("String_Node_Str");
  query.append(table);
  return query.toString();
}

Fixed version (ground truth):
/** 
 * @return query string for full table select
 */
private String createColumnSelect(){
  StringBuffer query=new StringBuffer("String_Node_Str");
  String sep="String_Node_Str";
  String table="String_Node_Str";
  for (int i=0; i < _selectedNodes.length; i++) {
    INode node=_selectedNodes[i];
    if (node instanceof ColumnNode) {
      ColumnNode column=(ColumnNode)node;
      if (table.length() == 0) {
        table=column.getQualifiedParentTableName();
      }
      if (column.getQualifiedParentTableName().equals(table)) {
        query.append(sep);
        query.append(quote(column.getName(),getQuoteString(column)));
        sep="String_Node_Str";
      }
    }
  }
  query.append("String_Node_Str");
  query.append(fixTableName(table));
  return query.toString();
}
Program: 138317
Project: 138317
Buggy source:
private void moveConnectionRepNode(IRepositoryNode sourceNode,IRepositoryNode targetNode) throws PersistenceException {
  IRepositoryViewObject objectToMove=sourceNode.getObject();
  ConnectionItem item=(ConnectionItem)objectToMove.getProperty().getItem();
  IPath fullPath=ResourceManager.getReportsFolder().getFullPath();
  if (targetNode.getType() == ENodeType.SIMPLE_FOLDER) {
    moveObject(objectToMove,sourceNode,targetNode,fullPath.makeRelativeTo(ResourceManager.getRootProject().getFullPath()));
  }
 else   if (targetNode.getType() == ENodeType.SYSTEM_FOLDER) {
    moveObject(objectToMove,sourceNode,targetNode,Path.EMPTY);
  }
  CorePlugin.getDefault().refreshDQView(targetNode.getParent());
  this.updateConnectionDependency(item);
}

Fixed version (ground truth):
private void moveConnectionRepNode(IRepositoryNode sourceNode,IRepositoryNode targetNode) throws PersistenceException {
  IRepositoryViewObject objectToMove=sourceNode.getObject();
  ConnectionItem item=(ConnectionItem)objectToMove.getProperty().getItem();
  IPath fullPath=Path.EMPTY;
  if (targetNode.getParent() instanceof DBConnectionFolderRepNode) {
    fullPath=ResourceManager.getConnectionFolder().getFullPath();
  }
 else   if (targetNode.getParent() instanceof DFConnectionFolderRepNode) {
    fullPath=ResourceManager.getFileDelimitedFolder().getFullPath();
  }
 else   if (targetNode.getParent() instanceof MDMConnectionFolderRepNode || targetNode.getParent() instanceof MDMConnectionSubFolderRepNode) {
    fullPath=ResourceManager.getMDMConnectionFolder().getFullPath();
  }
  if (targetNode.getType() == ENodeType.SIMPLE_FOLDER) {
    moveObject(objectToMove,sourceNode,targetNode,fullPath.makeRelativeTo(ResourceManager.getRootProject().getFullPath()));
  }
 else   if (targetNode.getType() == ENodeType.SYSTEM_FOLDER) {
    moveObject(objectToMove,sourceNode,targetNode,Path.EMPTY);
  }
  CorePlugin.getDefault().refreshDQView(targetNode.getParent());
  this.updateConnectionDependency(item);
}
Program: 138318
Project: 138318
Buggy source:
@Override protected ReturnCode executeSqlQuery(String sqlStatement) throws SQLException {
  ReturnCode ok=new ReturnCode(true);
  DataProvider dataProvider=this.getDataManager();
  if (this.elementToIndicators.values().isEmpty()) {
    String msg="String_Node_Str";
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  Indicator[] indics=this.getAllIndicators();
  if (indics.length == 0) {
    String msg="String_Node_Str" + dataProvider;
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  for (  Indicator indicator : indics) {
    SchemaIndicator schemaIndicator=DataqualitySwitchHelper.SCHEMA_SWITCH.doSwitch(indicator);
    if (schemaIndicator == null) {
      continue;
    }
    Schema schema=(Schema)schemaIndicator.getAnalyzedElement();
    String catName=schema.getName();
    if (!checkSchema(schema)) {
      ok.setReturnCode(Messages.getString("String_Node_Str",catName),false);
      return ok;
    }
    EObject container=schema.eContainer();
    if (container != null) {
      Catalog catalog=SwitchHelpers.CATALOG_SWITCH.doSwitch(container);
      if (catalog != null) {
        catName=catalog.getName();
      }
    }
    if (!ConnectionUtils.isOdbcProgress(connection)) {
      connection.setCatalog(catName);
    }
    evalSchemaIndicLow(null,schemaIndicator,null,schema,ok);
  }
  return ok;
}

Fixed version (ground truth):
@Override protected ReturnCode executeSqlQuery(String sqlStatement) throws SQLException {
  ReturnCode ok=new ReturnCode(true);
  DataProvider dataProvider=this.getDataManager();
  if (this.elementToIndicators.values().isEmpty()) {
    String msg="String_Node_Str";
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  Indicator[] indics=this.getAllIndicators();
  if (indics.length == 0) {
    String msg="String_Node_Str" + dataProvider;
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  for (  Indicator indicator : indics) {
    SchemaIndicator schemaIndicator=DataqualitySwitchHelper.SCHEMA_SWITCH.doSwitch(indicator);
    if (schemaIndicator == null) {
      continue;
    }
    Schema schema=(Schema)schemaIndicator.getAnalyzedElement();
    String catName=schema.getName();
    if (!checkSchema(schema)) {
      ok.setReturnCode(Messages.getString("String_Node_Str",catName),false);
      return ok;
    }
    EObject container=schema.eContainer();
    if (container != null) {
      Catalog catalog=SwitchHelpers.CATALOG_SWITCH.doSwitch(container);
      if (catalog != null) {
        catName=catalog.getName();
      }
    }
    if (!ConnectionUtils.isOdbcProgress(connection) && !ConnectionUtils.isOdbcOracle(connection)) {
      connection.setCatalog(catName);
    }
    evalSchemaIndicLow(null,schemaIndicator,null,schema,ok);
  }
  return ok;
}
Program: 138319
Project: 138319
Buggy source:
/** 
 * DOC scorreia Comment method "getRowCounts".
 * @param schemaIndic
 * @param quCatalog
 * @param quSchema
 * @param quTable
 * @return
 * @throws SQLException
 */
private long getRowCounts(String quCatalog,String quSchema,String quTable) throws SQLException {
  String sqlStatement=SELECT_COUNT_FROM + dbms().toQualifiedName(quCatalog,quSchema,quTable);
  Statement statement=connection.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY);
  long totalRowCount=0;
  try {
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str" + sqlStatement);
    }
    if (continueRun()) {
      statement.execute(sqlStatement);
    }
  }
 catch (  SQLException e) {
    statement.close();
    log.warn(e.getMessage() + "String_Node_Str" + sqlStatement);
    if (log.isDebugEnabled()) {
      log.debug(e,e);
    }
    reloadConnectionAfterException(quCatalog);
    return totalRowCount;
  }
  ResultSet resultSet=statement.getResultSet();
  if (resultSet == null) {
    String mess="String_Node_Str" + sqlStatement;
    log.warn(mess);
  }
 else {
    while (resultSet != null && resultSet.next()) {
      if (!continueRun()) {
        break;
      }
      String str=String.valueOf(resultSet.getObject(1));
      Long count=Long.valueOf(str);
      totalRowCount+=count;
      if (log.isDebugEnabled()) {
        log.debug(quCatalog + "String_Node_Str" + quSchema+ "String_Node_Str"+ quTable+ "String_Node_Str"+ count);
      }
    }
    resultSet.close();
  }
  statement.close();
  return totalRowCount;
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "getRowCounts".
 * @param schemaIndic
 * @param quCatalog
 * @param quSchema
 * @param quTable
 * @return
 * @throws SQLException
 */
private long getRowCounts(String quCatalog,String quSchema,String quTable) throws SQLException {
  String sqlStatement=SELECT_COUNT_FROM + dbms().toQualifiedName(quCatalog,quSchema,quTable);
  Statement statement=connection.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY);
  long totalRowCount=0;
  try {
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str" + sqlStatement);
    }
    if (continueRun()) {
      statement.execute(sqlStatement);
    }
  }
 catch (  SQLException e) {
    statement.close();
    log.warn(e.getMessage() + "String_Node_Str" + sqlStatement);
    if (log.isDebugEnabled()) {
      log.debug(e,e);
    }
    reloadConnectionAfterException(quCatalog);
    return totalRowCount;
  }
  ResultSet resultSet=statement.getResultSet();
  if (resultSet == null) {
    String mess="String_Node_Str" + sqlStatement;
    log.warn(mess);
  }
 else {
    while (resultSet != null && resultSet.next()) {
      if (!continueRun()) {
        break;
      }
      String str=String.valueOf(resultSet.getObject(1));
      Long count=IndicatorImpl.getLongFromObject(str);
      totalRowCount+=count;
      if (log.isDebugEnabled()) {
        log.debug(quCatalog + "String_Node_Str" + quSchema+ "String_Node_Str"+ quTable+ "String_Node_Str"+ count);
      }
    }
    resultSet.close();
  }
  statement.close();
  return totalRowCount;
}
Program: 138320
Project: 138320
Buggy source:
/** 
 * DOC scorreia Comment method "computeUniqueCount".
 * @param objects
 * @return
 */
private boolean computeCounts(List<Object[]> objects){
  boolean ok=true;
  this.setDistinctCount(Long.valueOf(objects.size()));
  Long uniq=0L;
  Long rowcount=0L;
  for (  Object[] row : objects) {
    Object c=row[row.length - 1];
    if (c != null) {
      Long val=Long.valueOf(String.valueOf(c));
      rowcount+=val;
      if (val == 1) {
        uniq++;
      }
    }
 else {
      ok=false;
    }
  }
  this.setCount(rowcount);
  this.setUniqueCount(uniq);
  return ok;
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "computeUniqueCount".
 * @param objects
 * @return
 */
private boolean computeCounts(List<Object[]> objects){
  boolean ok=true;
  this.setDistinctCount(Long.valueOf(objects.size()));
  Long uniq=0L;
  Long rowcount=0L;
  for (  Object[] row : objects) {
    Object c=row[row.length - 1];
    if (c != null) {
      Long val=Long.valueOf(getLongFromObject(String.valueOf(c)));
      rowcount+=val;
      if (val == 1) {
        uniq++;
      }
    }
 else {
      ok=false;
    }
  }
  this.setCount(rowcount);
  this.setUniqueCount(uniq);
  return ok;
}
Program: 138321
Project: 138321
Buggy source:
/** 
 * DOC jet Comment method "getNBDistinct".
 * @param myResultSet
 * @return
 */
private static Long getNBDistinct(List<Object[]> myResultSet){
  if (myResultSet.size() == 1 && myResultSet.get(0).length == 2) {
    return Long.valueOf(String.valueOf(myResultSet.get(0)[1]));
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC jet Comment method "getNBDistinct".
 * @param myResultSet
 * @return
 */
private static Long getNBDistinct(List<Object[]> myResultSet){
  if (myResultSet.size() == 1 && myResultSet.get(0).length == 2) {
    return Long.valueOf(IndicatorImpl.getLongFromObject(String.valueOf(myResultSet.get(0)[1])));
  }
  return null;
}
Program: 138322
Project: 138322
Buggy source:
private static Long getNB(List<Object[]> myResultSet){
  if (myResultSet.size() == 1 && myResultSet.get(0).length == 2) {
    return Long.valueOf(String.valueOf(myResultSet.get(0)[0]));
  }
  return null;
}

Fixed version (ground truth):
private static Long getNB(List<Object[]> myResultSet){
  if (myResultSet.size() == 1 && myResultSet.get(0).length == 2) {
    return IndicatorImpl.getLongFromObject(String.valueOf(myResultSet.get(0)[0]));
  }
  return null;
}
Program: 138323
Project: 138323
Buggy source:
@Override public boolean storeSqlResults(List<Object[]> objects){
  if (!checkResults(objects,1)) {
    return false;
  }
  Long c=Long.valueOf(String.valueOf(objects.get(0)[0]));
  this.setUserCount(c);
  return true;
}

Fixed version (ground truth):
@Override public boolean storeSqlResults(List<Object[]> objects){
  if (!checkResults(objects,1)) {
    return false;
  }
  Long c=IndicatorImpl.getLongFromObject(String.valueOf(objects.get(0)[0]));
  this.setUserCount(c);
  return true;
}
Program: 138324
Project: 138324
Buggy source:
/** 
 * DOC qzhang Comment method "createIFile".
 * @param monitor
 * @param file
 * @param content
 * @throws CoreException
 */
private IFile createIFile(IProgressMonitor monitor,IFile file,String content) throws CoreException {
  try {
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ISaveAsService.class)) {
      ISaveAsService service=(ISaveAsService)GlobalServiceRegister.getDefault().getService(ISaveAsService.class);
      String fName=StringUtils.removeEnd(file.getName(),DEFAULT_FILE_EXTENSION);
      Item item=service.createFile(content,Path.EMPTY,fName,file.getFileExtension());
      IPath location=file.getLocation();
      if (item != null && item.getProperty() != null && location != null) {
        IWorkspace workspace=ResourcesPlugin.getWorkspace();
        location=location.removeLastSegments(1);
        StringBuffer strb=new StringBuffer();
        strb.append(location.toString());
        String version=item.getProperty().getVersion() == null ? "String_Node_Str" : item.getProperty().getVersion();
        strb.append(Path.SEPARATOR).append(fName).append("String_Node_Str" + version).append(DEFAULT_FILE_EXTENSION);
        location=Path.fromOSString(strb.toString());
        file=workspace.getRoot().getFileForLocation(location);
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    monitor.done();
  }
  return file;
}

Fixed version (ground truth):
/** 
 * DOC qzhang Comment method "createIFile".
 * @param monitor
 * @param file
 * @param content
 * @throws CoreException
 */
private IFile createIFile(IFile file,String content) throws CoreException {
  try {
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ISaveAsService.class)) {
      ISaveAsService service=(ISaveAsService)GlobalServiceRegister.getDefault().getService(ISaveAsService.class);
      String fName=StringUtils.removeEnd(file.getName(),DEFAULT_FILE_EXTENSION);
      IWorkspace workspace=ResourcesPlugin.getWorkspace();
      IPath rootPath=new Path("String_Node_Str");
      Item item=service.createFile(content,file.getProjectRelativePath().removeLastSegments(1).makeRelativeTo(rootPath),fName,file.getFileExtension());
      IPath location=file.getLocation();
      if (item != null && item.getProperty() != null && location != null) {
        location=location.removeLastSegments(1);
        StringBuffer strb=new StringBuffer();
        strb.append(location.toString());
        String version=item.getProperty().getVersion() == null ? "String_Node_Str" : "String_Node_Str" + item.getProperty().getVersion();
        strb.append(Path.SEPARATOR).append(fName).append(version).append(DEFAULT_FILE_EXTENSION);
        location=Path.fromOSString(strb.toString());
        file=workspace.getRoot().getFileForLocation(location);
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return file;
}
Program: 138328
Project: 138328
Buggy source:
@Override protected boolean doExecute() throws Exception {
  try {
    Collection<Analysis> analyses=searchAllAnalysis(ResourceManager.getAnalysisFolder());
    AnalysisWriter analysisWriter=ElementWriterFactory.getInstance().createAnalysisWrite();
    for (    Analysis analysis : analyses) {
      EList<Indicator> allIndics=analysis.getResults().getIndicators();
      List<Indicator> textIndLeaves=null;
      Indicator textIndCategory=null;
      for (      Indicator indicator : allIndics) {
        if (indicator instanceof TextIndicator) {
          textIndCategory=indicator;
          textIndLeaves=IndicatorHelper.getIndicatorLeaves(indicator);
          break;
        }
      }
      if (textIndCategory != null && textIndLeaves != null) {
        analysis.getResults().getIndicators().remove(textIndCategory);
        analysis.getResults().getIndicators().addAll(textIndLeaves);
      }
      analysisWriter.save(analysis);
    }
  }
 catch (  Exception e) {
    log.error(e,e);
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean doExecute() throws Exception {
  try {
    Collection<Analysis> analyses=(Collection<Analysis>)AnaResourceFileHelper.getInstance().getAllElement();
    AnalysisWriter analysisWriter=ElementWriterFactory.getInstance().createAnalysisWrite();
    for (    Analysis analysis : analyses) {
      EList<Indicator> allIndics=analysis.getResults().getIndicators();
      List<Indicator> textIndLeaves=null;
      Indicator textIndCategory=null;
      for (      Indicator indicator : allIndics) {
        if (indicator instanceof TextIndicator) {
          textIndCategory=indicator;
          textIndLeaves=IndicatorHelper.getIndicatorLeaves(indicator);
          break;
        }
      }
      if (textIndCategory != null && textIndLeaves != null) {
        analysis.getResults().getIndicators().remove(textIndCategory);
        analysis.getResults().getIndicators().addAll(textIndLeaves);
      }
      analysisWriter.save(analysis);
    }
  }
 catch (  Exception e) {
    log.error(e,e);
    return false;
  }
  return true;
}
Program: 138329
Project: 138329
Buggy source:
@Override protected boolean doExecute() throws Exception {
  boolean ok=true;
  DQStructureManager manager=DQStructureManager.getInstance();
  IFolder systemIndicatorFolder=ResourceManager.getSystemIndicatorFolder();
  if (!systemIndicatorFolder.exists()) {
    systemIndicatorFolder=manager.createNewFolder(ResourceManager.getIndicatorFolder(),EResourceConstant.SYSTEM_INDICATORS);
  }
  manager.copyFilesToFolder(CorePlugin.getDefault(),DQStructureManager.SYSTEM_INDICATOR_PATH,true,systemIndicatorFolder,null,true);
  DefinitionHandler.getInstance().reloadIndicatorsDefinitions();
  Collection<Analysis> analyses=new ArrayList<Analysis>();
  analyses=searchAllAnalysis(ResourceManager.getAnalysisFolder());
  AnalysisWriter analysisWriter=ElementWriterFactory.getInstance().createAnalysisWrite();
  for (  Analysis ana : analyses) {
    try {
      for (      Indicator ind : ana.getResults().getIndicators()) {
        updateIndDefinition(ind);
        if (ind instanceof CompositeIndicator) {
          for (          Indicator indLeave : IndicatorHelper.getIndicatorLeaves(ind)) {
            updateIndDefinition(indLeave);
          }
        }
      }
      analysisWriter.save(ana);
    }
 catch (    Exception e) {
      log.warn(e,e);
      ok=false;
    }
  }
  ResourceManager.getLibrariesFolder().getFile(DefinitionHandler.FILENAME).delete(true,new NullProgressMonitor());
  DefinitionHandler.getInstance().copyDefinitionsIntoFolder(ResourceManager.getLibrariesFolder());
  return ok;
}

Fixed version (ground truth):
@Override protected boolean doExecute() throws Exception {
  boolean ok=true;
  DQStructureManager manager=DQStructureManager.getInstance();
  IFolder systemIndicatorFolder=ResourceManager.getSystemIndicatorFolder();
  if (!systemIndicatorFolder.exists()) {
    systemIndicatorFolder=manager.createNewFolder(ResourceManager.getIndicatorFolder(),EResourceConstant.SYSTEM_INDICATORS);
  }
  manager.copyFilesToFolder(CorePlugin.getDefault(),DQStructureManager.SYSTEM_INDICATOR_PATH,true,systemIndicatorFolder,null,true);
  DefinitionHandler.getInstance().reloadIndicatorsDefinitions();
  Collection<Analysis> analyses=(Collection<Analysis>)AnaResourceFileHelper.getInstance().getAllElement();
  AnalysisWriter analysisWriter=ElementWriterFactory.getInstance().createAnalysisWrite();
  for (  Analysis ana : analyses) {
    try {
      for (      Indicator ind : ana.getResults().getIndicators()) {
        updateIndDefinition(ind);
        if (ind instanceof CompositeIndicator) {
          for (          Indicator indLeave : IndicatorHelper.getIndicatorLeaves(ind)) {
            updateIndDefinition(indLeave);
          }
        }
      }
      analysisWriter.save(ana);
    }
 catch (    Exception e) {
      log.warn(e,e);
      ok=false;
    }
  }
  ResourceManager.getLibrariesFolder().getFile(DefinitionHandler.FILENAME).delete(true,new NullProgressMonitor());
  DefinitionHandler.getInstance().copyDefinitionsIntoFolder(ResourceManager.getLibrariesFolder());
  return ok;
}
Program: 138330
Project: 138330
Buggy source:
/** 
 * DOC bZhou Comment method "createNewItemFile".
 * @param file
 */
private void createNewItemFile(File file){
  ModelElement modelElement=getModelElement(file);
  if (modelElement != null && !modelElement.eIsProxy()) {
    IFile iFile=ResourceService.file2IFile(file);
    IFolder parentFolder=(IFolder)iFile.getParent();
    TypedReturnCode<Object> trc=ElementWriterFactory.getInstance().create(modelElement).create(modelElement,parentFolder,true);
    if (trc.getObject() instanceof Item) {
      Property property=((Item)trc.getObject()).getProperty();
      IPath newFileNamePath=new Path(property.getLabel() + "String_Node_Str" + property.getVersion()).addFileExtension(iFile.getFileExtension());
      IFile newFile=parentFolder.getFile(newFileNamePath);
      newFileList.add(newFile.getLocation().toFile());
      replaceMap.put(file.getName(),newFile.getFullPath().lastSegment());
    }
  }
 else   if (modelElement.eIsProxy()) {
    InternalEObject eobject=(InternalEObject)modelElement;
    replaceMap.put(file.getName(),eobject.eProxyURI().lastSegment());
  }
  newFileList.addAll(findRawConnectionFiles());
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "createNewItemFile".
 * @param file
 */
private void createNewItemFile(File file){
  ModelElement modelElement=getModelElement(file);
  if (modelElement != null && !modelElement.eIsProxy()) {
    IFile iFile=ResourceService.file2IFile(file);
    IFolder parentFolder=(IFolder)iFile.getParent();
    TypedReturnCode<Object> trc=ElementWriterFactory.getInstance().create(modelElement).create(modelElement,parentFolder,true);
    if (trc.getObject() instanceof Item) {
      Property property=((Item)trc.getObject()).getProperty();
      IPath newFileNamePath=new Path(property.getLabel() + "String_Node_Str" + property.getVersion()).addFileExtension(iFile.getFileExtension());
      IFile newFile=parentFolder.getFile(newFileNamePath);
      newFileList.add(newFile.getLocation().toFile());
      replaceMap.put(file.getName(),newFile.getFullPath().lastSegment());
    }
  }
 else   if (modelElement.eIsProxy()) {
    InternalEObject eobject=(InternalEObject)modelElement;
    replaceMap.put(file.getName(),eobject.eProxyURI().lastSegment());
  }
}
Program: 138331
Project: 138331
Buggy source:
@Override protected boolean doExecute() throws Exception {
  newFileList=new ArrayList<File>();
  replaceMap=new HashMap<String,String>();
  ArrayList<File> fileList=getNeedUpdateFiles();
  for (  File file : fileList) {
    createNewItemFile(file);
    deleteOldItemFile(file);
  }
  updateFile();
  return true;
}

Fixed version (ground truth):
@Override protected boolean doExecute() throws Exception {
  newFileList=new ArrayList<File>();
  replaceMap=new HashMap<String,String>();
  ArrayList<File> fileList=getNeedUpdateFiles();
  for (  File file : fileList) {
    createNewItemFile(file);
    deleteOldItemFile(file);
  }
  addConnectionFileToUpdate();
  updateFile();
  return true;
}
Program: 138332
Project: 138332
Buggy source:
/** 
 * DOC bZhou Comment method "updateIndicatorItem".
 * @param file
 * @throws URISyntaxException
 * @throws IOException
 */
private void updateIndicatorItem(File file) throws IOException, URISyntaxException {
  if (file.getName().endsWith(FactoriesUtil.ANA)) {
    Analysis analysis=(Analysis)getModelElement(file);
    Collection<Indicator> indicators=IndicatorHelper.getIndicators(analysis.getResults());
    for (    Indicator indicator : indicators) {
      String fragment=null;
      IndicatorDefinition indicatorDefinition=indicator.getIndicatorDefinition();
      if (indicatorDefinition != null) {
        if (indicatorDefinition.eIsProxy()) {
          URI uri=((InternalEObject)indicatorDefinition).eProxyURI();
          fragment=uri.lastSegment();
        }
 else {
          fragment=indicatorDefinition.eResource().getURI().lastSegment();
        }
        if (fragment != null) {
          String replace=fragment.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
          FileUtils.replaceInFile(file.getAbsolutePath(),fragment,replace);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "updateIndicatorItem".
 * @param file
 * @throws URISyntaxException
 * @throws IOException
 */
private void updateIndicatorItem(File file) throws IOException, URISyntaxException {
  if (file.getName().endsWith(FactoriesUtil.ANA)) {
    Analysis analysis=(Analysis)getModelElement(file);
    Collection<Indicator> indicators=IndicatorHelper.getIndicators(analysis.getResults());
    for (    Indicator indicator : indicators) {
      String fragment=null;
      IndicatorDefinition indicatorDefinition=indicator.getIndicatorDefinition();
      if (indicatorDefinition != null) {
        if (indicatorDefinition.eIsProxy()) {
          URI uri=((InternalEObject)indicatorDefinition).eProxyURI();
          fragment=uri.lastSegment();
        }
 else {
          fragment=indicatorDefinition.eResource().getURI().lastSegment();
        }
        if (fragment != null && !fragment.contains(FILE_NAME_FLAG)) {
          String replace=fragment.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str",FILE_NAME_FLAG);
          FileUtils.replaceInFile(file.getAbsolutePath(),fragment,replace);
        }
      }
    }
  }
}
Program: 138333
Project: 138333
Buggy source:
public boolean accept(File dir,String name){
  return name.endsWith(FactoriesUtil.ITEM_EXTENSION);
}

Fixed version (ground truth):
public boolean accept(File dir,String name){
  if (isNotSVNFolder(dir)) {
    File file=new Path(dir.getAbsolutePath()).append(name).toFile();
    if (file.isFile()) {
      ModelElement element=getModelElement(file);
      if (element != null) {
        String newName=WorkspaceUtils.normalize(element.getName());
        return !name.contains(newName) || !name.contains("String_Node_Str");
      }
    }
  }
  return false;
}
Program: 138334
Project: 138334
Buggy source:
public double getMatchingWeight(String str1,String str2){
  return StringComparisonUtil.difference(algorithm.encode(str1),algorithm.encode(str2)) / algorithm.getMaxCodeLen();
}

Fixed version (ground truth):
public double getMatchingWeight(String str1,String str2){
  return StringComparisonUtil.difference(algorithm.encode(str1),algorithm.encode(str2)) / (double)algorithm.getMaxCodeLen();
}
Program: 138335
Project: 138335
Buggy source:
public double getMatchingWeight(String str1,String str2){
  int maxLen=Math.min(str1.length(),str2.length());
  if (maxLen == 0) {
    return 1.0;
  }
 else {
    final int levenshteinDistance=StringUtils.getLevenshteinDistance(str1,str2);
    return 1.0 - ((double)levenshteinDistance / maxLen);
  }
}

Fixed version (ground truth):
public double getMatchingWeight(String str1,String str2){
  int maxLen=Math.max(str1.length(),str2.length());
  if (maxLen == 0) {
    return 1.0;
  }
 else {
    final int levenshteinDistance=StringUtils.getLevenshteinDistance(str1,str2);
    return 1.0 - ((double)levenshteinDistance / maxLen);
  }
}
Program: 138336
Project: 138336
Buggy source:
public double getMatchingWeight(String str1,String str2){
  return StringComparisonUtil.difference(algorithm.encode(str1),algorithm.encode(str2)) / algorithm.getMaxCodeLen();
}

Fixed version (ground truth):
public double getMatchingWeight(String str1,String str2){
  return StringComparisonUtil.difference(algorithm.encode(str1),algorithm.encode(str2)) / (double)algorithm.getMaxCodeLen();
}
Program: 138337
Project: 138337
Buggy source:
/** 
 * DOC bZhou Comment method "getItemPath". This method is to get the entire path of a item. e.g. getItemPath() = Project/TypedPath/StatePath/xxxx.property.
 * @param property
 * @return
 */
public static IPath getItemPath(Property property){
  Item item=property.getItem();
  IPath path=null;
  String fileName=null;
  EElementEName elementEName=EElementEName.getElementEName(item);
  if (elementEName != null) {
    URI uri=getURI(property);
    if (uri.isFile()) {
      path=new Path(uri.toFileString());
    }
 else     if (uri.isPlatform()) {
      path=new Path(uri.toPlatformString(false));
    }
 else {
      path=new Path(uri.lastSegment());
    }
    path=new Path(path.lastSegment());
    fileName=path.removeFileExtension().addFileExtension(elementEName.getFileExt()).toString();
  }
 else   if (item instanceof TDQItem) {
    TDQItem dqItem=(TDQItem)item;
    if (!StringUtils.isBlank(dqItem.getFilename())) {
      fileName=dqItem.getFilename();
    }
  }
  if (fileName != null) {
    path=ResourceManager.getRootProject().getFullPath().append(getItemTypedPath(property)).append(getItemStatePath(property)).append(fileName);
  }
  return path;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getItemPath". This method is to get the entire path of a item. e.g. getItemPath() = Project/TypedPath/StatePath/xxxx.property.
 * @param property
 * @return
 */
public static IPath getItemPath(Property property){
  Item item=property.getItem();
  IPath path=null;
  String fileName=null;
  EElementEName elementEName=EElementEName.getElementEName(item);
  if (elementEName != null) {
    URI uri=EObjectHelper.getURI(property);
    if (uri.isFile()) {
      path=new Path(uri.toFileString());
    }
 else     if (uri.isPlatform()) {
      path=new Path(uri.toPlatformString(false));
    }
 else {
      path=new Path(uri.lastSegment());
    }
    path=new Path(path.lastSegment());
    fileName=path.removeFileExtension().addFileExtension(elementEName.getFileExt()).toString();
  }
 else   if (item instanceof TDQItem) {
    TDQItem dqItem=(TDQItem)item;
    if (!StringUtils.isBlank(dqItem.getFilename())) {
      fileName=dqItem.getFilename();
    }
  }
  if (fileName != null) {
    path=ResourceManager.getRootProject().getFullPath().append(getItemTypedPath(property)).append(getItemStatePath(property)).append(fileName);
  }
  return path;
}
Program: 138338
Project: 138338
Buggy source:
/** 
 * DOC bZhou Comment method "getItemStatePath". This method is to get the relative path to the typed path of a item. e.g. Project/TypedPath/StatePath/xxxx.property
 * @param property
 * @return
 */
public static IPath getItemStatePath(Property property){
  Item item=property.getItem();
  String statePathStr=null;
  if (item.getState() != null) {
    statePathStr=item.getState().getPath();
  }
 else {
    URI propURI=getURI(property);
    if (StringUtils.isBlank(statePathStr) && propURI.isPlatformResource()) {
      IPath propPath=new Path(propURI.toPlatformString(true)).removeLastSegments(1);
      IPath typedPath=ResourceManager.getRootProject().getFullPath().append(getItemTypedPath(property));
      return propPath.makeRelativeTo(typedPath);
    }
  }
  return statePathStr != null ? new Path(statePathStr) : Path.EMPTY;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getItemStatePath". This method is to get the relative path to the typed path of a item. e.g. Project/TypedPath/StatePath/xxxx.property
 * @param property
 * @return
 */
public static IPath getItemStatePath(Property property){
  Item item=property.getItem();
  String statePathStr=null;
  if (item.getState() != null) {
    statePathStr=item.getState().getPath();
  }
 else {
    URI propURI=EObjectHelper.getURI(property);
    if (StringUtils.isBlank(statePathStr) && propURI.isPlatformResource()) {
      IPath propPath=new Path(propURI.toPlatformString(true)).removeLastSegments(1);
      IPath typedPath=ResourceManager.getRootProject().getFullPath().append(getItemTypedPath(property));
      return propPath.makeRelativeTo(typedPath);
    }
  }
  return statePathStr != null ? new Path(statePathStr) : Path.EMPTY;
}
Program: 138339
Project: 138339
Buggy source:
/** 
 * DOC bZhou Comment method "addResourceContent".
 * @param element
 * @return
 */
protected abstract void addResourceContent(ModelElement element);

Fixed version (ground truth):
public void addResourceContent(Resource resource,ModelElement element){
  if (resource != null) {
    EList<EObject> resourceContents=resource.getContents();
    if (!resourceContents.contains(element)) {
      resourceContents.add(element);
    }
    EList<Dependency> supplierDependency=element.getSupplierDependency();
    if (supplierDependency != null) {
      for (      Dependency dependency : supplierDependency) {
        if (!resourceContents.contains(dependency)) {
          resourceContents.add(dependency);
        }
      }
    }
  }
}
Program: 138340
Project: 138340
Buggy source:
public void addResourceContent(Resource resource,Analysis element){
  if (resource != null) {
    EList<EObject> resourceContents=resource.getContents();
    EList<Domain> dataFilter=AnalysisHelper.getDataFilter(element);
    List<Domain> domains=DomainHelper.getDomains(resourceContents);
    resourceContents.removeAll(domains);
    if (dataFilter != null) {
      for (      Domain domain : dataFilter) {
        if (!resourceContents.contains(domain)) {
          resourceContents.add(domain);
        }
      }
    }
    resource.getContents().add(element);
  }
}

Fixed version (ground truth):
public void addResourceContent(Resource resource,Analysis element){
  super.addResourceContent(resource,element);
  if (resource != null) {
    EList<EObject> resourceContents=resource.getContents();
    EList<Domain> dataFilter=AnalysisHelper.getDataFilter(element);
    if (dataFilter != null) {
      for (      Domain domain : dataFilter) {
        if (!resourceContents.contains(domain)) {
          resourceContents.add(domain);
        }
      }
    }
  }
}
Program: 138341
Project: 138341
Buggy source:
@Override protected void addResourceContent(ModelElement element){
  EList<EObject> resourceContents=element.eResource().getContents();
  EList<Dependency> supplierDependency=element.getSupplierDependency();
  if (supplierDependency.size() != 0) {
    resourceContents.addAll(supplierDependency);
  }
  Collection<? extends ModelElement> catalogs=ConnectionHelper.getCatalogs((Connection)element);
  resourceContents.addAll(catalogs);
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
  }
  Collection<? extends ModelElement> schemas=ConnectionHelper.getSchema((Connection)element);
  resourceContents.addAll(schemas);
  Collection<? extends ModelElement> xmlSchemas=ConnectionHelper.getTdXmlDocument((Connection)element);
  resourceContents.addAll(xmlSchemas);
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override protected void addResourceContent(ModelElement element){
  super.addResourceContent(element);
  if (element.eResource() != null) {
    EList<EObject> resourceContents=element.eResource().getContents();
    Collection<? extends ModelElement> catalogs=ConnectionHelper.getCatalogs((Connection)element);
    resourceContents.addAll(catalogs);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str");
    }
    Collection<? extends ModelElement> schemas=ConnectionHelper.getSchema((Connection)element);
    resourceContents.addAll(schemas);
    Collection<? extends ModelElement> xmlSchemas=ConnectionHelper.getTdXmlDocument((Connection)element);
    resourceContents.addAll(xmlSchemas);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str");
    }
  }
}
Program: 138343
Project: 138343
Buggy source:
@Override public void reset(){
  isChangedconnectionUrl=false;
  super.reset();
}

Fixed version (ground truth):
@Override public void reset(){
  changeUrl=false;
  super.reset();
}