nus-yam/ex-repair huggingface dataset:
Program: 137593
Project: 137593
Buggy source:
/** 
 * when the drill down is : invalid, should find all rows which not start with 1~9,and 0. this include: null, and not digitals.
 * @return
 */
private String getInvalidClause(){
  String value="String_Node_Str";
  if (isSybase()) {
    return columnName + "String_Node_Str" + this.columnName+ "String_Node_Str"+ dbmsLanguage.like()+ "String_Node_Str";
  }
 else   if (isPostGreSQL()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
 else   if (isTeradata()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
 else   if (isOracle()) {
    return columnName + "String_Node_Str" + "String_Node_Str"+ columnName+ "String_Node_Str";
  }
 else   if (isDB2()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str"+ "String_Node_Str";
  }
 else   if (isSqlServer()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str"+ dbmsLanguage.like()+ "String_Node_Str";
  }
 else   if (isInformix()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
 else   if (isVertica()) {
    return columnName + "String_Node_Str" + "String_Node_Str"+ columnName+ "String_Node_Str";
  }
  return columnName + "String_Node_Str" + columnName+ value;
}

Fixed version (ground truth):
/** 
 * when the drill down is : invalid, should find all rows which not start with 1~9,and 0. this include: null, and not digitals. FIXME use object language instead of if/else!!
 * @return
 */
private String getInvalidClause(){
  String value="String_Node_Str";
  if (isSybase()) {
    return columnName + "String_Node_Str" + this.columnName+ "String_Node_Str"+ dbmsLanguage.like()+ "String_Node_Str";
  }
 else   if (isPostGreSQL()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
 else   if (isTeradata()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
 else   if (isOracle()) {
    return columnName + "String_Node_Str" + "String_Node_Str"+ columnName+ "String_Node_Str";
  }
 else   if (isDB2()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str"+ "String_Node_Str";
  }
 else   if (isSqlServer()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str"+ dbmsLanguage.like()+ "String_Node_Str";
  }
 else   if (isInformix()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
 else   if (isVertica()) {
    return columnName + "String_Node_Str" + "String_Node_Str"+ columnName+ "String_Node_Str";
  }
  return columnName + "String_Node_Str" + columnName+ value;
}
Program: 137597
Project: 137597
Buggy source:
@Test public void testGetFileExtension(){
  Assert.assertEquals(FileConstants.SQL_EXTENSION,sqlItem.getFileExtension());
}

Fixed version (ground truth):
@Test public void testGetFileExtension(){
  Assert.assertEquals(WorkspaceUtils.SQL_EXTENSION,sqlItem.getFileExtension());
}
Program: 137598
Project: 137598
Buggy source:
/** 
 * DOC bZhou Comment method "initConnectionProperty".
 * @param tdDataProvider
 * @return
 */
private Property initConnectionProperty(DatabaseConnection tdDataProvider,Package pack){
  Property connectionProperty=PropertiesFactory.eINSTANCE.createProperty();
  String purpose=MetadataHelper.getPurpose(tdDataProvider);
  String description=MetadataHelper.getDescription(tdDataProvider);
  String status=MetadataHelper.getDevStatus(tdDataProvider);
  connectionProperty.setLabel(tdDataProvider.getName() + "String_Node_Str" + pack.getName());
  connectionProperty.setAuthor(((RepositoryContext)CoreRuntimePlugin.getInstance().getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getUser());
  connectionProperty.setPurpose(purpose);
  connectionProperty.setDescription(description);
  connectionProperty.setStatusCode(status);
  connectionProperty.setVersion(VersionUtils.DEFAULT_VERSION);
  return connectionProperty;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "initConnectionProperty".
 * @param tdDataProvider
 * @return
 */
private Property initConnectionProperty(DatabaseConnection tdDataProvider,Package pack){
  Property connectionProperty=PropertiesFactory.eINSTANCE.createProperty();
  String purpose=MetadataHelper.getPurpose(tdDataProvider);
  String description=MetadataHelper.getDescription(tdDataProvider);
  String status=MetadataHelper.getDevStatus(tdDataProvider);
  connectionProperty.setLabel(tdDataProvider.getName());
  connectionProperty.setAuthor(((RepositoryContext)CoreRuntimePlugin.getInstance().getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getUser());
  connectionProperty.setPurpose(purpose);
  connectionProperty.setDescription(description);
  connectionProperty.setStatusCode(status);
  connectionProperty.setVersion(VersionUtils.DEFAULT_VERSION);
  return connectionProperty;
}
Program: 137599
Project: 137599
Buggy source:
/** 
 * DOC zshen Comment method "updateConnectionParameter".
 * @param exportedConn
 */
private void updateConnectionParameter(DatabaseConnection exportedConn,Package pack){
  String connName=exportedConn.getName();
  exportedConn.setLabel(connName + "String_Node_Str" + pack.getName());
  String database=pack.getName();
  if (pack instanceof Schema) {
    Package parent=ColumnSetHelper.getParentCatalogOrSchema(pack);
    if (parent != null) {
      database=parent.getName();
    }
 else {
      database=exportedConn.getSID();
    }
    exportedConn.setUiSchema(pack.getName());
    if (EDatabaseTypeName.TERADATA.getXmlName().equalsIgnoreCase(exportedConn.getDatabaseType())) {
      if (database.isEmpty()) {
        database=pack.getName();
      }
    }
  }
  exportedConn.setSID(database);
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "updateConnectionParameter".
 * @param exportedConn
 */
private void updateConnectionParameter(DatabaseConnection exportedConn,Package pack){
  String connName=exportedConn.getName();
  exportedConn.setLabel(connName + "String_Node_Str" + pack.getName());
  exportedConn.setName(connName + "String_Node_Str" + pack.getName());
  String database=pack.getName();
  if (pack instanceof Schema) {
    Package parent=ColumnSetHelper.getParentCatalogOrSchema(pack);
    if (parent != null) {
      database=parent.getName();
    }
 else {
      database=exportedConn.getSID();
    }
    exportedConn.setUiSchema(pack.getName());
    if (EDatabaseTypeName.TERADATA.getXmlName().equalsIgnoreCase(exportedConn.getDatabaseType())) {
      if (database.isEmpty()) {
        database=pack.getName();
      }
    }
  }
  exportedConn.setSID(database);
}
Program: 137601
Project: 137601
Buggy source:
/** 
 * DOC zshen Comment method "compareResult".
 * @param newConnectionItem
 * @param oldConnectionItem
 */
private void compareResult(DatabaseConnectionItem newConnectionItem,DatabaseConnectionItem oldConnectionItem){
  Connection newConnection=newConnectionItem.getConnection();
  Connection oldConnection=oldConnectionItem.getConnection();
  Assert.assertTrue(newConnection != null);
  Assert.assertTrue(newConnection.eResource() != null);
  Assert.assertTrue(!newConnection.eIsProxy());
  boolean isConnUUIDSame=ResourceHelper.getUUID(newConnection).equalsIgnoreCase(ResourceHelper.getUUID(oldConnection));
  Catalog oldCatalog=CatalogHelper.getCatalog(oldConnection,"String_Node_Str");
  Catalog newCatalog=CatalogHelper.getCatalog(newConnection,"String_Node_Str");
  boolean isCatalogUUIDSame=ResourceHelper.getUUID(oldCatalog).equalsIgnoreCase(ResourceHelper.getUUID(newCatalog));
  Assert.assertFalse(isConnUUIDSame);
  Assert.assertFalse(isCatalogUUIDSame);
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "compareResult".
 * @param newConnectionItem
 * @param oldConnectionItem
 */
private void compareResult(DatabaseConnectionItem newConnectionItem,DatabaseConnectionItem oldConnectionItem){
  Connection newConnection=newConnectionItem.getConnection();
  Connection oldConnection=oldConnectionItem.getConnection();
  Assert.assertTrue(newConnection != null);
  Assert.assertTrue(newConnection.eResource() != null);
  Assert.assertTrue(!newConnection.eIsProxy());
  boolean isConnUUIDSame=StringUtils.equalsIgnoreCase(ResourceHelper.getUUID(newConnection),ResourceHelper.getUUID(oldConnection));
  Catalog oldCatalog=CatalogHelper.getCatalog(oldConnection,"String_Node_Str");
  Catalog newCatalog=CatalogHelper.getCatalog(newConnection,"String_Node_Str");
  boolean isCatalogUUIDSame=StringUtils.equalsIgnoreCase(ResourceHelper.getUUID(oldCatalog),ResourceHelper.getUUID(newCatalog));
  Assert.assertFalse(isConnUUIDSame);
  Assert.assertFalse(isCatalogUUIDSame);
}
Program: 137602
Project: 137602
Buggy source:
/** 
 * DOC xqliu Comment method "createStatement".
 * @param connection
 * @return
 * @throws SQLException
 */
public Statement createStatement(Connection connection,int fetchSize) throws SQLException {
  Statement statement=connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
  statement.setFetchSize(fetchSize);
  return statement;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "createStatement".
 * @param connection
 * @return
 * @throws SQLException
 */
public Statement createStatement(java.sql.Connection connection,int fetchSize) throws SQLException {
  Statement statement=connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
  statement.setFetchSize(fetchSize);
  return statement;
}
Program: 137603
Project: 137603
Buggy source:
@Override public Statement createStatement(Connection connection,int fetchSize) throws SQLException {
  return connection.createStatement();
}

Fixed version (ground truth):
@Override public Statement createStatement(java.sql.Connection connection,int fetchSize) throws SQLException {
  return connection.createStatement();
}
Program: 137604
Project: 137604
Buggy source:
/** 
 * DOC zqin Comment method "getQualifiedName".
 * @param tdDataProvider
 * @return
 */
public static String getColumnSetQualifiedName(Connection tdDataProvider,ColumnSet columnset){
  DbmsLanguage dbmsLanguage=DbmsLanguageFactory.createDbmsLanguage(tdDataProvider);
  Package catalogOrSchema=ColumnSetHelper.getParentCatalogOrSchema(columnset);
  if (catalogOrSchema == null) {
    return columnset.getName();
  }
  String catalogName=null;
  String schemaName=null;
  if (catalogOrSchema != null && RelationalPackage.eINSTANCE.getSchema().equals(catalogOrSchema.eClass())) {
    schemaName=catalogOrSchema.getName();
    Catalog parentCatalog=CatalogHelper.getParentCatalog(catalogOrSchema);
    if (parentCatalog != null) {
      catalogName=parentCatalog.getName();
    }
  }
 else {
    catalogName=catalogOrSchema.getName();
  }
  if (ConnectionUtils.isSybaseeDBProducts(dbmsLanguage.getDbmsName())) {
    schemaName=ColumnSetHelper.getTableOwner(columnset);
  }
  return dbmsLanguage.toQualifiedName(catalogName,schemaName,columnset.getName());
}

Fixed version (ground truth):
/** 
 * DOC zqin Comment method "getQualifiedName".
 * @param tdDataProvider
 * @return
 */
public static String getColumnSetQualifiedName(Connection tdDataProvider,ColumnSet columnset){
  DbmsLanguage dbmsLanguage=DbmsLanguageFactory.createDbmsLanguage(tdDataProvider);
  return dbmsLanguage.getQueryColumnSetWithPrefix(columnset);
}
Program: 137605
Project: 137605
Buggy source:
@Override public void run(){
  if (modelElements[0] instanceof TdColumn) {
    TdColumn[] columns=new TdColumn[modelElements.length];
    int i=0;
    for (    ModelElement me : modelElements) {
      columns[i]=(TdColumn)me;
      ++i;
    }
    if (ColumnHelper.isFromSameTable(Arrays.asList((TdColumn[])columns))) {
      TdColumn oneColumn=columns[0];
      Connection dataprovider=ConnectionHelper.getTdDataProvider(oneColumn);
      ColumnSet columnSetOwner=ColumnHelper.getColumnOwnerAsColumnSet(oneColumn);
      String tableName=ColumnSetNameHelper.getColumnSetQualifiedName(dataprovider,columnSetOwner);
      DbmsLanguage language=DbmsLanguageFactory.createDbmsLanguage(dataprovider);
      String columnClause=PluginConstant.EMPTY_STRING;
      for (      TdColumn column : columns) {
        columnClause+=language.quote(column.getName()) + PluginConstant.COMMA_STRING;
      }
      columnClause=columnClause.substring(0,columnClause.length() - 1);
      String query="String_Node_Str" + tableName + "String_Node_Str"+ columnClause+ "String_Node_Str"+ tableName;
      CorePlugin.getDefault().runInDQViewer(dataprovider,query,tableName);
    }
 else {
      MessageDialogWithToggle.openWarning(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (modelElements[0] instanceof TdColumn) {
    TdColumn[] columns=new TdColumn[modelElements.length];
    int i=0;
    for (    ModelElement me : modelElements) {
      columns[i]=(TdColumn)me;
      ++i;
    }
    if (ColumnHelper.isFromSameTable(Arrays.asList(columns))) {
      TdColumn oneColumn=columns[0];
      Connection dataprovider=ConnectionHelper.getTdDataProvider(oneColumn);
      ColumnSet columnSetOwner=ColumnHelper.getColumnOwnerAsColumnSet(oneColumn);
      DbmsLanguage language=DbmsLanguageFactory.createDbmsLanguage(dataprovider);
      String columnsWithPrefix=language.getQueryColumnsWithPrefix(columns);
      String columnSetName=language.getQueryColumnSetWithPrefix(columnSetOwner);
      String query="String_Node_Str" + columnsWithPrefix + "String_Node_Str"+ columnSetName;
      CorePlugin.getDefault().runInDQViewer(dataprovider,query,columnSetName);
    }
 else {
      MessageDialogWithToggle.openWarning(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
    }
  }
}
Program: 137608
Project: 137608
Buggy source:
/** 
 * DOC xqliu Comment method "fillDbConnectionInformation".
 * @deprecated Is Replaced By DBConnectionFiller.fillUIConnParams
 * @param dbConn
 * @return
 */
@Deprecated public static DatabaseConnection fillDbConnectionInformation(DatabaseConnection dbConn){
  boolean noStructureExists=ConnectionHelper.getAllCatalogs(dbConn).isEmpty() && ConnectionHelper.getAllSchemas(dbConn).isEmpty();
  java.sql.Connection sqlConn=null;
  try {
    if (noStructureExists) {
      IMetadataConnection metaConnection=ConvertionHelper.convert(dbConn);
      dbConn=(DatabaseConnection)MetadataFillFactory.getDBInstance().fillUIConnParams(metaConnection,dbConn);
      sqlConn=MetadataConnectionUtils.checkConnection(metaConnection).getObject();
      if (sqlConn != null) {
        DatabaseMetaData dm=ExtractMetaDataUtils.getDatabaseMetaData(sqlConn,dbConn,false);
        MetadataFillFactory.getDBInstance().fillCatalogs(dbConn,dm,MetadataConnectionUtils.getPackageFilter(dbConn,dm,true));
        MetadataFillFactory.getDBInstance().fillSchemas(dbConn,dm,MetadataConnectionUtils.getPackageFilter(dbConn,dm,false));
      }
    }
  }
  finally {
    if (sqlConn != null) {
      ConnectionUtils.closeConnection(sqlConn);
    }
  }
  return dbConn;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "fillDbConnectionInformation".
 * @deprecated Is Replaced By DBConnectionFiller.fillUIConnParams
 * @param dbConn
 * @return
 */
@Deprecated public static DatabaseConnection fillDbConnectionInformation(DatabaseConnection dbConn){
  boolean noStructureExists=ConnectionHelper.getAllCatalogs(dbConn).isEmpty() && ConnectionHelper.getAllSchemas(dbConn).isEmpty();
  java.sql.Connection sqlConn=null;
  try {
    if (noStructureExists) {
      IMetadataConnection metaConnection=ConvertionHelper.convert(dbConn);
      dbConn=(DatabaseConnection)MetadataFillFactory.getDBInstance().fillUIConnParams(metaConnection,dbConn);
      sqlConn=MetadataConnectionUtils.checkConnection(metaConnection).getObject();
      if (sqlConn != null) {
        DatabaseMetaData dm=ExtractMetaDataUtils.getInstance().getDatabaseMetaData(sqlConn,dbConn,false);
        MetadataFillFactory.getDBInstance().fillCatalogs(dbConn,dm,MetadataConnectionUtils.getPackageFilter(dbConn,dm,true));
        MetadataFillFactory.getDBInstance().fillSchemas(dbConn,dm,MetadataConnectionUtils.getPackageFilter(dbConn,dm,false));
      }
    }
  }
  finally {
    if (sqlConn != null) {
      ConnectionUtils.closeConnection(sqlConn);
    }
  }
  return dbConn;
}
Program: 137609
Project: 137609
Buggy source:
/** 
 * DOC qzhang Comment method "getClassDriver".
 * @param driverClassName
 * @param url
 * @return
 * @throws IllegalAccessException
 * @throws InstantiationException
 * @throws ClassNotFoundException
 */
private static Driver getClassDriver(String driverClassName,String url,Properties props) throws InstantiationException, IllegalAccessException {
  Driver driver=ExtractMetaDataUtils.getDriverCache().get(driverClassName);
  if (driver == null) {
    driver=MetadataConnectionUtils.getDriverCache().get(driverClassName);
  }
  if (driver != null) {
    return driver;
  }
  driver=getClassDriverFromSQLExplorer(driverClassName);
  if (driver != null) {
    return driver;
  }
  try {
    driver=(Driver)Class.forName(driverClassName).newInstance();
  }
 catch (  ClassNotFoundException e) {
    driver=findDriverByLibManageSystem(driverClassName,props);
  }
  return driver;
}

Fixed version (ground truth):
/** 
 * DOC qzhang Comment method "getClassDriver".
 * @param driverClassName
 * @param url
 * @return
 * @throws IllegalAccessException
 * @throws InstantiationException
 * @throws ClassNotFoundException
 */
private static Driver getClassDriver(String driverClassName,String url,Properties props) throws InstantiationException, IllegalAccessException {
  Driver driver=ExtractMetaDataUtils.getInstance().getDriverCache().get(driverClassName);
  if (driver == null) {
    driver=MetadataConnectionUtils.getDriverCache().get(driverClassName);
  }
  if (driver != null) {
    return driver;
  }
  driver=getClassDriverFromSQLExplorer(driverClassName);
  if (driver != null) {
    return driver;
  }
  try {
    driver=(Driver)Class.forName(driverClassName).newInstance();
  }
 catch (  ClassNotFoundException e) {
    driver=findDriverByLibManageSystem(driverClassName,props);
  }
  return driver;
}
Program: 137611
Project: 137611
Buggy source:
/** 
 * Method "changeCatalog".
 * @param catalogName unquoted catalog's name
 * @param connection
 * @throws SQLException
 */
protected boolean changeCatalog(String catalogName,Connection connection){
  try {
    if (!(ConnectionUtils.isOdbcMssql(connection) || ConnectionUtils.isOdbcOracle(connection) || ConnectionUtils.isOdbcProgress(connection)|| ConnectionUtils.isOdbcTeradata(connection)|| ExtractMetaDataUtils.isHiveConnection(connection))) {
      connection.setCatalog(catalogName);
    }
    return true;
  }
 catch (  RuntimeException e) {
    return traceError(Messages.getString("String_Node_Str",catalogName,e.getMessage()));
  }
catch (  SQLException e) {
    return traceError(Messages.getString("String_Node_Str",catalogName,e.getMessage()));
  }
}

Fixed version (ground truth):
/** 
 * Method "changeCatalog".
 * @param catalogName unquoted catalog's name
 * @param connection
 * @throws SQLException
 */
protected boolean changeCatalog(String catalogName,Connection connection){
  try {
    if (!(ConnectionUtils.isOdbcMssql(connection) || ConnectionUtils.isOdbcOracle(connection) || ConnectionUtils.isOdbcProgress(connection)|| ConnectionUtils.isOdbcTeradata(connection)|| ExtractMetaDataUtils.getInstance().isHiveConnection(connection))) {
      connection.setCatalog(catalogName);
    }
    return true;
  }
 catch (  RuntimeException e) {
    return traceError(Messages.getString("String_Node_Str",catalogName,e.getMessage()));
  }
catch (  SQLException e) {
    return traceError(Messages.getString("String_Node_Str",catalogName,e.getMessage()));
  }
}
Program: 137612
Project: 137612
Buggy source:
/** 
 * DOC xqliu Comment method "canParallel".
 * @return
 */
private boolean canParallel(Connection connection){
  try {
    @SuppressWarnings("String_Node_Str") DatabaseMetaData connectionMetadata=org.talend.utils.sql.ConnectionUtils.getConnectionMetadata(connection);
    if (connectionMetadata.getDriverName() != null && connectionMetadata.getDriverName().toLowerCase().startsWith(DatabaseConstant.ODBC_DRIVER_NAME)) {
      return false;
    }
    if ("String_Node_Str".equals(connection.getMetaData().getDatabaseProductName())) {
      return false;
    }
    if (ExtractMetaDataUtils.isHiveConnection(connection)) {
      return false;
    }
  }
 catch (  SQLException e) {
    log.warn(e,e);
  }
  return this.parallel;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "canParallel".
 * @return
 */
private boolean canParallel(Connection connection){
  try {
    @SuppressWarnings("String_Node_Str") DatabaseMetaData connectionMetadata=org.talend.utils.sql.ConnectionUtils.getConnectionMetadata(connection);
    if (connectionMetadata.getDriverName() != null && connectionMetadata.getDriverName().toLowerCase().startsWith(DatabaseConstant.ODBC_DRIVER_NAME)) {
      return false;
    }
    if ("String_Node_Str".equals(connection.getMetaData().getDatabaseProductName())) {
      return false;
    }
    if (ExtractMetaDataUtils.getInstance().isHiveConnection(connection)) {
      return false;
    }
  }
 catch (  SQLException e) {
    log.warn(e,e);
  }
  return this.parallel;
}
Program: 137613
Project: 137613
Buggy source:
protected boolean changeCatalog(String catalogName,Connection connection){
  try {
    if (!(ConnectionUtils.isOdbcMssql(connection) || ConnectionUtils.isOdbcOracle(connection) || ConnectionUtils.isOdbcProgress(connection)|| ConnectionUtils.isOdbcTeradata(connection)|| ExtractMetaDataUtils.isHiveConnection(connection))) {
      connection.setCatalog(catalogName);
    }
    return true;
  }
 catch (  RuntimeException e) {
    return traceError(Messages.getString("String_Node_Str",catalogName,e.getMessage()));
  }
catch (  SQLException e) {
    return traceError(Messages.getString("String_Node_Str",catalogName,e.getMessage()));
  }
}

Fixed version (ground truth):
protected boolean changeCatalog(String catalogName,Connection connection){
  try {
    if (!(ConnectionUtils.isOdbcMssql(connection) || ConnectionUtils.isOdbcOracle(connection) || ConnectionUtils.isOdbcProgress(connection)|| ConnectionUtils.isOdbcTeradata(connection)|| ExtractMetaDataUtils.getInstance().isHiveConnection(connection))) {
      connection.setCatalog(catalogName);
    }
    return true;
  }
 catch (  RuntimeException e) {
    return traceError(Messages.getString("String_Node_Str",catalogName,e.getMessage()));
  }
catch (  SQLException e) {
    return traceError(Messages.getString("String_Node_Str",catalogName,e.getMessage()));
  }
}
Program: 137614
Project: 137614
Buggy source:
/** 
 * Method "selectCatalog" attempts to set the catalog for the current connection.
 * @param catalogName the catalog to select
 * @return true if set, false if problem
 */
public boolean selectCatalog(String catalogName){
  if (connection == null) {
    return false;
  }
  try {
    if (!(ConnectionUtils.isOdbcProgress(connection) || ExtractMetaDataUtils.isHiveConnection(connection))) {
      connection.setCatalog(catalogName);
    }
    return true;
  }
 catch (  SQLException e) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Method "selectCatalog" attempts to set the catalog for the current connection.
 * @param catalogName the catalog to select
 * @return true if set, false if problem
 */
public boolean selectCatalog(String catalogName){
  if (connection == null) {
    return false;
  }
  try {
    if (!(ConnectionUtils.isOdbcProgress(connection) || ExtractMetaDataUtils.getInstance().isHiveConnection(connection))) {
      connection.setCatalog(catalogName);
    }
    return true;
  }
 catch (  SQLException e) {
    return false;
  }
}
Program: 137615
Project: 137615
Buggy source:
/** 
 * DOC gdbu Comment method "fillCatalogSchema".
 * @deprecated Won't be used.
 * @param tdDataProvider
 */
@Deprecated protected DatabaseConnection fillCatalogSchema(IMetadataConnection newMetadataConn){
  MetadataFillFactory instance=MetadataFillFactory.getDBInstance();
  ReturnCode rc=instance.checkConnection(newMetadataConn);
  DatabaseConnection dbConn=null;
  if (rc.isOk()) {
    dbConn=(DatabaseConnection)instance.fillUIConnParams(newMetadataConn,null);
    DatabaseMetaData dbMetadata=null;
    java.sql.Connection sqlConn=null;
    try {
      if (rc instanceof TypedReturnCode) {
        Object sqlConnObject=((TypedReturnCode)rc).getObject();
        if (sqlConnObject instanceof java.sql.Connection) {
          sqlConn=(java.sql.Connection)sqlConnObject;
          dbMetadata=ExtractMetaDataUtils.getConnectionMetadata(sqlConn);
        }
      }
      List<String> packageFilterCatalog=MetadataConnectionUtils.getPackageFilter(dbConn,dbMetadata,true);
      instance.fillCatalogs(dbConn,dbMetadata,packageFilterCatalog);
      List<String> packageFilterSchema=MetadataConnectionUtils.getPackageFilter(dbConn,dbMetadata,false);
      instance.fillSchemas(dbConn,dbMetadata,packageFilterSchema);
    }
 catch (    SQLException e) {
      log.error(e,e);
    }
 finally {
      if (sqlConn != null) {
        ConnectionUtils.closeConnection(sqlConn);
      }
    }
  }
 else {
    log.error(rc.getMessage());
  }
  return dbConn;
}

Fixed version (ground truth):
/** 
 * DOC gdbu Comment method "fillCatalogSchema".
 * @deprecated Won't be used.
 * @param tdDataProvider
 */
@Deprecated protected DatabaseConnection fillCatalogSchema(IMetadataConnection newMetadataConn){
  MetadataFillFactory instance=MetadataFillFactory.getDBInstance();
  ReturnCode rc=instance.checkConnection(newMetadataConn);
  DatabaseConnection dbConn=null;
  if (rc.isOk()) {
    dbConn=(DatabaseConnection)instance.fillUIConnParams(newMetadataConn,null);
    DatabaseMetaData dbMetadata=null;
    java.sql.Connection sqlConn=null;
    try {
      if (rc instanceof TypedReturnCode) {
        Object sqlConnObject=((TypedReturnCode)rc).getObject();
        if (sqlConnObject instanceof java.sql.Connection) {
          sqlConn=(java.sql.Connection)sqlConnObject;
          dbMetadata=ExtractMetaDataUtils.getInstance().getConnectionMetadata(sqlConn);
        }
      }
      List<String> packageFilterCatalog=MetadataConnectionUtils.getPackageFilter(dbConn,dbMetadata,true);
      instance.fillCatalogs(dbConn,dbMetadata,packageFilterCatalog);
      List<String> packageFilterSchema=MetadataConnectionUtils.getPackageFilter(dbConn,dbMetadata,false);
      instance.fillSchemas(dbConn,dbMetadata,packageFilterSchema);
    }
 catch (    SQLException e) {
      log.error(e,e);
    }
 finally {
      if (sqlConn != null) {
        ConnectionUtils.closeConnection(sqlConn);
      }
    }
  }
 else {
    log.error(rc.getMessage());
  }
  return dbConn;
}
Program: 137616
Project: 137616
Buggy source:
public double getWeight(String arg0,String arg1){
  final int max=4;
  int nbIdenticalChar=Math.min(max,Math.min(arg0.length(),arg1.length()));
  for (int c=0; c < max; c++) {
    if (arg0.charAt(c) != arg1.charAt(c)) {
      nbIdenticalChar=c;
      break;
    }
  }
  return (max - nbIdenticalChar) / ((double)max);
}

Fixed version (ground truth):
@Override public double getWeight(String arg0,String arg1){
  final int max=4;
  int nbIdenticalChar=Math.min(max,Math.min(arg0.length(),arg1.length()));
  for (int c=0; c < max; c++) {
    if (arg0.charAt(c) != arg1.charAt(c)) {
      nbIdenticalChar=c;
      break;
    }
  }
  return (max - nbIdenticalChar) / ((double)max);
}
Program: 137617
Project: 137617
Buggy source:
public AttributeMatcherType getMatchType(){
  return AttributeMatcherType.custom;
}

Fixed version (ground truth):
@Override public AttributeMatcherType getMatchType(){
  return AttributeMatcherType.CUSTOM;
}
Program: 137618
Project: 137618
Buggy source:
@Override public AttributeMatcherType getMatchType(){
  return AttributeMatcherType.custom;
}

Fixed version (ground truth):
@Override public AttributeMatcherType getMatchType(){
  return AttributeMatcherType.CUSTOM;
}
Program: 137619
Project: 137619
Buggy source:
/** 
 * DOC xqliu Comment method "executeAnalysis".
 * @param analysis
 * @param monitor
 * @return
 */
public static ReturnCode executeAnalysis(final Analysis analysis,IProgressMonitor monitor){
  IAnalysisExecutor analysisExecutor=getAnalysisExecutor(analysis);
  if (analysisExecutor != null) {
    analysisExecutor.setMonitor(monitor);
    ReturnCode execute=analysisExecutor.execute(analysis);
    if (Platform.isRunning()) {
      Display.getDefault().asyncExec(new Runnable(){
        public void run(){
          AnaResourceFileHelper.getInstance().save(analysis);
        }
      }
);
    }
    return execute;
  }
  return new ReturnCode(Messages.getString("String_Node_Str",analysis.getName()),false);
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "executeAnalysis".
 * @param analysis
 * @param monitor
 * @return
 * @deprecated use {@link #executeAnalysis(TDQAnalysisItem,IProgressMonitor)} instead.
 */
@Deprecated public static ReturnCode executeAnalysis(final Analysis analysis,IProgressMonitor monitor){
  IAnalysisExecutor analysisExecutor=getAnalysisExecutor(analysis);
  if (analysisExecutor != null) {
    analysisExecutor.setMonitor(monitor);
    ReturnCode execute=analysisExecutor.execute(analysis);
    if (Platform.isRunning()) {
      Display.getDefault().asyncExec(new Runnable(){
        public void run(){
          AnaResourceFileHelper.getInstance().save(analysis);
        }
      }
);
    }
    return execute;
  }
  return new ReturnCode(Messages.getString("String_Node_Str",analysis.getName()),false);
}
Program: 137620
Project: 137620
Buggy source:
/** 
 * DOC bZhou Comment method "save".
 * @param dqrule
 * @return
 */
public ReturnCode save(ModelElement element){
  AElementPersistance writer=ElementWriterFactory.getInstance().create(element);
  return writer.save(element);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "save".
 * @param dqrule
 * @return
 * @deprecated use {@link AElementPersistance#save(org.talend.core.model.properties.Item,boolean)} class instead
 */
@Deprecated public ReturnCode save(ModelElement element){
  AElementPersistance writer=ElementWriterFactory.getInstance().create(element);
  return writer.save(element);
}
Program: 137621
Project: 137621
Buggy source:
/** 
 * DOC zhao Comment method "testGroupQuality".
 */
private void testGroupQuality(){
  recordGroup.initialize();
  groupingRecords.clear();
  recordGroup.setSeperateOutput(Boolean.TRUE);
  recordGroup.setIsOutputDistDetails(true);
  try {
    for (    String[] inputRow : inputList) {
      recordGroup.doGroup(inputRow);
    }
    recordGroup.end();
  }
 catch (  IOException e) {
    log.error(e.getMessage(),e);
  }
catch (  InterruptedException e) {
    log.error(e.getMessage(),e);
  }
  for (  String[] rds : groupingRecords) {
    if (rds[0].equals("String_Node_Str")) {
      Assert.assertEquals(0.9768518573708005,Double.valueOf(rds[rds.length - 2]).doubleValue(),0d);
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC zhao Comment method "testGroupQuality".
 */
private void testGroupQuality(){
  try {
    recordGroup.initialize();
  }
 catch (  InstantiationException e) {
    log.error(e.getMessage(),e);
    Assert.fail();
  }
catch (  IllegalAccessException e) {
    log.error(e.getMessage(),e);
    Assert.fail();
  }
catch (  ClassNotFoundException e) {
    log.error(e.getMessage(),e);
    Assert.fail();
  }
  groupingRecords.clear();
  recordGroup.setSeperateOutput(Boolean.TRUE);
  recordGroup.setIsOutputDistDetails(true);
  try {
    for (    String[] inputRow : inputList) {
      recordGroup.doGroup(inputRow);
    }
    recordGroup.end();
  }
 catch (  IOException e) {
    log.error(e.getMessage(),e);
  }
catch (  InterruptedException e) {
    log.error(e.getMessage(),e);
  }
  for (  String[] rds : groupingRecords) {
    if (rds[0].equals("String_Node_Str")) {
      Assert.assertEquals(0.9768518573708005,Double.valueOf(rds[rds.length - 2]).doubleValue(),0d);
    }
  }
}
Program: 137624
Project: 137624
Buggy source:
/** 
 * DOC yyin Comment method "getColumnName".
 * @return
 */
private String getColumnName(){
  if (isSybase()) {
    return "String_Node_Str" + this.columnName + "String_Node_Str";
  }
 else   if (isPostGreSQL() || isTeradata()) {
    return "String_Node_Str" + this.columnName + "String_Node_Str";
  }
  return this.columnName;
}

Fixed version (ground truth):
/** 
 * DOC yyin Comment method "getColumnName".
 * @return
 */
private String getColumnName(){
  if (isSybase()) {
    return "String_Node_Str" + this.columnName + "String_Node_Str";
  }
 else   if (isPostGreSQL() || isTeradata()) {
    return "String_Node_Str" + this.columnName + "String_Node_Str";
  }
 else   if (isVertica()) {
    return "String_Node_Str" + columnName + "String_Node_Str";
  }
  return this.columnName;
}
Program: 137625
Project: 137625
Buggy source:
/** 
 * when the drill down is : invalid, should find all rows which not start with 1~9,and 0. this include: null, and not digitals.
 * @return
 */
private String getInvalidClause(){
  String value="String_Node_Str";
  if (isSybase()) {
    return columnName + "String_Node_Str" + this.columnName+ "String_Node_Str"+ dbmsLanguage.like()+ "String_Node_Str";
  }
 else   if (isPostGreSQL()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
 else   if (isTeradata()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
 else   if (isOracle()) {
    return columnName + "String_Node_Str" + "String_Node_Str"+ columnName+ "String_Node_Str";
  }
 else   if (isDB2()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str"+ "String_Node_Str";
  }
 else   if (isSqlServer()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str"+ dbmsLanguage.like()+ "String_Node_Str";
  }
 else   if (isInformix()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
  return columnName + "String_Node_Str" + columnName+ value;
}

Fixed version (ground truth):
/** 
 * when the drill down is : invalid, should find all rows which not start with 1~9,and 0. this include: null, and not digitals.
 * @return
 */
private String getInvalidClause(){
  String value="String_Node_Str";
  if (isSybase()) {
    return columnName + "String_Node_Str" + this.columnName+ "String_Node_Str"+ dbmsLanguage.like()+ "String_Node_Str";
  }
 else   if (isPostGreSQL()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
 else   if (isTeradata()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
 else   if (isOracle()) {
    return columnName + "String_Node_Str" + "String_Node_Str"+ columnName+ "String_Node_Str";
  }
 else   if (isDB2()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str"+ "String_Node_Str";
  }
 else   if (isSqlServer()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str"+ dbmsLanguage.like()+ "String_Node_Str";
  }
 else   if (isInformix()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
 else   if (isVertica()) {
    return columnName + "String_Node_Str" + "String_Node_Str"+ columnName+ "String_Node_Str";
  }
  return columnName + "String_Node_Str" + columnName+ value;
}
Program: 137627
Project: 137627
Buggy source:
protected boolean continueRun(){
  if (!Platform.isRunning()) {
    return true;
  }
  boolean ret=true;
  if (getMonitor() != null && getMonitor().isCanceled()) {
    ret=false;
  }
 else   if (this.isLowMemory) {
    ret=false;
  }
 else   if (AnalysisThreadMemoryChangeNotifier.getInstance().isUsageThresholdExceeded()) {
    this.usedMemory=AnalysisThreadMemoryChangeNotifier.convertToMB(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed());
    ret=false;
    this.isLowMemory=true;
  }
  return ret;
}

Fixed version (ground truth):
protected boolean continueRun(){
  checkContinueCount++;
  if (checkContinueCount % Evaluator.CHECK_EVERY_N_COUNT != 0) {
    return keepRunning;
  }
  if (!Platform.isRunning()) {
    return true;
  }
  if (getMonitor() != null && getMonitor().isCanceled()) {
    keepRunning=false;
  }
 else   if (this.isLowMemory) {
    keepRunning=false;
  }
 else   if (AnalysisThreadMemoryChangeNotifier.getInstance().isUsageThresholdExceeded()) {
    this.usedMemory=AnalysisThreadMemoryChangeNotifier.convertToMB(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed());
    this.isLowMemory=true;
    keepRunning=false;
  }
  return keepRunning;
}
Program: 137628
Project: 137628
Buggy source:
protected boolean continueRun(){
  if (!Platform.isRunning()) {
    return true;
  }
  boolean ret=true;
  if (monitor != null && monitor.isCanceled()) {
    ret=false;
  }
 else   if (this.isLowMemory) {
    ret=false;
  }
 else   if (AnalysisThreadMemoryChangeNotifier.getInstance().isUsageThresholdExceeded()) {
    this.usedMemory=AnalysisThreadMemoryChangeNotifier.convertToMB(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed());
    ret=false;
    this.isLowMemory=true;
  }
  return ret;
}

Fixed version (ground truth):
protected boolean continueRun(){
  checkContinueCount++;
  if (checkContinueCount % Evaluator.CHECK_EVERY_N_COUNT != 0) {
    return keepRunning;
  }
  if (!Platform.isRunning()) {
    return true;
  }
  if (monitor != null && monitor.isCanceled()) {
    keepRunning=false;
  }
 else   if (this.isLowMemory) {
    keepRunning=false;
  }
 else   if (AnalysisThreadMemoryChangeNotifier.getInstance().isUsageThresholdExceeded()) {
    this.usedMemory=AnalysisThreadMemoryChangeNotifier.convertToMB(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed());
    this.isLowMemory=true;
    keepRunning=false;
  }
  return keepRunning;
}
Program: 137629
Project: 137629
Buggy source:
protected void setUsageThreshold(long threshold){
  if (threshold <= 0) {
    tenuredGenPoll.setUsageThreshold(0);
  }
 else {
    tenuredGenPoll.setUsageThreshold(threshold);
  }
}

Fixed version (ground truth):
private void setUsageThreshold(long threshold){
  if (threshold <= 0) {
    tenuredGenPoll.setUsageThreshold(0);
  }
 else {
    tenuredGenPoll.setUsageThreshold(threshold);
  }
}
Program: 137630
Project: 137630
Buggy source:
public boolean isUsageThresholdExceeded(){
  if (!AnalysisThreadMemoryChangeNotifier.isAnaMemControl()) {
    return false;
  }
  boolean isExceeded=tenuredGenPoll.isUsageThresholdExceeded();
  if (isExceeded) {
    ManagementFactory.getMemoryMXBean().gc();
    isExceeded=tenuredGenPoll.isUsageThresholdExceeded();
  }
  return isExceeded;
}

Fixed version (ground truth):
/** 
 * Method "isUsageThresholdExceeded".
 * @return true when the memory control is activated and the used memory exceeds the threshold defined by the userin the preference page.
 */
public boolean isUsageThresholdExceeded(){
  if (!isThresholdControl) {
    return false;
  }
  boolean isExceeded=tenuredGenPoll.isUsageThresholdExceeded();
  if (isExceeded) {
    ManagementFactory.getMemoryMXBean().gc();
    isExceeded=tenuredGenPoll.isUsageThresholdExceeded();
  }
  return isExceeded;
}
Program: 137631
Project: 137631
Buggy source:
protected boolean initialize(){
  tenuredGenPoll=findTenuredGenPool();
  return null != tenuredGenPoll;
}

Fixed version (ground truth):
protected boolean initialize(){
  tenuredGenPoll=findTenuredGenPool();
  this.initializeThresholdsFromPreferences();
  return null != tenuredGenPoll;
}
Program: 137632
Project: 137632
Buggy source:
protected AbstractMemoryChangeNotifier(){
  initialize();
  final MemoryMXBean mbean=ManagementFactory.getMemoryMXBean();
  final NotificationEmitter emitter=(NotificationEmitter)mbean;
  emitter.addNotificationListener(new NotificationListener(){
    public void handleNotification(    Notification n,    Object hb){
      if (n.getType().equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED)) {
        long maxMemory=tenuredGenPoll.getUsage().getMax();
        long usedMemory=tenuredGenPoll.getUsage().getUsed();
        for (        IMemoryChangeListener listener : listeners) {
          listener.onMemoryChange(maxMemory - usedMemory);
        }
      }
    }
  }
,getListenerFilter(),getListenerHandBack());
}

Fixed version (ground truth):
protected AbstractMemoryChangeNotifier(){
  initialize();
}
Program: 137636
Project: 137636
Buggy source:
/** 
 * Getter for indicatorName.
 * @return the indicatorName
 */
public String getIndicatorName(){
  Property property=PropertyHelper.getProperty(indicator.getIndicatorDefinition());
  if (property != null) {
    return property.getDisplayName();
  }
 else {
    return this.indicator.getName();
  }
}

Fixed version (ground truth):
/** 
 * Getter for indicatorName.
 * @return the indicatorName
 */
public String getIndicatorName(){
  if (indicator.getIndicatorDefinition() != null) {
    Property property=PropertyHelper.getProperty(indicator.getIndicatorDefinition());
    if (property != null) {
      return property.getDisplayName();
    }
  }
  return this.indicator.getName();
}
Program: 137637
Project: 137637
Buggy source:
/** 
 * Create SchemaRepositoryNode under CatalogRepositoryNode.
 * @param node parent CatalogRepositoryNode
 * @param metadataCatalog parent CatalogViewObject
 * @param schema the schema should to be added under the catalog
 */
private List<IRepositoryNode> createRepositoryNodeSchema(List<Schema> schemas){
  if (!schemaChildren.isEmpty()) {
    return schemaChildren;
  }
  for (  Schema schema : schemas) {
    MetadataSchemaRepositoryObject metadataSchema=new MetadataSchemaRepositoryObject(((MetadataCatalogRepositoryObject)getObject()).getViewObject(),schema);
    RepositoryNode schemaNode=new DBSchemaRepNode(metadataSchema,this,ENodeType.TDQ_REPOSITORY_ELEMENT);
    schemaNode.setProperties(EProperties.LABEL,ERepositoryObjectType.METADATA_CON_SCHEMA);
    schemaNode.setProperties(EProperties.CONTENT_TYPE,ERepositoryObjectType.METADATA_CON_SCHEMA);
    metadataSchema.setRepositoryNode(schemaNode);
    schemaChildren.add(schemaNode);
  }
  return schemaChildren;
}

Fixed version (ground truth):
/** 
 * Create SchemaRepositoryNode under CatalogRepositoryNode.
 * @param node parent CatalogRepositoryNode
 * @param metadataCatalog parent CatalogViewObject
 * @param schema the schema should to be added under the catalog
 */
private List<IRepositoryNode> createRepositoryNodeSchema(List<Schema> schemas){
  if (!schemaChildren.isEmpty()) {
    return schemaChildren;
  }
  for (  Schema schema : schemas) {
    MetadataSchemaRepositoryObject metadataSchema=new MetadataSchemaRepositoryObject(((MetadataCatalogRepositoryObject)getObject()).getViewObject(),schema);
    metadataSchema.setParentCatalogObject(metadataCatalogObject);
    RepositoryNode schemaNode=new DBSchemaRepNode(metadataSchema,this,ENodeType.TDQ_REPOSITORY_ELEMENT);
    schemaNode.setProperties(EProperties.LABEL,ERepositoryObjectType.METADATA_CON_SCHEMA);
    schemaNode.setProperties(EProperties.CONTENT_TYPE,ERepositoryObjectType.METADATA_CON_SCHEMA);
    metadataSchema.setRepositoryNode(schemaNode);
    schemaChildren.add(schemaNode);
  }
  return schemaChildren;
}
Program: 137638
Project: 137638
Buggy source:
/** 
 * ADD mzhao 15750 , build dq metadata tree, get connection root node.
 */
public static List<IRepositoryNode> getConnectionRepositoryNodes(boolean withDeleted){
  RepositoryNode node=getRootNode(ERepositoryObjectType.METADATA);
  List<IRepositoryNode> connNodes=new ArrayList<IRepositoryNode>();
  if (node != null) {
    List<IRepositoryNode> childrens=node.getChildren();
    for (    IRepositoryNode subNode : childrens) {
      if (subNode instanceof DFConnectionFolderRepNode || subNode instanceof MDMConnectionFolderRepNode) {
        connNodes.addAll(getModelElementFromFolder(subNode,withDeleted));
      }
    }
  }
  return connNodes;
}

Fixed version (ground truth):
/** 
 * ADD mzhao 15750 , build dq metadata tree, get connection root node.
 */
public static List<IRepositoryNode> getConnectionRepositoryNodes(boolean withDeleted){
  RepositoryNode node=getRootNode(ERepositoryObjectType.METADATA);
  List<IRepositoryNode> connNodes=new ArrayList<IRepositoryNode>();
  if (node != null) {
    List<IRepositoryNode> childrens=node.getChildren();
    for (    IRepositoryNode subNode : childrens) {
      if (subNode instanceof DBConnectionFolderRepNode || subNode instanceof DFConnectionFolderRepNode || subNode instanceof MDMConnectionFolderRepNode) {
        connNodes.addAll(getModelElementFromFolder(subNode,withDeleted));
      }
    }
  }
  return connNodes;
}
Program: 137639
Project: 137639
Buggy source:
/** 
 * DOC zshen Comment method "getTableViewerList".
 * @param ctabFolder
 * @return
 */
private Collection<? extends AbstractMatchAnalysisTableViewer> getTableViewerList(){
  List<AbstractMatchAnalysisTableViewer> returnList=new ArrayList<>();
  if (matchingKeySection == null) {
    return returnList;
  }
  CTabFolder ctabFolder=matchingKeySection.getRuleFolder();
  if (ctabFolder == null || ctabFolder.getItemCount() == 0) {
    return returnList;
  }
  for (  CTabItem item : ctabFolder.getItems()) {
    MatchRuleTableComposite data=(MatchRuleTableComposite)item.getData(MatchAnalysisConstant.MATCH_RULE_TABLE_COMPOSITE);
    returnList.add(data.getTableViewer());
  }
  return returnList;
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "getTableViewerList".
 * @param ctabFolder
 * @return
 */
private Collection<? extends AbstractMatchAnalysisTableViewer> getTableViewerList(){
  List<AbstractMatchAnalysisTableViewer> returnList=new ArrayList<AbstractMatchAnalysisTableViewer>();
  if (matchingKeySection == null) {
    return returnList;
  }
  CTabFolder ctabFolder=matchingKeySection.getRuleFolder();
  if (ctabFolder == null || ctabFolder.getItemCount() == 0) {
    return returnList;
  }
  for (  CTabItem item : ctabFolder.getItems()) {
    MatchRuleTableComposite data=(MatchRuleTableComposite)item.getData(MatchAnalysisConstant.MATCH_RULE_TABLE_COMPOSITE);
    returnList.add(data.getTableViewer());
  }
  return returnList;
}
Program: 137640
Project: 137640
Buggy source:
/** 
 * DOC zshen Comment method "getTableViewerList".
 * @param ctabFolder
 * @return
 */
private Collection<? extends AbstractMatchAnalysisTableViewer> getTableViewerList(){
  List<AbstractMatchAnalysisTableViewer> returnList=new ArrayList<>();
  if (matchingKeySection == null) {
    return returnList;
  }
  CTabFolder ctabFolder=matchingKeySection.getRuleFolder();
  if (ctabFolder == null || ctabFolder.getItemCount() == 0) {
    return returnList;
  }
  for (  CTabItem item : ctabFolder.getItems()) {
    MatchRuleTableComposite data=(MatchRuleTableComposite)item.getData(MatchAnalysisConstant.MATCH_RULE_TABLE_COMPOSITE);
    returnList.add(data.getTableViewer());
  }
  return returnList;
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "getTableViewerList".
 * @param ctabFolder
 * @return
 */
private Collection<? extends AbstractMatchAnalysisTableViewer> getTableViewerList(){
  List<AbstractMatchAnalysisTableViewer> returnList=new ArrayList<AbstractMatchAnalysisTableViewer>();
  if (matchingKeySection == null) {
    return returnList;
  }
  CTabFolder ctabFolder=matchingKeySection.getRuleFolder();
  if (ctabFolder == null || ctabFolder.getItemCount() == 0) {
    return returnList;
  }
  for (  CTabItem item : ctabFolder.getItems()) {
    MatchRuleTableComposite data=(MatchRuleTableComposite)item.getData(MatchAnalysisConstant.MATCH_RULE_TABLE_COMPOSITE);
    returnList.add(data.getTableViewer());
  }
  return returnList;
}
Program: 137641
Project: 137641
Buggy source:
/** 
 * DOC yyin Comment method "convertToList".
 * @param asList
 * @return
 */
private List<BlockKeyDefinition> convertToList(BlockKeyDefinition[] blockArray){
  List<BlockKeyDefinition> resultList=new ArrayList<>();
  for (  BlockKeyDefinition blocKey : blockArray) {
    resultList.add(blocKey);
  }
  return resultList;
}

Fixed version (ground truth):
/** 
 * DOC yyin Comment method "convertToList".
 * @param asList
 * @return
 */
private List<BlockKeyDefinition> convertToList(BlockKeyDefinition[] blockArray){
  List<BlockKeyDefinition> resultList=new ArrayList<BlockKeyDefinition>();
  for (  BlockKeyDefinition blocKey : blockArray) {
    resultList.add(blocKey);
  }
  return resultList;
}