nus-yam/ex-repair huggingface dataset:
Program: 128480
Project: 128480
Buggy source:
/** 
 * DOC zshen Comment method "fillCatalogs".
 * @param dbConn the connection which you want schema to be filled.Can't be null if need to fill the catalogs intothe object of connection. And if Linked is false everything is ok.
 * @param dbJDBCMetadata If it is null the method will do nothing and return null too.
 * @param catalogFilter The list for filter catalogs which you want get.If it is null all of catalogs which belongto the connection will be return.
 * @return The list of catalogs after filter.Will return null only if dbJDBCMetadata isn't normal.
 */
public List<Catalog> fillCatalogs(Connection dbConn,DatabaseMetaData dbJDBCMetadata,List<String> catalogFilter);

Fixed version (ground truth):
public List<Catalog> fillCatalogs(Connection dbConn,DatabaseMetaData dbJDBCMetadata,IMetadataConnection metaConnection,List<String> catalogFilter);
Program: 128481
Project: 128481
Buggy source:
public List<orgomg.cwm.objectmodel.core.Package> fillSchemas(Connection dbConn,DatabaseMetaData dbJDBCMetadata,List<String> schemaFilter){
  List<TdXmlSchema> xmlDocs=new ArrayList<TdXmlSchema>();
  try {
    XtentisBindingStub stub=MetadataConnectionUtils.getXtentisBindingStub((MDMConnection)dbConn);
    WSDataModelPK[] pks=stub.getDataModelPKs(new WSRegexDataModelPKs("String_Node_Str"));
    String techXSDFolderName=getTechXSDFolderName();
    for (    WSDataModelPK pk : pks) {
      if (isCreateElement(schemaFilter,pk.getPk())) {
        adaptToCWMDocument(xmlDocs,stub,pk.getPk(),techXSDFolderName,dbConn);
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  ConnectionHelper.addXMLDocuments(xmlDocs);
  return ListUtils.castList(orgomg.cwm.objectmodel.core.Package.class,xmlDocs);
}

Fixed version (ground truth):
public List<Package> fillSchemas(Connection dbConn,DatabaseMetaData dbJDBCMetadata,IMetadataConnection metaConnection,List<String> Filter){
  return null;
}
Program: 128482
Project: 128482
Buggy source:
public List<Catalog> fillCatalogs(Connection dbConn,DatabaseMetaData dbJDBCMetadata,List<String> catalogFilter){
  return null;
}

Fixed version (ground truth):
public List<Catalog> fillCatalogs(Connection dbConn,DatabaseMetaData dbJDBCMetadata,IMetadataConnection metaConnection,List<String> catalogFilter){
  return null;
}
Program: 128483
Project: 128483
Buggy source:
/** 
 * Fill the catalog with the restrain of catalogFilter, note that if the database name (e.g SID for SQL server ) on connection wizard UI is set, then this method will only return one catalog with this name.
 * @param dbConn the connection which you want schema to be filled.Can't be null if need to fill the catalogs intothe object of connection. And if Linked is false everything is ok.
 * @param dbJDBCMetadata If it is null the method will do nothing and return null too.
 * @param catalogFilter The list for filter catalogs which you want get.If it is null all of catalogs which belongto the connection will be return.
 * @return The list of catalogs after filter.Will return null only if dbJDBCMetadata isn't normal.
 */
public List<Catalog> fillCatalogs(Connection dbConn,DatabaseMetaData dbJDBCMetadata,List<String> catalogFilter){
  return metadataFiller.fillCatalogs(dbConn,dbJDBCMetadata,catalogFilter);
}

Fixed version (ground truth):
public List<Catalog> fillCatalogs(Connection dbConn,DatabaseMetaData dbJDBCMetadata,IMetadataConnection metaConnection,List<String> catalogFilter){
  return metadataFiller.fillCatalogs(dbConn,dbJDBCMetadata,metaConnection,catalogFilter);
}
Program: 128484
Project: 128484
Buggy source:
/** 
 * Fill the schema with the restrain of schemaFilter, note that if the schema name (e.g UISchema for Oracle ) on connection wizard UI is set, then this method will only return one schema with this name.
 * @param dbConn the connection which you want schema to be filled.Can't be null if need to fill the schemas intothe object of connection.And if Linked is false everything is ok.
 * @param dbJDBCMetadata If it is null the method will do nothing and return null too.
 * @param Filter The list for filter schemas which you want to get.If it is null all of schenas which belong to theconnection will be return.
 * @return The list of schemas after filter.Will return null only if dbJDBCMetadata isn't normal.
 */
public List<Package> fillSchemas(Connection dbConn,DatabaseMetaData dbJDBCMetadata,List<String> schemaFilter){
  return metadataFiller.fillSchemas(dbConn,dbJDBCMetadata,schemaFilter);
}

Fixed version (ground truth):
public List<Package> fillSchemas(Connection dbConn,DatabaseMetaData dbJDBCMetadata,IMetadataConnection metaConnection,List<String> schemaFilter){
  return metadataFiller.fillSchemas(dbConn,dbJDBCMetadata,metaConnection,schemaFilter);
}
Program: 128485
Project: 128485
Buggy source:
public static String parseTo_String(String s){
  return s;
}

Fixed version (ground truth):
public static String parseTo_String(final List<String> s,String fieldSep){
  if (s == null) {
    return null;
  }
  StringBuffer result=new StringBuffer();
  result.append("String_Node_Str");
  for (int i=0; i < s.size(); i++) {
    if (i != 0) {
      result.append(fieldSep);
    }
    result.append(s.get(i));
  }
  result.append("String_Node_Str");
  return result.toString();
}
Program: 128488
Project: 128488
Buggy source:
public static String parseTo_String(String s){
  return s;
}

Fixed version (ground truth):
public static String parseTo_String(final List<String> s,String fieldSep){
  if (s == null) {
    return null;
  }
  StringBuffer result=new StringBuffer();
  result.append("String_Node_Str");
  for (int i=0; i < s.size(); i++) {
    if (i != 0) {
      result.append(fieldSep);
    }
    result.append(s.get(i));
  }
  result.append("String_Node_Str");
  return result.toString();
}
Program: 128491
Project: 128491
Buggy source:
public CsvArray convertNode(ConnectionItem connectionItem,String tableName) throws ProcessorException ;

Fixed version (ground truth):
public CsvArray convertNode(ConnectionItem connectionItem,IMetadataConnection convertedConnection,String tableName) throws ProcessorException ;
Program: 128492
Project: 128492
Buggy source:
public static void fillCatalogAndSchemas(IMetadataConnection iMetadataConnection,DatabaseConnection temConnection){
  java.sql.Connection sqlConn=null;
  temConnection=(DatabaseConnection)MetadataFillFactory.getDBInstance().fillUIConnParams(iMetadataConnection,temConnection);
  sqlConn=MetadataConnectionUtils.checkConnection(iMetadataConnection).getObject();
  if (((DatabaseConnection)iMetadataConnection.getCurrentConnection()).getUiSchema() != null) {
    temConnection.setUiSchema(((DatabaseConnection)iMetadataConnection.getCurrentConnection()).getUiSchema());
  }
  String dbType=iMetadataConnection.getDbType();
  if (sqlConn != null) {
    DatabaseMetaData dbMetaData=ExtractMetaDataUtils.getDatabaseMetaData(sqlConn,dbType,false,iMetadataConnection.getDatabase());
    MetadataFillFactory.getDBInstance().fillCatalogs(temConnection,dbMetaData,MetadataConnectionUtils.getPackageFilter(temConnection,dbMetaData,true));
    MetadataFillFactory.getDBInstance().fillSchemas(temConnection,dbMetaData,MetadataConnectionUtils.getPackageFilter(temConnection,dbMetaData,false));
  }
}

Fixed version (ground truth):
public static void fillCatalogAndSchemas(IMetadataConnection iMetadataConnection,DatabaseConnection temConnection){
  java.sql.Connection sqlConn=null;
  temConnection=(DatabaseConnection)MetadataFillFactory.getDBInstance().fillUIConnParams(iMetadataConnection,temConnection);
  sqlConn=MetadataConnectionUtils.checkConnection(iMetadataConnection).getObject();
  if (((DatabaseConnection)iMetadataConnection.getCurrentConnection()).getUiSchema() != null) {
    temConnection.setUiSchema(((DatabaseConnection)iMetadataConnection.getCurrentConnection()).getUiSchema());
  }
  String dbType=iMetadataConnection.getDbType();
  if (sqlConn != null) {
    DatabaseMetaData dbMetaData=ExtractMetaDataUtils.getDatabaseMetaData(sqlConn,dbType,false,iMetadataConnection.getDatabase());
    MetadataFillFactory.getDBInstance().fillCatalogs(temConnection,dbMetaData,iMetadataConnection,MetadataConnectionUtils.getPackageFilter(temConnection,dbMetaData,true));
    MetadataFillFactory.getDBInstance().fillSchemas(temConnection,dbMetaData,iMetadataConnection,MetadataConnectionUtils.getPackageFilter(temConnection,dbMetaData,false));
  }
}
Program: 128494
Project: 128494
Buggy source:
/** 
 * fill the catalog and schemas into Postgresql database connection.
 * @param dbConn
 * @param dbJDBCMetadata
 * @param catalogList
 * @return
 */
private List<Catalog> fillPostgresqlCatalogs(Connection dbConn,DatabaseMetaData dbJDBCMetadata,List<Catalog> catalogList){
  DatabaseConnection databaseConnection=(DatabaseConnection)dbConn;
  String catalogName=databaseConnection.getSID();
  if (StringUtils.isEmpty(catalogName)) {
    catalogName=databaseConnection.getUsername();
  }
  if (StringUtils.isNotEmpty(catalogName)) {
    List<String> filterList=new ArrayList<String>();
    filterList.addAll(postFillCatalog(catalogList,filterList,catalogName,dbConn));
    for (    Catalog catalog : catalogList) {
      List<Schema> schemaList=new ArrayList<Schema>();
      try {
        schemaList=fillSchemaToCatalog(dbConn,dbJDBCMetadata,catalog,filterList);
        if (!schemaList.isEmpty() && schemaList.size() > 0) {
          CatalogHelper.addSchemas(schemaList,catalog);
        }
      }
 catch (      Throwable e) {
        log.info(e);
      }
      ConnectionHelper.addCatalog(catalog,dbConn);
    }
  }
  return catalogList;
}

Fixed version (ground truth):
/** 
 * fill the catalog and schemas into Postgresql database connection.
 * @param dbConn
 * @param dbJDBCMetadata
 * @param catalogList
 * @return
 */
private List<Catalog> fillPostgresqlCatalogs(IMetadataConnection metaConnection,Connection dbConn,DatabaseMetaData dbJDBCMetadata,List<Catalog> catalogList){
  DatabaseConnection databaseConnection=(DatabaseConnection)dbConn;
  String catalogName=databaseConnection.getSID();
  if (StringUtils.isEmpty(catalogName)) {
    catalogName=databaseConnection.getUsername();
  }
  if (StringUtils.isNotEmpty(catalogName)) {
    List<String> filterList=new ArrayList<String>();
    filterList.addAll(postFillCatalog(metaConnection,catalogList,filterList,catalogName,dbConn));
    for (    Catalog catalog : catalogList) {
      List<Schema> schemaList=new ArrayList<Schema>();
      try {
        schemaList=fillSchemaToCatalog(dbConn,dbJDBCMetadata,catalog,filterList);
        if (!schemaList.isEmpty() && schemaList.size() > 0) {
          CatalogHelper.addSchemas(schemaList,catalog);
        }
      }
 catch (      Throwable e) {
        log.info(e);
      }
      ConnectionHelper.addCatalog(catalog,dbConn);
    }
  }
  return catalogList;
}
Program: 128495
Project: 128495
Buggy source:
public List<Catalog> fillCatalogs(Connection dbConn,DatabaseMetaData dbJDBCMetadata,List<String> catalogFilter){
}

Fixed version (ground truth):
public List<Catalog> fillCatalogs(Connection dbConn,DatabaseMetaData dbJDBCMetadata,IMetadataConnection metaConnection,List<String> catalogFilter){
}
Program: 128497
Project: 128497
Buggy source:
private List<String> postFillCatalog(List<Catalog> catalogList,List<String> filterList,String catalogName,Connection dbConn){
  Catalog catalog=CatalogHelper.createCatalog(catalogName);
  catalogList.add(catalog);
  DatabaseConnection dbConnection=(DatabaseConnection)dbConn;
  if (dbConnection.getDatabaseType() != null && dbConnection.getDatabaseType().equals(EDatabaseTypeName.AS400.getDisplayName())) {
    IMetadataConnection iMetadataCon=ConvertionHelper.convert(dbConnection);
    if (iMetadataCon != null) {
      if (!StringUtils.isEmpty(iMetadataCon.getDatabase()) && !filterList.contains(iMetadataCon.getDatabase())) {
        filterList.add(iMetadataCon.getDatabase());
      }
      String pattern=ExtractMetaDataUtils.retrieveSchemaPatternForAS400(iMetadataCon.getAdditionalParams());
      if (pattern != null && !"String_Node_Str".equals(pattern)) {
        String[] multiSchems=ExtractMetaDataUtils.getMultiSchems(pattern);
        if (multiSchems != null) {
          for (          String s : multiSchems) {
            if (!StringUtils.isEmpty(s) && !filterList.contains(s)) {
              filterList.add(s);
            }
          }
        }
      }
    }
  }
 else {
    String uiSchema=dbConnection.getUiSchema();
    if (!StringUtils.isBlank(uiSchema) && !filterList.contains(uiSchema)) {
      filterList.add(uiSchema);
    }
  }
  return filterList;
}

Fixed version (ground truth):
private List<String> postFillCatalog(IMetadataConnection metaConnection,List<Catalog> catalogList,List<String> filterList,String catalogName,Connection dbConn){
  Catalog catalog=CatalogHelper.createCatalog(catalogName);
  catalogList.add(catalog);
  DatabaseConnection dbConnection=(DatabaseConnection)dbConn;
  if (dbConnection.getDatabaseType() != null && dbConnection.getDatabaseType().equals(EDatabaseTypeName.AS400.getDisplayName())) {
    IMetadataConnection iMetadataCon=metaConnection;
    if (iMetadataCon == null) {
      iMetadataCon=ConvertionHelper.convert(dbConnection);
    }
    if (iMetadataCon != null) {
      if (!StringUtils.isEmpty(iMetadataCon.getDatabase()) && !filterList.contains(iMetadataCon.getDatabase())) {
        filterList.add(iMetadataCon.getDatabase());
      }
      String pattern=ExtractMetaDataUtils.retrieveSchemaPatternForAS400(iMetadataCon.getAdditionalParams());
      if (pattern != null && !"String_Node_Str".equals(pattern)) {
        String[] multiSchems=ExtractMetaDataUtils.getMultiSchems(pattern);
        if (multiSchems != null) {
          for (          String s : multiSchems) {
            if (!StringUtils.isEmpty(s) && !filterList.contains(s)) {
              filterList.add(s);
            }
          }
        }
      }
    }
  }
 else {
    String uiSchema=dbConnection.getUiSchema();
    if (!StringUtils.isBlank(uiSchema) && !filterList.contains(uiSchema)) {
      filterList.add(uiSchema);
    }
  }
  return filterList;
}
Program: 128498
Project: 128498
Buggy source:
/** 
 * zshen Comment method "fillSchemas".
 * @param dbConn the connection which you want schema to be filled.Can't be null if need to fill the schemas intothe object of connection.And if Linked is false everything is ok.
 * @param dbJDBCMetadata If it is null the method will do nothing and return null too.
 * @param Filter The list for filter schemas which you want to get.If it is null all of schenas which belong to theconnection will be return.
 * @return The list of schemas after filter.Will return null only if dbJDBCMetadata isn't normal.
 */
public List<Package> fillSchemas(Connection dbConn,DatabaseMetaData dbJDBCMetadata,List<String> Filter);

Fixed version (ground truth):
public List<Package> fillSchemas(Connection dbConn,DatabaseMetaData dbJDBCMetadata,IMetadataConnection metaConnection,List<String> Filter);
Program: 128499
Project: 128499
Buggy source:
/** 
 * zshen Comment method "fillUIParams". convert a DatabaseConnection object to IMetadataConnection
 * @deprecated
 * @see {@link org.talend.core.model.metadata.builder.ConvertionHelper#fillUIParams(IMetadataConnection,DatabaseConnection)}
 * @param conn
 * @return null only if conn is null
 */
public IMetadataConnection fillUIParams(DatabaseConnection conn);

Fixed version (ground truth):
/** 
 * zshen Comment method "fillUIParams". convert a DatabaseConnection object to IMetadataConnection
 * @deprecated
 * @see {@link org.talend.core.model.metadata.builder.ConvertionHelper#fillUIParams(IMetadataConnection,DatabaseConnection)}
 * @param conn
 * @return null only if conn is null
 */
@Deprecated public IMetadataConnection fillUIParams(DatabaseConnection conn);
Program: 128500
Project: 128500
Buggy source:
/** 
 * DOC zshen Comment method "fillCatalogs".
 * @param dbConn the connection which you want schema to be filled.Can't be null if need to fill the catalogs intothe object of connection. And if Linked is false everything is ok.
 * @param dbJDBCMetadata If it is null the method will do nothing and return null too.
 * @param catalogFilter The list for filter catalogs which you want get.If it is null all of catalogs which belongto the connection will be return.
 * @return The list of catalogs after filter.Will return null only if dbJDBCMetadata isn't normal.
 */
public List<Catalog> fillCatalogs(Connection dbConn,DatabaseMetaData dbJDBCMetadata,List<String> catalogFilter);

Fixed version (ground truth):
public List<Catalog> fillCatalogs(Connection dbConn,DatabaseMetaData dbJDBCMetadata,IMetadataConnection metaConnection,List<String> catalogFilter);
Program: 128501
Project: 128501
Buggy source:
public List<orgomg.cwm.objectmodel.core.Package> fillSchemas(Connection dbConn,DatabaseMetaData dbJDBCMetadata,List<String> schemaFilter){
  List<TdXmlSchema> xmlDocs=new ArrayList<TdXmlSchema>();
  try {
    XtentisBindingStub stub=MetadataConnectionUtils.getXtentisBindingStub((MDMConnection)dbConn);
    WSDataModelPK[] pks=stub.getDataModelPKs(new WSRegexDataModelPKs("String_Node_Str"));
    String techXSDFolderName=getTechXSDFolderName();
    for (    WSDataModelPK pk : pks) {
      if (isCreateElement(schemaFilter,pk.getPk())) {
        adaptToCWMDocument(xmlDocs,stub,pk.getPk(),techXSDFolderName,dbConn);
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
  ConnectionHelper.addXMLDocuments(xmlDocs);
  return ListUtils.castList(orgomg.cwm.objectmodel.core.Package.class,xmlDocs);
}

Fixed version (ground truth):
public List<Package> fillSchemas(Connection dbConn,DatabaseMetaData dbJDBCMetadata,IMetadataConnection metaConnection,List<String> Filter){
  return null;
}
Program: 128502
Project: 128502
Buggy source:
public List<Catalog> fillCatalogs(Connection dbConn,DatabaseMetaData dbJDBCMetadata,List<String> catalogFilter){
  return null;
}

Fixed version (ground truth):
public List<Catalog> fillCatalogs(Connection dbConn,DatabaseMetaData dbJDBCMetadata,IMetadataConnection metaConnection,List<String> catalogFilter){
  return null;
}
Program: 128503
Project: 128503
Buggy source:
/** 
 * Fill the catalog with the restrain of catalogFilter, note that if the database name (e.g SID for SQL server ) on connection wizard UI is set, then this method will only return one catalog with this name.
 * @param dbConn the connection which you want schema to be filled.Can't be null if need to fill the catalogs intothe object of connection. And if Linked is false everything is ok.
 * @param dbJDBCMetadata If it is null the method will do nothing and return null too.
 * @param catalogFilter The list for filter catalogs which you want get.If it is null all of catalogs which belongto the connection will be return.
 * @return The list of catalogs after filter.Will return null only if dbJDBCMetadata isn't normal.
 */
public List<Catalog> fillCatalogs(Connection dbConn,DatabaseMetaData dbJDBCMetadata,List<String> catalogFilter){
  return metadataFiller.fillCatalogs(dbConn,dbJDBCMetadata,catalogFilter);
}

Fixed version (ground truth):
public List<Catalog> fillCatalogs(Connection dbConn,DatabaseMetaData dbJDBCMetadata,IMetadataConnection metaConnection,List<String> catalogFilter){
  return metadataFiller.fillCatalogs(dbConn,dbJDBCMetadata,metaConnection,catalogFilter);
}
Program: 128504
Project: 128504
Buggy source:
/** 
 * Fill the schema with the restrain of schemaFilter, note that if the schema name (e.g UISchema for Oracle ) on connection wizard UI is set, then this method will only return one schema with this name.
 * @param dbConn the connection which you want schema to be filled.Can't be null if need to fill the schemas intothe object of connection.And if Linked is false everything is ok.
 * @param dbJDBCMetadata If it is null the method will do nothing and return null too.
 * @param Filter The list for filter schemas which you want to get.If it is null all of schenas which belong to theconnection will be return.
 * @return The list of schemas after filter.Will return null only if dbJDBCMetadata isn't normal.
 */
public List<Package> fillSchemas(Connection dbConn,DatabaseMetaData dbJDBCMetadata,List<String> schemaFilter){
  return metadataFiller.fillSchemas(dbConn,dbJDBCMetadata,schemaFilter);
}

Fixed version (ground truth):
public List<Package> fillSchemas(Connection dbConn,DatabaseMetaData dbJDBCMetadata,IMetadataConnection metaConnection,List<String> schemaFilter){
  return metadataFiller.fillSchemas(dbConn,dbJDBCMetadata,metaConnection,schemaFilter);
}
Program: 128506
Project: 128506
Buggy source:
/** 
 * DOC YeXiaowei Comment method "initializeGeneralJDBC".
 */
private void initializeGeneralJDBC(){
  generalJdbcUrlText.setText(getConnection().getURL());
  generalJdbcClassNameText.setText(getConnection().getDriverClass());
  generalJdbcUserText.setText(getConnection().getUsername());
  generalJdbcPasswordText.setText(getConnection().getPassword());
  generalJdbcDriverjarText.setText(getConnection().getDriverJarPath());
  generalMappingFileText.setText(getConnection().getDbmsId());
  String jdbcUrlString="String_Node_Str";
  if (isContextMode()) {
    ContextType contextType=ConnectionContextHelper.getContextTypeForContextMode(getShell(),getConnection(),true);
    if (contextType != null) {
      jdbcUrlString=ConnectionContextHelper.getOriginalValue(contextType,getConnection().getURL());
    }
  }
 else {
    jdbcUrlString=generalJdbcUrlText.getText();
  }
  if (jdbcUrlString.contains("String_Node_Str")) {
    jDBCschemaText.setText(getConnection().getUiSchema());
  }
 else {
    jDBCschemaText.setHideWidgets(true);
  }
}

Fixed version (ground truth):
/** 
 * DOC YeXiaowei Comment method "initializeGeneralJDBC".
 */
private void initializeGeneralJDBC(){
  generalJdbcUrlText.setText(getConnection().getURL());
  generalJdbcClassNameText.setText(getConnection().getDriverClass());
  generalJdbcUserText.setText(getConnection().getUsername());
  generalJdbcPasswordText.setText(getConnection().getPassword());
  generalJdbcDriverjarText.setText(getConnection().getDriverJarPath());
  generalMappingFileText.setText(getConnection().getDbmsId());
  String jdbcUrlString="String_Node_Str";
  if (isContextMode()) {
    if (selectedContextType == null) {
      selectedContextType=ConnectionContextHelper.getContextTypeForContextMode(getConnection(),null,true);
    }
    if (selectedContextType != null) {
      jdbcUrlString=ConnectionContextHelper.getOriginalValue(selectedContextType,getConnection().getURL());
    }
  }
 else {
    jdbcUrlString=generalJdbcUrlText.getText();
  }
  if (jdbcUrlString.contains("String_Node_Str")) {
    String schema=getConnection().getUiSchema();
    if (schema == null || "String_Node_Str".equals(schema)) {
      for (      ContextParameterType param : (List<ContextParameterType>)selectedContextType.getContextParameter()) {
        if (param.getName() != null && param.getName().endsWith(ConnectionContextHelper.LINE + EDBParamName.Schema)) {
          if (getConnection().isContextMode()) {
            schema="String_Node_Str" + param.getName();
          }
 else {
            schema=param.getValue();
          }
          break;
        }
      }
    }
    jDBCschemaText.setText(schema);
  }
 else {
    jDBCschemaText.setHideWidgets(true);
  }
}
Program: 128507
Project: 128507
Buggy source:
/** 
 * ggu Comment method "setManagerConnectionValues". set the ManagerConnection parameter and return the url string connection.
 */
public static String setManagerConnectionValues(ManagerConnection managerConnection,ConnectionItem connectionItem,final String dbType,final int dbTypeIndex){
  if (managerConnection == null || connectionItem == null || dbType == null || dbTypeIndex < 0) {
    return null;
  }
  DatabaseConnection dbConn=(DatabaseConnection)connectionItem.getConnection();
  ContextType contextType=ConnectionContextHelper.getContextTypeForContextMode(dbConn);
  String server=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getServerName());
  String username=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getUsername());
  String password=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getPassword());
  String port=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getPort());
  String sidOrDatabase=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getSID());
  String datasource=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getDatasourceName());
  String filePath=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getFileFieldName());
  String schemaOracle=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getUiSchema());
  String dbRootPath=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getDBRootPath());
  String additionParam=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getAdditionalParams());
  String driverClassName=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getDriverClass());
  String driverJarPath=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getDriverJarPath());
  String dbVersionString=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getDbVersionString());
  filePath=TalendQuoteUtils.removeQuotes(filePath);
  dbRootPath=TalendQuoteUtils.removeQuotes(dbRootPath);
  String urlConnection;
  if (dbConn.getDatabaseType().equals(EDatabaseConnTemplate.GENERAL_JDBC.getDBDisplayName())) {
    urlConnection=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getURL());
  }
 else {
    urlConnection=DatabaseConnStrUtil.getURLString(dbConn.getDatabaseType(),dbConn.getDbVersionString(),server,username,password,port,sidOrDatabase,filePath.toLowerCase(),datasource,dbRootPath,additionParam);
  }
  if (dbConn.getProductId().equals(EDatabaseTypeName.ORACLEFORSID.getProduct())) {
    schemaOracle=schemaOracle.toUpperCase();
  }
  managerConnection.setValue(0,dbType,urlConnection,server,username,password,sidOrDatabase,port,filePath,datasource,schemaOracle,additionParam,driverClassName,driverJarPath,dbVersionString);
  managerConnection.setDbRootPath(dbRootPath);
  return urlConnection;
}

