nus-yam/ex-repair huggingface dataset:
Program: 128439
Project: 128439
Buggy source:
private void lockObject(){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
    IProxyRepositoryService service=(IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
    IProxyRepositoryFactory repositoryFactory=service.getProxyRepositoryFactory();
    try {
      boolean isOpened=false;
      if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
        ICoreService coreService=(ICoreService)GlobalServiceRegister.getDefault().getService(ICoreService.class);
        isOpened=coreService.isOpenedItemInEditor(object);
      }
      if (repositoryFactory.getStatus(object).equals(ERepositoryStatus.LOCK_BY_USER) && isOpened) {
        alreadyEditedByUser=true;
      }
 else {
        repositoryFactory.lock(object);
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
catch (    BusinessException e) {
    }
  }
}

Fixed version (ground truth):
private void lockObject(){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
    IProxyRepositoryService service=(IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
    IProxyRepositoryFactory repositoryFactory=service.getProxyRepositoryFactory();
    try {
      boolean isOpened=false;
      if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
        ICoreService coreService=(ICoreService)GlobalServiceRegister.getDefault().getService(ICoreService.class);
        isOpened=coreService.isOpenedItemInEditor(object);
      }
      if (!repositoryFactory.getStatus(object).equals(ERepositoryStatus.LOCK_BY_OTHER) && isOpened) {
        alreadyEditedByUser=true;
      }
 else {
        repositoryFactory.lock(object);
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
catch (    BusinessException e) {
    }
  }
}
Program: 128443
Project: 128443
Buggy source:
/** 
 * Export the resources contained in the previously-defined resourcesToExport collection.
 */
protected void exportSpecifiedResources() throws InterruptedException {
  for (  ExportFileResource fileResource : resourcesListToExport) {
    String rootName=fileResource.getDirectoryName();
    Set<String> paths=fileResource.getRelativePathList();
    for (Iterator iter=paths.iterator(); iter.hasNext(); ) {
      String relativePath=(String)iter.next();
      Set<URL> resource=fileResource.getResourcesByRelativePath(relativePath);
      for (      URL url : resource) {
        String currentResource=url.getPath();
        exportResource(rootName,relativePath,currentResource,1);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Export the resources contained in the previously-defined resourcesToExport collection.
 */
protected void exportSpecifiedResources() throws InterruptedException {
  for (  ExportFileResource fileResource : resourcesListToExport) {
    String rootName=fileResource.getDirectoryName();
    Set<String> paths=fileResource.getRelativePathList();
    for (Iterator iter=paths.iterator(); iter.hasNext(); ) {
      String relativePath=(String)iter.next();
      Set<URL> resource=fileResource.getResourcesByRelativePath(relativePath);
      for (      URL url : resource) {
        String currentResource=FilesUtils.getFileRealPath(url.getPath());
        exportResource(rootName,relativePath,currentResource,1);
      }
    }
  }
}
Program: 128444
Project: 128444
Buggy source:
/** 
 * DOC connection created by TOS need to fill the basic information for useing in TOP.<br>
 * @param conn
 * @return
 */
public static Connection fillConnectionInformation(ConnectionItem connItem){
  boolean saveFlag=false;
  Connection conn=connItem.getConnection();
  List<Catalog> catalogs=ConnectionHelper.getCatalogs(conn);
  List<Schema> schemas=ConnectionHelper.getSchema(conn);
  boolean isNeedToFill=false;
  if (conn instanceof DatabaseConnection) {
    String dbProductID=((DatabaseConnection)conn).getProductId();
    if (ConnectionHelper.getAllSchemas(conn).isEmpty() && (EDatabaseTypeName.MSSQL05_08.getProduct().equals(dbProductID) || EDatabaseTypeName.MSSQL.getProduct().equals(dbProductID))) {
      isNeedToFill=true;
    }
 else     if (EDatabaseTypeName.AS400.getProduct().equals(dbProductID)) {
      isNeedToFill=true;
    }
 else     if (EDatabaseTypeName.PSQL.getProduct().equals(dbProductID)) {
      isNeedToFill=true;
    }
  }
  if ((catalogs.isEmpty() && schemas.isEmpty()) || isNeedToFill) {
    DatabaseConnection dbConn=SwitchHelpers.DATABASECONNECTION_SWITCH.doSwitch(conn);
    if (dbConn != null) {
      saveFlag=true;
      conn=fillDbConnectionInformation(dbConn);
    }
  }
  if (saveFlag && conn != null) {
    try {
      ProxyRepositoryFactory.getInstance().save(connItem);
    }
 catch (    PersistenceException e) {
      log.error(e,e);
    }
  }
  return conn;
}

Fixed version (ground truth):
/** 
 * DOC connection created by TOS need to fill the basic information for useing in TOP.<br>
 * @param conn
 * @return
 */
public static Connection fillConnectionInformation(ConnectionItem connItem,IMetadataConnection metadataConnection){
  boolean saveFlag=false;
  Connection conn=connItem.getConnection();
  List<Catalog> catalogs=ConnectionHelper.getCatalogs(conn);
  List<Schema> schemas=ConnectionHelper.getSchema(conn);
  boolean isNeedToFill=false;
  if (conn instanceof DatabaseConnection) {
    String dbProductID=((DatabaseConnection)conn).getProductId();
    if (ConnectionHelper.getAllSchemas(conn).isEmpty() && (EDatabaseTypeName.MSSQL05_08.getProduct().equals(dbProductID) || EDatabaseTypeName.MSSQL.getProduct().equals(dbProductID))) {
      isNeedToFill=true;
    }
 else     if (EDatabaseTypeName.AS400.getProduct().equals(dbProductID)) {
      isNeedToFill=true;
    }
 else     if (EDatabaseTypeName.PSQL.getProduct().equals(dbProductID)) {
      isNeedToFill=true;
    }
  }
  if ((catalogs.isEmpty() && schemas.isEmpty()) || isNeedToFill) {
    DatabaseConnection dbConn=SwitchHelpers.DATABASECONNECTION_SWITCH.doSwitch(conn);
    if (dbConn != null) {
      saveFlag=true;
      conn=fillDbConnectionInformation(dbConn,metadataConnection);
    }
  }
  if (saveFlag && conn != null) {
    try {
      ProxyRepositoryFactory.getInstance().save(connItem);
    }
 catch (    PersistenceException e) {
      log.error(e,e);
    }
  }
  return conn;
}
Program: 128445
Project: 128445
Buggy source:
/** 
 * DOC xqliu Comment method "fillDbConnectionInformation".
 * @param dbConn
 * @return
 */
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();
      DatabaseMetaData databaseMetaData=ExtractMetaDataUtils.getDatabaseMetaData(sqlConn,dbConn,false);
      if (sqlConn != null) {
        MetadataFillFactory.getDBInstance().fillCatalogs(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,true));
        MetadataFillFactory.getDBInstance().fillSchemas(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,false));
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
 finally {
    if (derbyDriver != null) {
      try {
        derbyDriver.connect("String_Node_Str",null);
      }
 catch (      SQLException e) {
      }
    }
  }
  return dbConn;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "fillDbConnectionInformation".
 * @param dbConn
 * @return
 */
public static DatabaseConnection fillDbConnectionInformation(DatabaseConnection dbConn,IMetadataConnection metadataConnection){
  boolean noStructureExists=ConnectionHelper.getAllCatalogs(dbConn).isEmpty() && ConnectionHelper.getAllSchemas(dbConn).isEmpty();
  java.sql.Connection sqlConn=null;
  try {
    if (noStructureExists) {
      IMetadataConnection metaConnection=metadataConnection;
      if (metadataConnection == null) {
        metaConnection=ConvertionHelper.convert(dbConn);
      }
      dbConn=(DatabaseConnection)MetadataFillFactory.getDBInstance().fillUIConnParams(metaConnection,dbConn);
      sqlConn=MetadataConnectionUtils.checkConnection(metaConnection).getObject();
      DatabaseMetaData databaseMetaData=ExtractMetaDataUtils.getDatabaseMetaData(sqlConn,dbConn,false);
      if (sqlConn != null) {
        MetadataFillFactory.getDBInstance().fillCatalogs(dbConn,databaseMetaData,metaConnection,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,true));
        MetadataFillFactory.getDBInstance().fillSchemas(dbConn,databaseMetaData,metaConnection,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,false));
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
 finally {
    if (derbyDriver != null) {
      try {
        derbyDriver.connect("String_Node_Str",null);
      }
 catch (      SQLException e) {
      }
    }
  }
  return dbConn;
}
Program: 128448
Project: 128448
Buggy source:
@Override public boolean canModify(Object bean){
  return super.canModify(bean) && canModifyDBColumn(bean);
}

Fixed version (ground truth):
@Override public boolean canModify(Object bean){
  return super.canModify(bean);
}
Program: 128449
Project: 128449
Buggy source:
/** 
 * DOC amaumont Comment method "configureNameColumn".
 * @param tableViewerCreator
 */
protected void configureDbColumnName(TableViewerCreator<B> tableViewerCreator){
  TableViewerCreatorColumn column;
  column=new TableViewerCreatorColumn(tableViewerCreator);
  column.setId(ID_COLUMN_DBCOLUMNNAME);
  column.setTitle("String_Node_Str");
  column.setToolTipHeader(Messages.getString("String_Node_Str"));
  column.setBeanPropertyAccessors(getDbColumnNameAccessor());
  column.setWeight(25);
  column.setModifiable(!isReadOnly());
  column.setMinimumWidth(45);
  final TextCellEditor cellEditor=new TextCellEditor(tableViewerCreator.getTable());
  column.setCellEditor(cellEditor);
  column.setColumnCellModifier(new ColumnCellModifier(column){
    @Override public boolean canModify(    Object bean){
      return super.canModify(bean) && canModifyDBColumn(bean);
    }
  }
);
  if (!dbColumnNameWritable) {
    column.setColorProvider(new IColumnColorProvider(){
      public Color getBackgroundColor(      Object bean){
        return READONLY_CELL_BG_COLOR;
      }
      public Color getForegroundColor(      Object bean){
        return null;
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * DOC amaumont Comment method "configureNameColumn".
 * @param tableViewerCreator
 */
protected void configureDbColumnName(TableViewerCreator<B> tableViewerCreator){
  TableViewerCreatorColumn column;
  column=new TableViewerCreatorColumn(tableViewerCreator);
  column.setId(ID_COLUMN_DBCOLUMNNAME);
  column.setTitle("String_Node_Str");
  column.setToolTipHeader(Messages.getString("String_Node_Str"));
  column.setBeanPropertyAccessors(getDbColumnNameAccessor());
  column.setWeight(25);
  column.setModifiable(!isReadOnly());
  column.setMinimumWidth(45);
  final TextCellEditor cellEditor=new TextCellEditor(tableViewerCreator.getTable());
  column.setCellEditor(cellEditor);
  column.setColumnCellModifier(new ColumnCellModifier(column){
    @Override public boolean canModify(    Object bean){
      return super.canModify(bean);
    }
  }
);
  if (!dbColumnNameWritable) {
    column.setColorProvider(new IColumnColorProvider(){
      public Color getBackgroundColor(      Object bean){
        return READONLY_CELL_BG_COLOR;
      }
      public Color getForegroundColor(      Object bean){
        return null;
      }
    }
);
  }
}
Program: 128450
Project: 128450
Buggy source:
/** 
 * DOC connection created by TOS need to fill the basic information for useing in TOP.<br>
 * @param conn
 * @return
 */
public static Connection fillConnectionInformation(ConnectionItem connItem){
  boolean saveFlag=false;
  Connection conn=connItem.getConnection();
  List<Catalog> catalogs=ConnectionHelper.getCatalogs(conn);
  List<Schema> schemas=ConnectionHelper.getSchema(conn);
  boolean isNeedToFill=false;
  if (conn instanceof DatabaseConnection) {
    String dbProductID=((DatabaseConnection)conn).getProductId();
    if (ConnectionHelper.getAllSchemas(conn).isEmpty() && (EDatabaseTypeName.MSSQL05_08.getProduct().equals(dbProductID) || EDatabaseTypeName.MSSQL.getProduct().equals(dbProductID))) {
      isNeedToFill=true;
    }
 else     if (EDatabaseTypeName.AS400.getProduct().equals(dbProductID)) {
      isNeedToFill=true;
    }
 else     if (EDatabaseTypeName.PSQL.getProduct().equals(dbProductID)) {
      isNeedToFill=true;
    }
  }
  if ((catalogs.isEmpty() && schemas.isEmpty()) || isNeedToFill) {
    DatabaseConnection dbConn=SwitchHelpers.DATABASECONNECTION_SWITCH.doSwitch(conn);
    if (dbConn != null) {
      saveFlag=true;
      conn=fillDbConnectionInformation(dbConn);
    }
  }
  if (saveFlag && conn != null) {
    try {
      ProxyRepositoryFactory.getInstance().save(connItem);
    }
 catch (    PersistenceException e) {
      log.error(e,e);
    }
  }
  return conn;
}

Fixed version (ground truth):
/** 
 * DOC connection created by TOS need to fill the basic information for useing in TOP.<br>
 * @param conn
 * @return
 */
public static Connection fillConnectionInformation(ConnectionItem connItem,IMetadataConnection metadataConnection){
  boolean saveFlag=false;
  Connection conn=connItem.getConnection();
  List<Catalog> catalogs=ConnectionHelper.getCatalogs(conn);
  List<Schema> schemas=ConnectionHelper.getSchema(conn);
  boolean isNeedToFill=false;
  if (conn instanceof DatabaseConnection) {
    String dbProductID=((DatabaseConnection)conn).getProductId();
    if (ConnectionHelper.getAllSchemas(conn).isEmpty() && (EDatabaseTypeName.MSSQL05_08.getProduct().equals(dbProductID) || EDatabaseTypeName.MSSQL.getProduct().equals(dbProductID))) {
      isNeedToFill=true;
    }
 else     if (EDatabaseTypeName.AS400.getProduct().equals(dbProductID)) {
      isNeedToFill=true;
    }
 else     if (EDatabaseTypeName.PSQL.getProduct().equals(dbProductID)) {
      isNeedToFill=true;
    }
  }
  if ((catalogs.isEmpty() && schemas.isEmpty()) || isNeedToFill) {
    DatabaseConnection dbConn=SwitchHelpers.DATABASECONNECTION_SWITCH.doSwitch(conn);
    if (dbConn != null) {
      saveFlag=true;
      conn=fillDbConnectionInformation(dbConn,metadataConnection);
    }
  }
  if (saveFlag && conn != null) {
    try {
      ProxyRepositoryFactory.getInstance().save(connItem);
    }
 catch (    PersistenceException e) {
      log.error(e,e);
    }
  }
  return conn;
}
Program: 128451
Project: 128451
Buggy source:
/** 
 * DOC xqliu Comment method "fillDbConnectionInformation".
 * @param dbConn
 * @return
 */
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();
      DatabaseMetaData databaseMetaData=ExtractMetaDataUtils.getDatabaseMetaData(sqlConn,dbConn,false);
      if (sqlConn != null) {
        MetadataFillFactory.getDBInstance().fillCatalogs(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,true));
        MetadataFillFactory.getDBInstance().fillSchemas(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,false));
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
 finally {
    if (derbyDriver != null) {
      try {
        derbyDriver.connect("String_Node_Str",null);
      }
 catch (      SQLException e) {
      }
    }
  }
  return dbConn;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "fillDbConnectionInformation".
 * @param dbConn
 * @return
 */
public static DatabaseConnection fillDbConnectionInformation(DatabaseConnection dbConn,IMetadataConnection metadataConnection){
  boolean noStructureExists=ConnectionHelper.getAllCatalogs(dbConn).isEmpty() && ConnectionHelper.getAllSchemas(dbConn).isEmpty();
  java.sql.Connection sqlConn=null;
  try {
    if (noStructureExists) {
      IMetadataConnection metaConnection=metadataConnection;
      if (metadataConnection == null) {
        metaConnection=ConvertionHelper.convert(dbConn);
      }
      dbConn=(DatabaseConnection)MetadataFillFactory.getDBInstance().fillUIConnParams(metaConnection,dbConn);
      sqlConn=MetadataConnectionUtils.checkConnection(metaConnection).getObject();
      DatabaseMetaData databaseMetaData=ExtractMetaDataUtils.getDatabaseMetaData(sqlConn,dbConn,false);
      if (sqlConn != null) {
        MetadataFillFactory.getDBInstance().fillCatalogs(dbConn,databaseMetaData,metaConnection,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,true));
        MetadataFillFactory.getDBInstance().fillSchemas(dbConn,databaseMetaData,metaConnection,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,false));
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
 finally {
    if (derbyDriver != null) {
      try {
        derbyDriver.connect("String_Node_Str",null);
      }
 catch (      SQLException e) {
      }
    }
  }
  return dbConn;
}
Program: 128454
Project: 128454
Buggy source:
/** 
 * DOC xqliu Comment method "fillDbConnectionInformation".
 * @param dbConn
 * @return
 */
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();
      DatabaseMetaData databaseMetaData=ExtractMetaDataUtils.getDatabaseMetaData(sqlConn,dbConn,false);
      if (sqlConn != null) {
        MetadataFillFactory.getDBInstance().fillCatalogs(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,true));
        if (!ConnectionUtils.isSybase(databaseMetaData)) {
          MetadataFillFactory.getDBInstance().fillSchemas(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,false));
        }
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
 finally {
    if (derbyDriver != null) {
      try {
        derbyDriver.connect("String_Node_Str",null);
      }
 catch (      SQLException e) {
      }
    }
  }
  return dbConn;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "fillDbConnectionInformation".
 * @param dbConn
 * @return
 */
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();
      DatabaseMetaData databaseMetaData=ExtractMetaDataUtils.getDatabaseMetaData(sqlConn,dbConn,false);
      if (sqlConn != null) {
        MetadataFillFactory.getDBInstance().fillCatalogs(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,true));
        MetadataFillFactory.getDBInstance().fillSchemas(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,false));
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
 finally {
    if (derbyDriver != null) {
      try {
        derbyDriver.connect("String_Node_Str",null);
      }
 catch (      SQLException e) {
      }
    }
  }
  return dbConn;
}
Program: 128455
Project: 128455
Buggy source:
public void run(){
  if (errorMessage.equals("String_Node_Str")) {
    MessageDialog.openError(text.getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    text.setText(newValue);
    text.setSelection(selection.x,selection.y);
  }
 else {
    MessageDialog.openError(text.getShell(),Messages.getString("String_Node_Str"),errorMessage);
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    text.setText(newValue);
    text.setSelection(selection.x,selection.y);
  }
}

Fixed version (ground truth):
public void run(){
  if (errorMessage.equals("String_Node_Str")) {
    MessageDialog.openError(text.getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    if (!("String_Node_Str").equals(newValue)) {
      text.setText(newValue);
    }
    text.setSelection(selection.x,selection.y);
  }
 else {
    MessageDialog.openError(text.getShell(),Messages.getString("String_Node_Str"),errorMessage);
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    text.setText(newValue);
    text.setSelection(selection.x,selection.y);
  }
}
Program: 128458
Project: 128458
Buggy source:
/** 
 * DOC xqliu Comment method "fillDbConnectionInformation".
 * @param dbConn
 * @return
 */
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=MetadataFillFactory.getDBInstance().fillUIParams(dbConn);
      String databaseType=metaConnection.getDbType();
      dbConn=(DatabaseConnection)MetadataFillFactory.getDBInstance().fillUIConnParams(metaConnection,dbConn);
      sqlConn=MetadataConnectionUtils.checkConnection(metaConnection).getObject();
      DatabaseMetaData databaseMetaData=ExtractMetaDataUtils.getDatabaseMetaData(sqlConn,dbConn,false);
      if (sqlConn != null) {
        MetadataFillFactory.getDBInstance().fillCatalogs(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,true));
        if (!ConnectionUtils.isSybase(databaseMetaData)) {
          MetadataFillFactory.getDBInstance().fillSchemas(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,false));
        }
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
 finally {
    if (derbyDriver != null) {
      try {
        derbyDriver.connect("String_Node_Str",null);
      }
 catch (      SQLException e) {
      }
    }
  }
  return dbConn;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "fillDbConnectionInformation".
 * @param dbConn
 * @return
 */
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=MetadataFillFactory.getDBInstance().fillUIParams(dbConn);
      String databaseType=metaConnection.getDbType();
      dbConn=(DatabaseConnection)MetadataFillFactory.getDBInstance().fillUIConnParams(metaConnection,dbConn);
      sqlConn=MetadataConnectionUtils.checkConnection(metaConnection).getObject();
      DatabaseMetaData databaseMetaData=ExtractMetaDataUtils.getDatabaseMetaData(sqlConn,dbConn,false);
      if (sqlConn != null) {
        MetadataFillFactory.getDBInstance().fillCatalogs(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,true));
        MetadataFillFactory.getDBInstance().fillSchemas(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,false));
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
 finally {
    if (derbyDriver != null) {
      try {
        derbyDriver.connect("String_Node_Str",null);
      }
 catch (      SQLException e) {
      }
    }
  }
  return dbConn;
}
Program: 128460
Project: 128460
Buggy source:
/** 
 * DOC xqliu Comment method "fillDbConnectionInformation".
 * @param dbConn
 * @return
 */
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();
      DatabaseMetaData databaseMetaData=ExtractMetaDataUtils.getDatabaseMetaData(sqlConn,dbConn,false);
      if (sqlConn != null) {
        MetadataFillFactory.getDBInstance().fillCatalogs(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,true));
        if (!ConnectionUtils.isSybase(databaseMetaData)) {
          MetadataFillFactory.getDBInstance().fillSchemas(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,false));
        }
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
 finally {
    if (derbyDriver != null) {
      try {
        derbyDriver.connect("String_Node_Str",null);
      }
 catch (      SQLException e) {
      }
    }
  }
  return dbConn;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "fillDbConnectionInformation".
 * @param dbConn
 * @return
 */
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();
      DatabaseMetaData databaseMetaData=ExtractMetaDataUtils.getDatabaseMetaData(sqlConn,dbConn,false);
      if (sqlConn != null) {
        MetadataFillFactory.getDBInstance().fillCatalogs(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,true));
        MetadataFillFactory.getDBInstance().fillSchemas(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,false));
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
 finally {
    if (derbyDriver != null) {
      try {
        derbyDriver.connect("String_Node_Str",null);
      }
 catch (      SQLException e) {
      }
    }
  }
  return dbConn;
}
Program: 128463
Project: 128463
Buggy source:
@Override public boolean canModify(Object bean){
  return super.canModify(bean) && canModifyDBColumn(bean);
}

Fixed version (ground truth):
@Override public boolean canModify(Object bean){
  return super.canModify(bean);
}
Program: 128464
Project: 128464
Buggy source:
/** 
 * DOC amaumont Comment method "configureNameColumn".
 * @param tableViewerCreator
 */
protected void configureDbColumnName(TableViewerCreator<B> tableViewerCreator){
  TableViewerCreatorColumn column;
  column=new TableViewerCreatorColumn(tableViewerCreator);
  column.setId(ID_COLUMN_DBCOLUMNNAME);
  column.setTitle("String_Node_Str");
  column.setToolTipHeader(Messages.getString("String_Node_Str"));
  column.setBeanPropertyAccessors(getDbColumnNameAccessor());
  column.setWeight(25);
  column.setModifiable(!isReadOnly());
  column.setMinimumWidth(45);
  final TextCellEditor cellEditor=new TextCellEditor(tableViewerCreator.getTable());
  column.setCellEditor(cellEditor);
  column.setColumnCellModifier(new ColumnCellModifier(column){
    @Override public boolean canModify(    Object bean){
      return super.canModify(bean) && canModifyDBColumn(bean);
    }
  }
);
  if (!dbColumnNameWritable) {
    column.setColorProvider(new IColumnColorProvider(){
      public Color getBackgroundColor(      Object bean){
        return READONLY_CELL_BG_COLOR;
      }
      public Color getForegroundColor(      Object bean){
        return null;
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * DOC amaumont Comment method "configureNameColumn".
 * @param tableViewerCreator
 */
protected void configureDbColumnName(TableViewerCreator<B> tableViewerCreator){
  TableViewerCreatorColumn column;
  column=new TableViewerCreatorColumn(tableViewerCreator);
  column.setId(ID_COLUMN_DBCOLUMNNAME);
  column.setTitle("String_Node_Str");
  column.setToolTipHeader(Messages.getString("String_Node_Str"));
  column.setBeanPropertyAccessors(getDbColumnNameAccessor());
  column.setWeight(25);
  column.setModifiable(!isReadOnly());
  column.setMinimumWidth(45);
  final TextCellEditor cellEditor=new TextCellEditor(tableViewerCreator.getTable());
  column.setCellEditor(cellEditor);
  column.setColumnCellModifier(new ColumnCellModifier(column){
    @Override public boolean canModify(    Object bean){
      return super.canModify(bean);
    }
  }
);
  if (!dbColumnNameWritable) {
    column.setColorProvider(new IColumnColorProvider(){
      public Color getBackgroundColor(      Object bean){
        return READONLY_CELL_BG_COLOR;
      }
      public Color getForegroundColor(      Object bean){
        return null;
      }
    }
);
  }
}
Program: 128465
Project: 128465
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,iMetadataConnection,MetadataConnectionUtils.getPackageFilter(temConnection,dbMetaData,true));
    MetadataFillFactory.getDBInstance().fillSchemas(temConnection,dbMetaData,iMetadataConnection,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());
  }
  if (((DatabaseConnection)iMetadataConnection.getCurrentConnection()).getSID() != null) {
    temConnection.setSID(((DatabaseConnection)iMetadataConnection.getCurrentConnection()).getSID());
  }
  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: 128466
Project: 128466
Buggy source:
public void run(){
  if (errorMessage.equals("String_Node_Str")) {
    MessageDialog.openError(text.getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    text.setText(newValue);
    text.setSelection(selection.x,selection.y);
  }
 else {
    MessageDialog.openError(text.getShell(),Messages.getString("String_Node_Str"),errorMessage);
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    text.setText(newValue);
    text.setSelection(selection.x,selection.y);
  }
}

Fixed version (ground truth):
public void run(){
  if (errorMessage.equals("String_Node_Str")) {
    MessageDialog.openError(text.getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    if (!("String_Node_Str").equals(newValue)) {
      text.setText(newValue);
    }
    text.setSelection(selection.x,selection.y);
  }
 else {
    MessageDialog.openError(text.getShell(),Messages.getString("String_Node_Str"),errorMessage);
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    text.setText(newValue);
    text.setSelection(selection.x,selection.y);
  }
}
Program: 128470
Project: 128470
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: 128471
Project: 128471
Buggy source:
public static void fillCatalogAndSchemas(IMetadataConnection iMetadataConnection,DatabaseConnection temConnection){
  java.sql.Connection sqlConn=null;
  temConnection=(DatabaseConnection)MetadataFillFactory.getDBInstance().fillUIConnParams(iMetadataConnection,temConnection);
  sqlConn=(java.sql.Connection)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=(java.sql.Connection)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: 128472
Project: 128472
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: 128474
Project: 128474
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,TalendCWMService.getReadableName(dbConn,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,TalendCWMService.getReadableName(dbConn,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: 128477
Project: 128477
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 (uiSchema != null) {
      uiSchema=TalendCWMService.getReadableName(dbConn,uiSchema);
    }
    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=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 (uiSchema != null) {
      uiSchema=TalendCWMService.getReadableName(dbConn,uiSchema);
    }
    if (!StringUtils.isBlank(uiSchema) && !filterList.contains(uiSchema)) {
      filterList.add(uiSchema);
    }
  }
  return filterList;
}
Program: 128478
Project: 128478
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: 128479
Project: 128479
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);