Fixed version (ground truth):
public static String setManagerConnectionValues(ManagerConnection managerConnection,ConnectionItem connectionItem,final String dbType,final int dbTypeIndex){
  return setManagerConnectionValues(managerConnection,connectionItem,null,dbType,dbTypeIndex);
}
Program: 128510
Project: 128510
Buggy source:
public void checkPerformed(final AbstractForm source){
  if (source.isStatusOnError()) {
    DatabaseWizardPage.this.setPageComplete(false);
    setErrorMessage(source.getStatus());
  }
 else {
    DatabaseWizardPage.this.setPageComplete(isRepositoryObjectEditable);
    setErrorMessage(null);
    setMessage(source.getStatus(),source.getStatusLevel());
  }
}

Fixed version (ground truth):
@Override public void checkPerformed(final AbstractForm source){
  if (source.isStatusOnError()) {
    DatabaseWizardPage.this.setPageComplete(false);
    setErrorMessage(source.getStatus());
  }
 else {
    DatabaseWizardPage.this.setPageComplete(isRepositoryObjectEditable);
    setErrorMessage(null);
    setMessage(source.getStatus(),source.getStatusLevel());
  }
}
Program: 128511
Project: 128511
Buggy source:
/** 
 * Create the composites, initialize it and add controls.
 * @see IDialogPage#createControl(Composite)
 */
public void createControl(final Composite parent){
  boolean isCreation=false;
  if (this.getWizard() instanceof RepositoryWizard) {
    isCreation=((RepositoryWizard)getWizard()).isCreation();
  }
  databaseForm=new DatabaseForm(parent,connectionItem,existingNames,isCreation);
  databaseForm.setReadOnly(!isRepositoryObjectEditable);
  AbstractForm.ICheckListener listener=new AbstractForm.ICheckListener(){
    public void checkPerformed(    final AbstractForm source){
      if (source.isStatusOnError()) {
        DatabaseWizardPage.this.setPageComplete(false);
        setErrorMessage(source.getStatus());
      }
 else {
        DatabaseWizardPage.this.setPageComplete(isRepositoryObjectEditable);
        setErrorMessage(null);
        setMessage(source.getStatus(),source.getStatusLevel());
      }
    }
  }
;
  databaseForm.setListener(listener);
  setControl(databaseForm);
  if (connectionItem.getProperty().getLabel() != null && !connectionItem.getProperty().getLabel().equals("String_Node_Str")) {
    databaseForm.checkFieldsValue();
  }
}

Fixed version (ground truth):
/** 
 * Create the composites, initialize it and add controls.
 * @see IDialogPage#createControl(Composite)
 */
@Override public void createControl(final Composite parent){
  boolean isCreation=false;
  if (this.getWizard() instanceof RepositoryWizard) {
    isCreation=((RepositoryWizard)getWizard()).isCreation();
  }
  databaseForm=new DatabaseForm(parent,connectionItem,existingNames,isCreation);
  databaseForm.setReadOnly(!isRepositoryObjectEditable);
  AbstractForm.ICheckListener listener=new AbstractForm.ICheckListener(){
    @Override public void checkPerformed(    final AbstractForm source){
      if (source.isStatusOnError()) {
        DatabaseWizardPage.this.setPageComplete(false);
        setErrorMessage(source.getStatus());
      }
 else {
        DatabaseWizardPage.this.setPageComplete(isRepositoryObjectEditable);
        setErrorMessage(null);
        setMessage(source.getStatus(),source.getStatusLevel());
      }
    }
  }
;
  databaseForm.setListener(listener);
  setControl(databaseForm);
  if (connectionItem.getProperty().getLabel() != null && !connectionItem.getProperty().getLabel().equals("String_Node_Str")) {
    databaseForm.checkFieldsValue();
  }
}
Program: 128513
Project: 128513
Buggy source:
public static String parseTo_String(String s){
  return s;
}

Fixed version (ground truth):
public static String parseTo_String(final List<String> s,String fieldSep){
  if (s == null) {
    return null;
  }
  StringBuffer result=new StringBuffer();
  result.append("String_Node_Str");
  for (int i=0; i < s.size(); i++) {
    if (i != 0) {
      result.append(fieldSep);
    }
    result.append(s.get(i));
  }
  result.append("String_Node_Str");
  return result.toString();
}
Program: 128514
Project: 128514
Buggy source:
protected boolean checkReadOnly() throws PersistenceException {
  return loadedProcess.checkReadOnly();
}

Fixed version (ground truth):
public boolean checkReadOnly() throws PersistenceException {
  return loadedProcess.checkReadOnly();
}
Program: 128516
Project: 128516
Buggy source:
/** 
 * test connection used for test a connection,for example ,click "check" button on database wizard 
 */
public ConnectionStatus testConnection(String dbType,String url,String username,String pwd,String schema,String server,String port,final String driverClassName,final String driverJarPath,String dbVersionString,String additionalParam);

Fixed version (ground truth):
/** 
 * test connection used for test a connection,for example ,click "check" button on database wizard 
 */
public ConnectionStatus testConnection(String dbType,String url,String username,String pwd,String schema,String server,String port,final String driverClassName,final String driverJarPath,String dbVersionString,String additionalParam,Map<String,Object> otherParameters);
Program: 128517
Project: 128517
Buggy source:
public static List parseTo_List(String s){
  if (s != null) {
    List list=new ArrayList();
    list.add(s);
    return list;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * the source should be a string wrapped in chars[ ] which stands for it is a collection
 * @param stSrc
 * @param fieldSep
 * @return
 */
public static List<String> parseTo_List(final String strSrc,String fieldSep){
  if (strSrc == null) {
    return null;
  }
  List<String> list=new ArrayList<String>();
  if ((fieldSep == null || "String_Node_Str".equals(fieldSep)) || !(strSrc.startsWith("String_Node_Str") && strSrc.endsWith("String_Node_Str"))) {
    list.add(strSrc);
    return list;
  }
  String strTemp=strSrc.substring(1,strSrc.length() - 1);
  for (  String str : strTemp.split(fieldSep,-1)) {
    list.add(str);
  }
  return list;
}
Program: 128523
Project: 128523
Buggy source:
public static List parseTo_List(String s){
  if (s != null) {
    List list=new ArrayList();
    list.add(s);
    return list;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * the source should be a string wrapped in chars[ ] which stands for it is a collection
 * @param stSrc
 * @param fieldSep
 * @return
 */
public static List<String> parseTo_List(final String strSrc,String fieldSep){
  if (strSrc == null) {
    return null;
  }
  List<String> list=new ArrayList<String>();
  if ((fieldSep == null || "String_Node_Str".equals(fieldSep)) || !(strSrc.startsWith("String_Node_Str") && strSrc.endsWith("String_Node_Str"))) {
    list.add(strSrc);
    return list;
  }
  String strTemp=strSrc.substring(1,strSrc.length() - 1);
  for (  String str : strTemp.split(fieldSep,-1)) {
    list.add(str);
  }
  return list;
}
Program: 128526
Project: 128526
Buggy source:
/** 
 * Loads the jars for hive embedded mode required, I do not think it is the better method  to do this here. Due to the limitation on code structure, I have to write this method  to load the jar required by Hive. If metadata connection part is refactored, developer  could adjust this method. Added by Marvin Wang on Oct 24, 2012.
 * @param libraries
 * @param dbType
 * @param dbVersion
 */
public void loadForHiveEmbedded(List<String> libraries,String dbType,String dbVersion){
  boolean flog=EDatabaseVersion4Drivers.containTypeAndVersion(dbType,dbVersion);
  HotClassLoader loader=null;
  if (flog) {
    loader=(HotClassLoader)classLoadersMap.get(dbType,dbVersion);
    if (loader == null) {
      loader=new HotClassLoader();
      for (int i=0; i < libraries.size(); i++) {
        loader.addPath(libraries.get(i));
      }
      classLoadersMap.put(dbType,dbVersion,loader);
    }
 else {
      URL[] urls=loader.getURLs();
      if (urls != null && urls.length > 0) {
        for (int i=0; i < urls.length; i++) {
          String urlPath=urls[i].getPath();
          for (int j=0; j < libraries.size(); j++) {
            if (urlPath != null && !"String_Node_Str".equals(urlPath) && urlPath.equals(libraries.get(j))) {
              loader.addPath(libraries.get(j));
              break;
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Loads the jars for hive embedded mode required, I do not think it is the better method to do this here. Due to the limitation on code structure, I have to write this method to load the jar required by Hive. If metadata connection part is refactored, developer could adjust this method. Added by Marvin Wang on Oct 24, 2012.
 * @param libraries
 * @param dbType
 * @param dbVersion
 */
public void loadForHiveEmbedded(List<String> libraries,String dbType,String dbVersion){
  boolean flog=EDatabaseVersion4Drivers.containTypeAndVersion(dbType,dbVersion);
  HotClassLoader loader=null;
  if (flog) {
    loader=(HotClassLoader)classLoadersMap.get(dbType,dbVersion);
    if (loader == null) {
      loader=new HotClassLoader();
      for (int i=0; i < libraries.size(); i++) {
        loader.addPath(libraries.get(i));
      }
      classLoadersMap.put(dbType,dbVersion,loader);
    }
 else {
      URL[] urls=loader.getURLs();
      if (urls != null && urls.length > 0) {
        for (int i=0; i < urls.length; i++) {
          String urlPath=urls[i].getPath();
          for (int j=0; j < libraries.size(); j++) {
            if (urlPath != null && !"String_Node_Str".equals(urlPath) && urlPath.equals(libraries.get(j))) {
              loader.addPath(libraries.get(j));
              break;
            }
          }
        }
      }
    }
  }
}
Program: 128529
Project: 128529
Buggy source:
public Map<String,List<String>> getRoutineAndJars();

Fixed version (ground truth):
public Map<String,List<LibraryInfo>> getRoutineAndJars();
Program: 128530
Project: 128530
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  RepositoryNode node=(RepositoryNode)selection.getFirstElement();
  if (selection.isEmpty()) {
    setEnabled(false);
    return;
  }
  if (ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  ERepositoryObjectType objectType=null;
  for (  Object obj : ((StructuredSelection)selection).toArray()) {
    if (canWork) {
      RepositoryNode sourceNode=(RepositoryNode)obj;
      ERepositoryObjectType type=sourceNode.getObjectType();
      if (objectType != null && objectType != type) {
        canWork=false;
        break;
      }
 else {
        objectType=type;
      }
      if (!CopyObjectAction.getInstance().validateAction(sourceNode,null)) {
        canWork=false;
      }
 else       if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOB_DOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOBLET_DOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_SALESFORCE_MODULE || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESOPERATION || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESPORT) {
        canWork=false;
      }
    }
 else {
      break;
    }
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  RepositoryNode node=(RepositoryNode)selection.getFirstElement();
  if (selection.isEmpty()) {
    setEnabled(false);
    return;
  }
  if (ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  ERepositoryObjectType objectType=null;
  for (  Object obj : ((StructuredSelection)selection).toArray()) {
    if (canWork) {
      RepositoryNode sourceNode=(RepositoryNode)obj;
      ERepositoryObjectType type=sourceNode.getObjectType();
      if (objectType != null && objectType != type) {
        canWork=false;
        break;
      }
 else {
        objectType=type;
      }
      if (!CopyObjectAction.getInstance().validateAction(sourceNode,null)) {
        canWork=false;
      }
 else       if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOB_DOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOBLET_DOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_SALESFORCE_MODULE || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESOPERATION || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESPORT) {
        canWork=false;
      }
    }
 else {
      break;
    }
  }
  setEnabled(canWork);
}
Program: 128531
Project: 128531
Buggy source:
@Override protected void doRun(){
  IStructuredSelection selection=(IStructuredSelection)getSelection();
  promptForSavingIfNecessary((RepositoryNode)selection.getFirstElement());
  LocalSelectionTransfer.getTransfer().setSelection(selection);
  LocalSelectionTransfer.getTransfer().setSelectionSetTime(System.currentTimeMillis());
}

Fixed version (ground truth):
@Override protected void doRun(){
  IStructuredSelection selection=(IStructuredSelection)getSelection();
  promptForSavingIfNecessary((RepositoryNode)selection.getFirstElement());
  LocalSelectionTransfer.getTransfer().setSelection(selection);
  LocalSelectionTransfer.getTransfer().setSelectionSetTime(System.currentTimeMillis());
  PasteAction pasteActionInstance=PasteAction.getInstance();
  if (pasteActionInstance != null) {
    pasteActionInstance.init(null,selection);
  }
}
Program: 128533
Project: 128533
Buggy source:
@Override public boolean performDrop(final Object data){
  int operation=getCurrentOperation();
  final RepositoryNode targetNode=(RepositoryNode)getCurrentTarget();
  boolean toReturn=true;
  try {
switch (operation) {
case DND.DROP_COPY:
      RunnableWithReturnValue runnable=new CopyRunnable(Messages.getString("String_Node_Str"),data,targetNode);
    runInProgressDialog(runnable);
  toReturn=(Boolean)runnable.getReturnValue();
break;
case DND.DROP_MOVE:
runnable=new MoveRunnable(Messages.getString("String_Node_Str"),data,targetNode);
runInProgressDialog(runnable);
toReturn=(Boolean)runnable.getReturnValue();
break;
case DND.DROP_DEFAULT:
if (event.detail == DND.DROP_COPY) {
runnable=new CopyRunnable(Messages.getString("String_Node_Str"),data,targetNode);
runInProgressDialog(runnable);
toReturn=(Boolean)runnable.getReturnValue();
break;
}
if (event.detail == DND.DROP_MOVE) {
runnable=new MoveRunnable(Messages.getString("String_Node_Str"),data,targetNode);
runInProgressDialog(runnable);
toReturn=(Boolean)runnable.getReturnValue();
break;
}
default :
}
}
 catch (Exception e) {
ExceptionHandler.process(e);
}
return toReturn;
}

Fixed version (ground truth):
@Override public boolean performDrop(final Object data){
  int operation=getCurrentOperation();
  final RepositoryNode targetNode=(RepositoryNode)getCurrentTarget();
  boolean toReturn=true;
  try {
switch (operation) {
case DND.DROP_COPY:
      RunnableWithReturnValue runnable=new CopyRunnable(Messages.getString("String_Node_Str"),data,targetNode);
    runCopy(data,targetNode);
  break;
case DND.DROP_MOVE:
runnable=new MoveRunnable(Messages.getString("String_Node_Str"),data,targetNode);
runInProgressDialog(runnable);
toReturn=(Boolean)runnable.getReturnValue();
break;
case DND.DROP_DEFAULT:
if (event.detail == DND.DROP_COPY) {
runnable=new CopyRunnable(Messages.getString("String_Node_Str"),data,targetNode);
runInProgressDialog(runnable);
toReturn=(Boolean)runnable.getReturnValue();
break;
}
if (event.detail == DND.DROP_MOVE) {
runnable=new MoveRunnable(Messages.getString("String_Node_Str"),data,targetNode);
runInProgressDialog(runnable);
toReturn=(Boolean)runnable.getReturnValue();
break;
}
default :
}
}
 catch (Exception e) {
ExceptionHandler.process(e);
}
return toReturn;
}
Program: 128534
Project: 128534
Buggy source:
private void runInProgressDialog(final IWorkspaceRunnable op){
  final IRunnableWithProgress iRunnableWithProgress=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      IWorkspace workspace=ResourcesPlugin.getWorkspace();
      try {
        ISchedulingRule schedulingRule=workspace.getRoot();
        workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,monitor);
      }
 catch (      CoreException e) {
        throw new InvocationTargetException(e);
      }
    }
  }
;
  RepositoryWorkUnit<Object> repositoryWorkUnit=new RepositoryWorkUnit<Object>("String_Node_Str",this){
    @Override protected void run() throws LoginException, PersistenceException {
      try {
        ProgressMonitorDialog progress=new ProgressMonitorDialog(getViewer().getControl().getShell());
        progress.run(false,false,iRunnableWithProgress);
      }
 catch (      InvocationTargetException e) {
        ExceptionHandler.process(e);
      }
catch (      InterruptedException e) {
        ExceptionHandler.process(e);
      }
    }
  }
;
  repositoryWorkUnit.setAvoidUnloadResources(true);
  CoreRuntimePlugin.getInstance().getProxyRepositoryFactory().executeRepositoryWorkUnit(repositoryWorkUnit);
}

Fixed version (ground truth):
private void runInProgressDialog(final IWorkspaceRunnable op){
  final IRunnableWithProgress iRunnableWithProgress=new IRunnableWithProgress(){
    @Override public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      IWorkspace workspace=ResourcesPlugin.getWorkspace();
      try {
        ISchedulingRule schedulingRule=workspace.getRoot();
        workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,monitor);
      }
 catch (      CoreException e) {
        throw new InvocationTargetException(e);
      }
    }
  }
;
  RepositoryWorkUnit<Object> repositoryWorkUnit=new RepositoryWorkUnit<Object>("String_Node_Str",this){
    @Override protected void run() throws LoginException, PersistenceException {
      try {
        ProgressMonitorDialog progress=new ProgressMonitorDialog(getViewer().getControl().getShell());
        progress.run(false,false,iRunnableWithProgress);
      }
 catch (      InvocationTargetException e) {
        ExceptionHandler.process(e);
      }
catch (      InterruptedException e) {
        ExceptionHandler.process(e);
      }
    }
  }
;
  repositoryWorkUnit.setAvoidUnloadResources(true);
  CoreRuntimePlugin.getInstance().getProxyRepositoryFactory().executeRepositoryWorkUnit(repositoryWorkUnit);
}
Program: 128535
Project: 128535
Buggy source:
public void run(IProgressMonitor monitor) throws CoreException {
  try {
    for (    Object obj : ((StructuredSelection)data).toArray()) {
      final RepositoryNode sourceNode=(RepositoryNode)obj;
      monitor.subTask(Messages.getString("String_Node_Str") + sourceNode.getObject().getLabel());
      MoveObjectAction.getInstance().execute(sourceNode,targetNode,true);
    }
  }
 catch (  Exception e) {
    throw new CoreException(new org.eclipse.core.runtime.Status(IStatus.ERROR,FrameworkUtil.getBundle(this.getClass()).getSymbolicName(),"String_Node_Str",e));
  }
}

Fixed version (ground truth):
@Override public void run(IProgressMonitor monitor) throws CoreException {
  try {
    for (    Object obj : ((StructuredSelection)data).toArray()) {
      final RepositoryNode sourceNode=(RepositoryNode)obj;
      monitor.subTask(Messages.getString("String_Node_Str") + sourceNode.getObject().getLabel());
      MoveObjectAction.getInstance().execute(sourceNode,targetNode,true);
    }
  }
 catch (  Exception e) {
    throw new CoreException(new org.eclipse.core.runtime.Status(IStatus.ERROR,FrameworkUtil.getBundle(this.getClass()).getSymbolicName(),"String_Node_Str",e));
  }
}
Program: 128537
Project: 128537
Buggy source:
@Override public void fillActionBars(IActionBars actionBars){
  super.fillActionBars(actionBars);
  actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(),CopyAction.getInstance());
  actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(),PasteAction.getInstance());
  actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(),DeleteAction.getInstance());
  TextActionHandler textActionHandler=new TextActionHandler(actionBars);
  textActionHandler.setCopyAction(CopyAction.getInstance());
  textActionHandler.setPasteAction(PasteAction.getInstance());
  textActionHandler.setDeleteAction(DeleteAction.getInstance());
}

Fixed version (ground truth):
@Override public void fillActionBars(IActionBars actionBars){
  super.fillActionBars(actionBars);
  CopyAction copyActionInstance=CopyAction.getInstance();
  actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(),copyActionInstance);
  actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(),PasteAction.getInstance());
  actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(),DeleteAction.getInstance());
  if (copyActionInstance != null && getContext() != null && getContext().getSelection() instanceof IStructuredSelection) {
    IStructuredSelection sel=(IStructuredSelection)getContext().getSelection();
    if (sel != null) {
      copyActionInstance.init(null,sel);
    }
  }
  TextActionHandler textActionHandler=new TextActionHandler(actionBars);
  textActionHandler.setCopyAction(copyActionInstance);
  textActionHandler.setPasteAction(PasteAction.getInstance());
  textActionHandler.setDeleteAction(DeleteAction.getInstance());
}
Program: 128538
Project: 128538
Buggy source:
/** 
 * judge whether UiSchema is null or empty string whatever context mode or nor
 * @param dbConn
 * @return
 */
private boolean isNullUiSchema(Connection dbConn){
  if (dbConn instanceof DatabaseConnection) {
    String databaseOnConnWizard=((DatabaseConnection)dbConn).getUiSchema();
    String readableName=TalendCWMService.getReadableName(dbConn,databaseOnConnWizard);
    if (isEmptyString(databaseOnConnWizard) && isEmptyString(readableName)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * judge whether UiSchema is null or empty string whatever context mode or nor
 * @param dbConn
 * @return
 */
private boolean isNullUiSchema(Connection dbConn){
  if (dbConn instanceof DatabaseConnection) {
    String databaseOnConnWizard=((DatabaseConnection)dbConn).getUiSchema();
    String readableName=TalendCWMService.getReadableName(dbConn,databaseOnConnWizard);
    if (isEmptyString(databaseOnConnWizard) || isEmptyString(readableName)) {
      return true;
    }
  }
  return false;
}