nus-yam/ex-repair huggingface dataset:
Program: 139380
Project: 139380
Buggy source:
/** 
 * DOC Administrator Comment method "getRowsNotMatchStatement".
 * @return
 */
public String getRowsNotMatchStatement(){
  String queryMatch=getRowsMatchStatement();
  String query=null;
  query=queryMatch.replace(dbmsLanguage.in(),"String_Node_Str");
  if (query.indexOf(dbmsLanguage.and()) > 0) {
    query=query.replace(dbmsLanguage.and(),dbmsLanguage.or());
  }
  return query;
}

Fixed version (ground truth):
/** 
 * DOC yyi Comment method "getRowsNotMatchStatement".
 * @return
 */
public String getRowsNotMatchStatement(){
  Table tablea=(Table)indicator.getAnalyzedElement();
  String tableA=tablea.getName();
  String query="String_Node_Str" + dbmsLanguage.from() + getFullyQualifiedTableName(tablea);
  if (ColumnsetPackage.eINSTANCE.getRowMatchingIndicator() == indicator.eClass()) {
    Table tableb=(Table)ColumnHelper.getColumnSetOwner(((RowMatchingIndicator)indicator).getColumnSetB().get(0));
    String tableB=tableb.getName();
    EList<Column> columnSetA=((RowMatchingIndicator)indicator).getColumnSetA();
    EList<Column> columnSetB=((RowMatchingIndicator)indicator).getColumnSetB();
    String where=null;
    for (int i=0; i < columnSetA.size(); i++) {
      where=dbmsLanguage.or();
      if (i == 0) {
        where=dbmsLanguage.where();
      }
      String fullColumnAName=dbmsLanguage.quote(tableA) + "String_Node_Str" + dbmsLanguage.quote(columnSetA.get(i).getName());
      String fullColumnBName=dbmsLanguage.quote(tableB) + "String_Node_Str" + dbmsLanguage.quote(columnSetB.get(i).getName());
      String clause="String_Node_Str" + fullColumnBName + dbmsLanguage.from()+ getFullyQualifiedTableName(tableb)+ dbmsLanguage.where()+ fullColumnBName+ dbmsLanguage.isNotNull();
      query+=where + fullColumnAName + dbmsLanguage.notIn()+ inBrackets(clause);
      String listNulls=dbmsLanguage.or() + fullColumnAName + dbmsLanguage.isNull();
      query+=listNulls;
    }
  }
  return query;
}
Program: 139381
Project: 139381
Buggy source:
/** 
 * DOC jet adapt to   {@link GenericSQLHandler}("").createGenericSqlWithRegexFunction() method<p>
 * @see GenericSQLHandler
 * @param function UDF function name.
 * @return special sql statement
 */
public String createGenericSqlWithRegexFunction(String function){
  return new GenericSQLHandler("String_Node_Str").createGenericSqlWithRegexFunction(function);
}

Fixed version (ground truth):
/** 
 * DOC jet adapt to   {@link GenericSQLHandler}("").createGenericSqlWithRegexFunction() method <p>
 * @see GenericSQLHandler
 * @param function UDF function name.
 * @return special sql statement
 */
public String createGenericSqlWithRegexFunction(String function){
  return new GenericSQLHandler("String_Node_Str").createGenericSqlWithRegexFunction(function);
}
Program: 139382
Project: 139382
Buggy source:
private String[] getColumnSetOwnerNames(){
  List<String> existingTables=new ArrayList<String>();
  for (  ModelElement element : getAnalyzedColumns()) {
    if (element instanceof Column) {
      String tableName=ColumnHelper.getColumnSetFullName((Column)element);
      if (!existingTables.contains(tableName)) {
        existingTables.add(tableName);
      }
    }
 else     if (element instanceof Table) {
      String tableName=((Table)element).getName();
      if (!existingTables.contains(tableName)) {
        existingTables.add(tableName);
      }
    }
  }
  return existingTables.toArray(new String[existingTables.size()]);
}

Fixed version (ground truth):
private String[] getColumnSetOwnerNames(){
  List<String> existingTables=new ArrayList<String>();
  for (  ModelElement element : getAnalyzedColumns()) {
    if (element instanceof Column && element.eContainer() instanceof Table) {
      String tableName=ColumnHelper.getColumnSetFullName((Column)element);
      if (!existingTables.contains(tableName)) {
        existingTables.add(tableName);
      }
    }
 else     if (element instanceof Table) {
      String tableName=((Table)element).getName();
      if (!existingTables.contains(tableName)) {
        existingTables.add(tableName);
      }
    }
  }
  return existingTables.toArray(new String[existingTables.size()]);
}
Program: 139383
Project: 139383
Buggy source:
@Override protected boolean runAnalysis(Analysis analysis,String sqlStatement){
  boolean ok=true;
  TypedReturnCode<Connection> trc=this.getConnection(analysis);
  if (!trc.isOk()) {
    return traceError("String_Node_Str" + analysis.getName() + "String_Node_Str"+ trc.getMessage());
  }
  Connection connection=trc.getObject();
  try {
    Map<ModelElement,List<Indicator>> elementToIndicator=new HashMap<ModelElement,List<Indicator>>();
    Collection<Indicator> indicators=IndicatorHelper.getIndicatorLeaves(analysis.getResults());
    if (parallel) {
      ok=runAnalysisIndicatorsParallel(connection,elementToIndicator,indicators);
    }
 else {
      ok=runAnalysisIndicators(connection,elementToIndicator,indicators);
    }
    connection.close();
    setRowCountAndNullCount(elementToIndicator);
  }
 catch (  SQLException e) {
    log.error(e,e);
    this.errorMessage=e.getMessage();
    ok=false;
  }
 finally {
    ConnectionUtils.closeConnection(connection);
  }
  return ok;
}

Fixed version (ground truth):
@Override protected boolean runAnalysis(Analysis analysis,String sqlStatement){
  boolean ok=true;
  TypedReturnCode<Connection> trc=this.getConnection(analysis);
  if (!trc.isOk()) {
    return traceError("String_Node_Str" + analysis.getName() + "String_Node_Str"+ trc.getMessage());
  }
  Connection connection=trc.getObject();
  try {
    Map<ModelElement,List<Indicator>> elementToIndicator=new HashMap<ModelElement,List<Indicator>>();
    Collection<Indicator> indicators=IndicatorHelper.getIndicatorLeaves(analysis.getResults());
    if (canParallel()) {
      ok=runAnalysisIndicatorsParallel(connection,elementToIndicator,indicators);
    }
 else {
      ok=runAnalysisIndicators(connection,elementToIndicator,indicators);
    }
    connection.close();
    setRowCountAndNullCount(elementToIndicator);
  }
 catch (  SQLException e) {
    log.error(e,e);
    this.errorMessage=e.getMessage();
    ok=false;
  }
 finally {
    ConnectionUtils.closeConnection(connection);
  }
  return ok;
}
Program: 139384
Project: 139384
Buggy source:
/** 
 * DOC bZhou Comment method "getVersion".
 * @param url
 * @param driver
 * @param props
 * @return
 */
public static ProductVersion getVersion(String url,String driver,Properties props){
  Connection connection=null;
  try {
    connection=ConnectionUtils.createConnection(url,driver,props);
    if (connection != null) {
      Statement stat=connection.createStatement();
      ResultSet result=stat.executeQuery("String_Node_Str" + dbName + "String_Node_Str");
      result.next();
      String versionStr=result.getString(1);
      return ProductVersion.fromString(versionStr);
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
 finally {
    if (connection != null) {
      try {
        connection.close();
      }
 catch (      SQLException e) {
        e.printStackTrace();
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getVersion".
 * @param url
 * @param driver
 * @param props
 * @return
 */
public static ProductVersion getVersion(String url,String driver,Properties props){
  Connection connection=null;
  try {
    connection=ConnectionUtils.createConnection(url,driver,props);
    if (connection != null) {
      Statement stat=connection.createStatement();
      ResultSet result=stat.executeQuery("String_Node_Str" + getDbName() + "String_Node_Str");
      result.next();
      String versionStr=result.getString(1);
      return ProductVersion.fromString(versionStr);
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
 finally {
    if (connection != null) {
      try {
        connection.close();
      }
 catch (      SQLException e) {
        e.printStackTrace();
      }
    }
  }
  return null;
}
Program: 139385
Project: 139385
Buggy source:
/** 
 * DOC bZhou Comment method "checkConnection".
 * @return
 */
public static boolean checkConnection(){
  int index=url.indexOf(dbName);
  String surl="String_Node_Str";
  if (index > 0) {
    surl=url.substring(0,index);
  }
  ReturnCode checkConnection=ConnectionService.checkConnection(surl,driver,props);
  return checkConnection.isOk();
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "checkConnection".
 * @return
 */
public static boolean checkConnection(){
  int index=getUrl().indexOf(getDbName());
  String surl="String_Node_Str";
  if (index > 0) {
    surl=getUrl().substring(0,index);
  }
  ReturnCode checkConnection=ConnectionService.checkConnection(surl,getDriver(),getProps());
  return checkConnection.isOk();
}
Program: 139386
Project: 139386
Buggy source:
/** 
 * DOC bZhou Comment method "storeVersion".
 * @return
 */
public static boolean storeVersion(){
  if (PluginChecker.isTDQLoaded()) {
    Preferences resourcePreferences=ResourcesPlugin.getPlugin().getPluginPreferences();
    if (dbType != null && dbType.equals(SupportDBUrlType.MYSQLDEFAULTURL.getDBKey())) {
      if (user != null && pass != null) {
        Properties props=new Properties();
        props.setProperty("String_Node_Str",user);
        props.setProperty("String_Node_Str",pass);
        return updateVersionInDB(url + dbName,driver,props);
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "storeVersion".
 * @return
 */
public static boolean storeVersion(){
  if (PluginChecker.isTDQLoaded()) {
    if (getDbType() != null && getDbType().equals(SupportDBUrlType.MYSQLDEFAULTURL.getDBKey())) {
      return updateVersionInDB(getUrl() + getDbName(),getDriver(),getProps());
    }
  }
  return false;
}
Program: 139387
Project: 139387
Buggy source:
/** 
 * DOC bZhou Comment method "checkDatabase".
 * @return
 */
public static boolean checkDatabase(){
  ReturnCode checkConnection=ConnectionService.checkConnection(url + dbName,driver,props);
  return checkConnection.isOk();
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "checkDatabase".
 * @return
 */
public static boolean checkDatabase(){
  ReturnCode checkConnection=ConnectionService.checkConnection(getUrl() + getDbName(),getDriver(),getProps());
  return checkConnection.isOk();
}
Program: 139388
Project: 139388
Buggy source:
/** 
 * DOC Administrator Comment method "getRowsMatchStatement".
 * @return
 */
public String getRowsMatchStatement(){
  Table tablea=(Table)indicator.getAnalyzedElement();
  String tableA=tablea.getName();
  String query="String_Node_Str" + dbmsLanguage.from() + getFullyQualifiedTableName(tablea);
  if (ColumnsetPackage.eINSTANCE.getRowMatchingIndicator() == indicator.eClass()) {
    Table tableb=(Table)ColumnHelper.getColumnSetOwner(((RowMatchingIndicator)indicator).getColumnSetB().get(0));
    String tableB=tableb.getName();
    EList<Column> columnSetA=((RowMatchingIndicator)indicator).getColumnSetA();
    EList<Column> columnSetB=((RowMatchingIndicator)indicator).getColumnSetB();
    String where=null;
    for (int i=0; i < columnSetA.size(); i++) {
      where=dbmsLanguage.and();
      if (i == 0) {
        where=dbmsLanguage.where();
      }
      String clause="String_Node_Str" + dbmsLanguage.quote(tableB) + "String_Node_Str"+ dbmsLanguage.quote(columnSetB.get(i).getName())+ dbmsLanguage.from()+ getFullyQualifiedTableName(tableb);
      query+=where + dbmsLanguage.quote(tableA) + "String_Node_Str"+ dbmsLanguage.quote(columnSetA.get(i).getName())+ dbmsLanguage.in()+ inBrackets(clause);
    }
  }
  return query;
}

Fixed version (ground truth):
/** 
 * DOC Administrator Comment method "getRowsMatchStatement".
 * @return
 */
public String getRowsMatchStatement(){
  Table tablea=(Table)indicator.getAnalyzedElement();
  String tableA=tablea.getName();
  String query="String_Node_Str" + dbmsLanguage.from() + getFullyQualifiedTableName(tablea);
  if (ColumnsetPackage.eINSTANCE.getRowMatchingIndicator() == indicator.eClass()) {
    Table tableb=(Table)ColumnHelper.getColumnSetOwner(((RowMatchingIndicator)indicator).getColumnSetB().get(0));
    String tableB=tableb.getName();
    EList<Column> columnSetA=((RowMatchingIndicator)indicator).getColumnSetA();
    EList<Column> columnSetB=((RowMatchingIndicator)indicator).getColumnSetB();
    String where=null;
    for (int i=0; i < columnSetA.size(); i++) {
      where=dbmsLanguage.and();
      if (i == 0) {
        where=dbmsLanguage.where();
      }
      String fullColumnName=dbmsLanguage.quote(tableB) + "String_Node_Str" + dbmsLanguage.quote(columnSetB.get(i).getName());
      String clause="String_Node_Str" + fullColumnName + dbmsLanguage.from()+ getFullyQualifiedTableName(tableb)+ dbmsLanguage.where()+ fullColumnName+ dbmsLanguage.isNotNull();
      query+=where + dbmsLanguage.quote(tableA) + "String_Node_Str"+ dbmsLanguage.quote(columnSetA.get(i).getName())+ dbmsLanguage.in()+ inBrackets(clause);
    }
  }
  return query;
}
Program: 139389
Project: 139389
Buggy source:
public ModelElement initCWMResourceBuilder(){
  DataProviderBuilder dpBuilder=new DataProviderBuilder();
  String driverPath=connectionParam.getDriverPath();
  if (driverPath != null) {
    LinkedList<String> jars=new LinkedList<String>();
    for (    String driverpath : driverPath.split("String_Node_Str")) {
      jars.add(driverpath);
    }
    String name=connectionParam.getJdbcUrl().substring(0,12);
    driver=dpBuilder.buildDriverForSQLExploer(name,connectionParam.getDriverClassName(),connectionParam.getJdbcUrl(),jars);
  }
  ReturnCode rc=dpBuilder.initializeDataProvider(connectionParam);
  if (rc.isOk()) {
    return dpBuilder.getDataProvider();
  }
 else {
    MessageDialog.openInformation(getShell(),DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str") + rc.getMessage());
  }
  return null;
}

Fixed version (ground truth):
public ModelElement initCWMResourceBuilder(){
  DataProviderBuilder dpBuilder=new DataProviderBuilder();
  String driverPath=connectionParam.getDriverPath();
  if (driverPath != null) {
    LinkedList<String> jars=new LinkedList<String>();
    for (    String driverpath : driverPath.split("String_Node_Str")) {
      jars.add(driverpath);
    }
    String jdbcUrl=connectionParam.getJdbcUrl();
    if (jdbcUrl != null && jdbcUrl.length() > 12) {
      String name=jdbcUrl.substring(0,12);
      driver=dpBuilder.buildDriverForSQLExploer(name,connectionParam.getDriverClassName(),connectionParam.getJdbcUrl(),jars);
    }
  }
  ReturnCode rc=dpBuilder.initializeDataProvider(connectionParam);
  if (rc.isOk()) {
    return dpBuilder.getDataProvider();
  }
 else {
    MessageDialog.openInformation(getShell(),DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str") + rc.getMessage());
  }
  return null;
}
Program: 139390
Project: 139390
Buggy source:
public void updateButtonState(){
  boolean complete=true;
  String dbTypeName=this.connectionParam.getSqlTypeName();
  if (!SupportDBUrlType.MSSQLDEFAULTURL.getDBKey().equals(dbTypeName)) {
    if (SupportDBUrlType.GENERICJDBCDEFAULTURL.getDBKey().equals(dbTypeName)) {
      String driverName=this.connectionParam.getDriverClassName() == null ? "String_Node_Str" : this.connectionParam.getDriverClassName();
      String connURL=this.connectionParam.getJdbcUrl() == null ? "String_Node_Str" : this.connectionParam.getJdbcUrl();
      String userName=this.userid == null ? "String_Node_Str" : this.userid;
      if ("String_Node_Str".equals(driverName) || "String_Node_Str".equals(connURL)) {
        complete=false;
      }
 else {
        complete=SupportDBUrlType.SQLITE3DEFAULTURL.getDbDriver().equals(driverName) ? true : !"String_Node_Str".equals(userName);
      }
    }
 else     if (SupportDBUrlType.SQLITE3DEFAULTURL.getDBKey().equals(dbTypeName)) {
      String filename=this.connectionParam.getFilePath();
      complete&=filename != null && !filename.trim().equals("String_Node_Str");
    }
 else {
      complete&=this.userid != null && !this.userid.trim().equals("String_Node_Str");
    }
  }
  if (checkButton != null) {
    checkButton.setEnabled(complete);
  }
  setPageComplete(complete);
}

Fixed version (ground truth):
public void updateButtonState(){
  boolean complete=true;
  String dbTypeName=this.connectionParam.getSqlTypeName();
  if (!SupportDBUrlType.MSSQLDEFAULTURL.getDBKey().equals(dbTypeName)) {
    if (SupportDBUrlType.GENERICJDBCDEFAULTURL.getDBKey().equals(dbTypeName)) {
      String driverName=this.connectionParam.getDriverClassName() == null ? "String_Node_Str" : this.connectionParam.getDriverClassName();
      String connURL=this.connectionParam.getJdbcUrl() == null ? "String_Node_Str" : this.connectionParam.getJdbcUrl();
      complete=!("String_Node_Str".equals(driverName) || "String_Node_Str".equals(connURL));
    }
 else     if (SupportDBUrlType.SQLITE3DEFAULTURL.getDBKey().equals(dbTypeName)) {
      String filename=this.connectionParam.getFilePath();
      complete&=filename != null && !filename.trim().equals("String_Node_Str");
    }
 else {
      complete&=this.userid != null && !this.userid.trim().equals("String_Node_Str");
    }
  }
  if (checkButton != null) {
    checkButton.setEnabled(complete);
  }
  setPageComplete(complete);
}
Program: 139391
Project: 139391
Buggy source:
public static List<String> getShouldNotIncludeIndicatorDefinitionUuidList(){
  if (shouldNotIncludeIndicatorDefinitionUuidList == null) {
    shouldNotIncludeIndicatorDefinitionUuidList=new ArrayList<String>();
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
  }
  return shouldNotIncludeIndicatorDefinitionUuidList;
}

Fixed version (ground truth):
public static List<String> getShouldNotIncludeIndicatorDefinitionUuidList(){
  if (shouldNotIncludeIndicatorDefinitionUuidList == null) {
    shouldNotIncludeIndicatorDefinitionUuidList=new ArrayList<String>();
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
    shouldNotIncludeIndicatorDefinitionUuidList.add("String_Node_Str");
  }
  return shouldNotIncludeIndicatorDefinitionUuidList;
}
Program: 139392
Project: 139392
Buggy source:
private String getTableNameFromColumn(Column column){
  ColumnSet columnSetOwner=ColumnHelper.getColumnSetOwner(column);
  if (columnSetOwner == null) {
    log.error("String_Node_Str" + column.getName() + "String_Node_Str");
  }
 else {
    Package schema=ColumnSetHelper.getParentCatalogOrSchema(columnSetOwner);
    catalogOrSchema=schema.getName();
    return columnSetOwner.getName();
  }
  return null;
}

Fixed version (ground truth):
private String getTableNameFromColumn(Column column){
  ColumnSet columnSetOwner=ColumnHelper.getColumnSetOwner(column);
  if (columnSetOwner == null) {
    log.error("String_Node_Str" + column.getName() + "String_Node_Str");
  }
 else {
    Package pack=ColumnSetHelper.getParentCatalogOrSchema(columnSetOwner);
    if (SwitchHelpers.SCHEMA_SWITCH.doSwitch(pack) != null) {
      schemaName=pack.getName();
      Package catalog=ColumnSetHelper.getParentCatalogOrSchema(pack);
      if (SwitchHelpers.CATALOG_SWITCH.doSwitch(catalog) != null) {
        catalogName=catalog.getName();
      }
    }
    if (SwitchHelpers.CATALOG_SWITCH.doSwitch(pack) != null) {
      catalogName=pack.getName();
    }
    return columnSetOwner.getName();
  }
  return null;
}
Program: 139393
Project: 139393
Buggy source:
private boolean executeQuery(Indicator indicator,Connection connection,Expression query) throws AnalysisExecutionException {
  try {
    List<Object[]> myResultSet=executeQuery(catalogOrSchema,connection,query.getBody());
    indicator.storeSqlResults(myResultSet);
  }
 catch (  SQLException e) {
    log.error(e,e);
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean executeQuery(Indicator indicator,Connection connection,Expression query) throws AnalysisExecutionException {
  try {
    List<Object[]> myResultSet=executeQuery(catalogName,connection,query.getBody());
    indicator.storeSqlResults(myResultSet);
  }
 catch (  SQLException e) {
    log.error(e,e);
    return false;
  }
  return true;
}
Program: 139394
Project: 139394
Buggy source:
/** 
 * DOC jet Comment method "getNBDistinct".
 * @param myResultSet
 * @return
 */
private static Long getNBDistinct(List<Object[]> myResultSet){
  if (myResultSet.size() == 1 && myResultSet.get(0).length == 2) {
    return (Long)myResultSet.get(0)[1];
  }
  return null;
}

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

Fixed version (ground truth):
private static Long getNB(List<Object[]> myResultSet){
  if (myResultSet.size() == 1 && myResultSet.get(0).length == 2) {
    return Long.valueOf(String.valueOf(myResultSet.get(0)[0]));
  }
  return null;
}
Program: 139396
Project: 139396
Buggy source:
/** 
 * Method "fillListOfCatalogs" gets the list of catalogs only when the list is empty. When the list is not empty, no call is executed to the connection.
 * @param connection
 * @param catalogNames the list of catalogs of the given connection
 * @throws SQLException
 */
private static void fillListOfCatalogs(Connection connection,List<String> catalogNames) throws SQLException {
  if (catalogNames.isEmpty()) {
    ResultSet catalogSet=null;
    DatabaseMetaData connectionMetadata=getConnectionMetadata(connection);
    if (connectionMetadata.getDriverName() != null && connectionMetadata.getDriverName().toLowerCase().indexOf(DatabaseConstant.ODBC_ORACLE_DRIVER_NAME) < 0) {
      catalogSet=connectionMetadata.getCatalogs();
    }
    try {
      if (catalogSet != null) {
        while (catalogSet.next()) {
          String catalogName=catalogSet.getString(MetaDataConstants.TABLE_CAT.name());
          if (catalogName != null || !"String_Node_Str".equals(catalogName)) {
            catalogNames.add(catalogName);
          }
        }
      }
    }
 catch (    SQLException e) {
      log.warn("String_Node_Str",e);
    }
 finally {
      if (catalogSet != null) {
        catalogSet.close();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Method "fillListOfCatalogs" gets the list of catalogs only when the list is empty. When the list is not empty, no call is executed to the connection.
 * @param connection
 * @param catalogNames the list of catalogs of the given connection
 * @throws SQLException
 */
private static void fillListOfCatalogs(Connection connection,List<String> catalogNames) throws SQLException {
  if (catalogNames.isEmpty()) {
    ResultSet catalogSet=null;
    DatabaseMetaData connectionMetadata=getConnectionMetadata(connection);
    if (connectionMetadata.getDatabaseProductName() != null && connectionMetadata.getDatabaseProductName().toLowerCase().indexOf(DatabaseConstant.ODBC_ORACLE_PRODUCT_NAME) < 0) {
      catalogSet=connectionMetadata.getCatalogs();
    }
    try {
      if (catalogSet != null) {
        while (catalogSet.next()) {
          String catalogName=catalogSet.getString(MetaDataConstants.TABLE_CAT.name());
          if (catalogName != null || !"String_Node_Str".equals(catalogName)) {
            catalogNames.add(catalogName);
          }
        }
      }
    }
 catch (    SQLException e) {
      log.warn("String_Node_Str",e);
    }
 finally {
      if (catalogSet != null) {
        catalogSet.close();
      }
    }
  }
}
Program: 139397
Project: 139397
Buggy source:
@Override protected boolean preDo(){
  List<TdColumn> tempList=new ArrayList<TdColumn>();
  for (  TdColumn column : getColumns()) {
    if (ColumnHelper.isPrimaryKey(column) || ColumnHelper.isForeignKey(column)) {
      continue;
    }
    if (!Java2SqlType.isTextInSQL(column.getJavaType())) {
      tempList.add(column);
    }
  }
  if (!tempList.isEmpty()) {
    ElementListSelectionDialog dialog=new ElementListSelectionDialog(null,new DQRepositoryViewLabelProvider());
    dialog.setElements(tempList.toArray());
    dialog.setTitle(DefaultMessagesImpl.getString("String_Node_Str"));
    dialog.setMessage(DefaultMessagesImpl.getString("String_Node_Str"));
    dialog.setSize(80,20);
    dialog.create();
    if (Window.OK == dialog.open()) {
      for (      TdColumn column : tempList) {
        MetadataHelper.setDataminingType(DataminingType.NOMINAL,column);
      }
      return true;
    }
 else {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean preDo(){
  List<TdColumn> tempList=new ArrayList<TdColumn>();
  for (  TdColumn column : getColumns()) {
    if (!Java2SqlType.isTextInSQL(column.getJavaType())) {
      tempList.add(column);
    }
  }
  if (!tempList.isEmpty()) {
    ElementListSelectionDialog dialog=new ElementListSelectionDialog(null,new DQRepositoryViewLabelProvider());
    dialog.setElements(tempList.toArray());
    dialog.setTitle(DefaultMessagesImpl.getString("String_Node_Str"));
    dialog.setMessage(DefaultMessagesImpl.getString("String_Node_Str"));
    dialog.setSize(80,20);
    dialog.create();
    if (Window.OK == dialog.open()) {
      for (      TdColumn column : tempList) {
        MetadataHelper.setDataminingType(DataminingType.NOMINAL,column);
      }
      return true;
    }
 else {
      return false;
    }
  }
  return true;
}
Program: 139398
Project: 139398
Buggy source:
/** 
 * Method "getDataminingType" gets the type of the content of a column.
 * @param column
 * @return the DataminingType or null if none has been set.
 */
public static DataminingType getDataminingType(TdColumn column){
  if (ColumnHelper.isPrimaryKey(column) || ColumnHelper.isForeignKey(column)) {
    return DataminingType.NOMINAL;
  }
  return DataminingType.get(column.getContentType());
}

Fixed version (ground truth):
/** 
 * Method "getDataminingType" gets the type of the content of a column.
 * @param column
 * @return the DataminingType or null if none has been set.
 */
public static DataminingType getDataminingType(TdColumn column){
  String contentType=column.getContentType();
  if ((contentType == null || contentType.equals("String_Node_Str")) && (ColumnHelper.isPrimaryKey(column) || ColumnHelper.isForeignKey(column))) {
    return DataminingType.NOMINAL;
  }
 else {
    return DataminingType.get(column.getContentType());
  }
}
Program: 139400
Project: 139400
Buggy source:
/** 
 * DOC qzhang Comment method "doSetInput".
 */
public void doSetInput(){
  List<CatalogIndicator> indicatorList=null;
  if (this.analysis.getResults().getIndicators().size() > 0) {
    indicatorList=getCatalogIndicators();
    if (indicatorList.size() == 0) {
      catalogTableViewer.setInput(getSchemaIndicators());
    }
 else {
      List<SchemaIndicator> schemaIndicators=new ArrayList<SchemaIndicator>();
      schemaIndicators.addAll(getSchemaIndicators());
      schemaIndicators.addAll(indicatorList);
      catalogTableViewer.setInput(schemaIndicators);
    }
  }
 else {
    indicatorList=new ArrayList<CatalogIndicator>();
  }
}

Fixed version (ground truth):
/** 
 * DOC qzhang Comment method "doSetInput".
 */
public void doSetInput(){
  List<CatalogIndicator> indicatorList=null;
  if (this.analysis.getResults().getIndicators().size() > 0) {
    indicatorList=getCatalogIndicators();
    if (indicatorList.size() == 0) {
      catalogTableViewer.setInput(getSchemaIndicators());
    }
 else {
      catalogTableViewer.setInput(indicatorList);
    }
  }
 else {
    indicatorList=new ArrayList<CatalogIndicator>();
  }
}
Program: 139401
Project: 139401
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  StructuredSelection selection=(StructuredSelection)event.getSelection();
  CatalogIndicator firstElement=(CatalogIndicator)selection.getFirstElement();
  schemaTableViewer.setInput(firstElement.getSchemaIndicators());
  schemaTableViewer.getTable().setVisible(true);
  addColumnSorters(schemaTableViewer,schemaTableViewer.getTable().getColumns(),schemaSorters);
}

Fixed version (ground truth):
public void selectionChanged(SelectionChangedEvent event){
  StructuredSelection selection=(StructuredSelection)event.getSelection();
  CatalogIndicator firstElement=(CatalogIndicator)selection.getFirstElement();
  if (firstElement != null) {
    schemaTableViewer.setInput(firstElement.getSchemaIndicators());
    schemaTableViewer.getTable().setVisible(true);
    addColumnSorters(schemaTableViewer,schemaTableViewer.getTable().getColumns(),schemaSorters);
  }
}
Program: 139402
Project: 139402
Buggy source:
@Override public ModelElement initCWMResourceBuilder(){
  Analysis analysis=(Analysis)super.initCWMResourceBuilder();
  if (getAnalysisBuilder() != null) {
    TdDataProvider tdProvider=getParameter().getTdDataProvider();
    getAnalysisBuilder().setAnalysisConnection(tdProvider);
    ConnectionIndicator indicator=SchemaFactory.eINSTANCE.createConnectionIndicator();
    DefinitionHandler.getInstance().setDefaultIndicatorDefinition(indicator);
    indicator.setAnalyzedElement(tdProvider);
    List<TdSchema> tdSchemas=DataProviderHelper.getTdSchema(tdProvider);
    if (tdSchemas.size() != 0) {
      addSchemaIndicator(tdSchemas,indicator);
    }
    List<TdCatalog> tdCatalogs=DataProviderHelper.getTdCatalogs(tdProvider);
    for (    TdCatalog tdCatalog : tdCatalogs) {
      CatalogIndicator createCatalogIndicator=SchemaFactory.eINSTANCE.createCatalogIndicator();
      DefinitionHandler.getInstance().setDefaultIndicatorDefinition(createCatalogIndicator);
      createCatalogIndicator.setAnalyzedElement(tdCatalog);
      indicator.addSchemaIndicator(createCatalogIndicator);
      addSchemaIndicator(CatalogHelper.getSchemas(tdCatalog),indicator);
    }
    getAnalysisBuilder().addElementToAnalyze(tdProvider,indicator);
  }
  return analysis;
}

Fixed version (ground truth):
@Override public ModelElement initCWMResourceBuilder(){
  Analysis analysis=(Analysis)super.initCWMResourceBuilder();
  if (getAnalysisBuilder() != null) {
    TdDataProvider tdProvider=getParameter().getTdDataProvider();
    getAnalysisBuilder().setAnalysisConnection(tdProvider);
    ConnectionIndicator indicator=SchemaFactory.eINSTANCE.createConnectionIndicator();
    DefinitionHandler.getInstance().setDefaultIndicatorDefinition(indicator);
    indicator.setAnalyzedElement(tdProvider);
    List<TdSchema> tdSchemas=DataProviderHelper.getTdSchema(tdProvider);
    if (tdSchemas.size() != 0) {
      addSchemaIndicator(tdSchemas,indicator);
    }
    List<TdCatalog> tdCatalogs=DataProviderHelper.getTdCatalogs(tdProvider);
    for (    TdCatalog tdCatalog : tdCatalogs) {
      CatalogIndicator createCatalogIndicator=SchemaFactory.eINSTANCE.createCatalogIndicator();
      DefinitionHandler.getInstance().setDefaultIndicatorDefinition(createCatalogIndicator);
      createCatalogIndicator.setAnalyzedElement(tdCatalog);
      indicator.addCatalogIndicator(createCatalogIndicator);
      addSchemaIndicator(CatalogHelper.getSchemas(tdCatalog),indicator);
    }
    getAnalysisBuilder().addElementToAnalyze(tdProvider,indicator);
  }
  return analysis;
}
Program: 139403
Project: 139403
Buggy source:
public static ModelElement getModelElement(IFile file){
  ModelElement modelElement=null;
  if (FactoriesUtil.isProvFile(file)) {
    TypedReturnCode<TdDataProvider> returnValue=PrvResourceFileHelper.getInstance().findProvider(file);
    modelElement=returnValue.getObject();
  }
 else   if (FactoriesUtil.isAnalysisFile(file)) {
    modelElement=AnaResourceFileHelper.getInstance().findAnalysis(file);
  }
 else   if (FactoriesUtil.isReportFile(file)) {
    modelElement=RepResourceFileHelper.getInstance().findReport(file);
  }
 else   if (FactoriesUtil.isDQRuleFile(file)) {
    modelElement=DQRuleResourceFileHelper.getInstance().findWhereRule(file);
  }
 else   if (FactoriesUtil.isPatternFile(file)) {
    modelElement=PatternResourceFileHelper.getInstance().findPattern(file);
  }
 else   if (FactoriesUtil.isUDIFile(file)) {
    modelElement=UDIResourceFileHelper.getInstance().findUDI(file);
  }
  return modelElement;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getModelElement".
 * @param file
 * @return
 */
public static ModelElement getModelElement(IFile file){
  ModelElement modelElement=null;
  if (FactoriesUtil.isProvFile(file)) {
    TypedReturnCode<TdDataProvider> returnValue=PrvResourceFileHelper.getInstance().findProvider(file);
    modelElement=returnValue.getObject();
  }
 else   if (FactoriesUtil.isAnalysisFile(file)) {
    modelElement=AnaResourceFileHelper.getInstance().findAnalysis(file);
  }
 else   if (FactoriesUtil.isReportFile(file)) {
    modelElement=RepResourceFileHelper.getInstance().findReport(file);
  }
 else   if (FactoriesUtil.isDQRuleFile(file)) {
    modelElement=DQRuleResourceFileHelper.getInstance().findWhereRule(file);
  }
 else   if (FactoriesUtil.isPatternFile(file)) {
    modelElement=PatternResourceFileHelper.getInstance().findPattern(file);
  }
 else   if (FactoriesUtil.isUDIFile(file)) {
    modelElement=UDIResourceFileHelper.getInstance().findUDI(file);
  }
  return modelElement;
}
Program: 139404
Project: 139404
Buggy source:
public static ModelElement[] getModelElements(IFile[] files){
  List<ModelElement> modelElements=new ArrayList<ModelElement>();
  ModelElement element;
  for (  IFile file : files) {
    element=getModelElement(file);
    if (element != null) {
      modelElements.add(element);
    }
  }
  return modelElements.toArray(new ModelElement[modelElements.size()]);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getModelElements".
 * @param files
 * @return
 */
public static ModelElement[] getModelElements(IFile[] files){
  List<ModelElement> modelElements=new ArrayList<ModelElement>();
  ModelElement element;
  for (  IFile file : files) {
    element=getModelElement(file);
    if (element != null) {
      modelElements.add(element);
    }
  }
  return modelElements.toArray(new ModelElement[modelElements.size()]);
}
Program: 139405
Project: 139405
Buggy source:
public static ResourceFileMap getResourceFileMap(IFile file){
  ResourceFileMap modelElement=null;
  if (FactoriesUtil.isProvFile(file)) {
    modelElement=PrvResourceFileHelper.getInstance();
  }
 else   if (FactoriesUtil.isAnalysisFile(file)) {
    modelElement=AnaResourceFileHelper.getInstance();
  }
 else   if (FactoriesUtil.isReportFile(file)) {
    modelElement=RepResourceFileHelper.getInstance();
  }
 else   if (FactoriesUtil.isDQRuleFile(file)) {
    modelElement=DQRuleResourceFileHelper.getInstance();
  }
 else   if (FactoriesUtil.isPatternFile(file)) {
    modelElement=PatternResourceFileHelper.getInstance();
  }
 else   if (FactoriesUtil.isUDIFile(file)) {
    modelElement=UDIResourceFileHelper.getInstance();
  }
  return modelElement;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getResourceFileMap".
 * @param file
 * @return
 */
public static ResourceFileMap getResourceFileMap(IFile file){
  ResourceFileMap modelElement=null;
  if (FactoriesUtil.isProvFile(file)) {
    modelElement=PrvResourceFileHelper.getInstance();
  }
 else   if (FactoriesUtil.isAnalysisFile(file)) {
    modelElement=AnaResourceFileHelper.getInstance();
  }
 else   if (FactoriesUtil.isReportFile(file)) {
    modelElement=RepResourceFileHelper.getInstance();
  }
 else   if (FactoriesUtil.isDQRuleFile(file)) {
    modelElement=DQRuleResourceFileHelper.getInstance();
  }
 else   if (FactoriesUtil.isPatternFile(file)) {
    modelElement=PatternResourceFileHelper.getInstance();
  }
 else   if (FactoriesUtil.isUDIFile(file)) {
    modelElement=UDIResourceFileHelper.getInstance();
  }
  return modelElement;
}
Program: 139406
Project: 139406
Buggy source:
/** 
 * DOC bZhou Comment method "createInvalidIcon".
 * @param originalImg
 * @return
 */
public static ImageDescriptor createInvalidIcon(ImageDescriptor originalImg){
  ImageDescriptor warnImg=getImageDescriptor(WARN_OVR);
  DecorationOverlayIcon icon=new DecorationOverlayIcon(originalImg.createImage(),warnImg,IDecoration.BOTTOM_RIGHT);
  return icon;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "createInvalidIcon".
 * @param originalImg
 * @return
 */
public static ImageDescriptor createInvalidIcon(ImageDescriptor originalImg){
  ImageDescriptor warnImg=getImageDescriptor(WARN_OVR);
  return originalImg != null ? createIcon(originalImg,warnImg) : null;
}
Program: 139408
Project: 139408
Buggy source:
/** 
 * Initialises the Plugin
 */
public void start(BundleContext context) throws Exception {
  super.start(context);
  try {
    getLog().addLogListener(new ILogListener(){
      public void logging(      IStatus status,      String plugin){
        System.err.println(status.getMessage());
        Throwable t=status.getException();
        if (t != null) {
          System.err.println(t.getMessage());
          t.printStackTrace(System.err);
        }
      }
    }
);
    driverManager=new DriverManager();
    driverManager.loadDrivers();
    aliasManager=new AliasManager();
    aliasManager.loadAliases();
    initAllDrivers();
    try {
      resourceBundle=ResourceBundle.getBundle("String_Node_Str");
    }
 catch (    MissingResourceException x) {
      resourceBundle=null;
    }
    _history=new SQLHistory();
  }
 catch (  Exception e) {
    error("String_Node_Str",e);
    throw e;
  }
}

Fixed version (ground truth):
/** 
 * Initialises the Plugin
 */
public void start(BundleContext context) throws Exception {
  super.start(context);
  try {
    getLog().addLogListener(new ILogListener(){
      public void logging(      IStatus status,      String plugin){
        System.err.println(status.getMessage());
        Throwable t=status.getException();
        if (t != null) {
          System.err.println(t.getMessage());
          t.printStackTrace(System.err);
        }
      }
    }
);
    driverManager=new DriverManager();
    driverManager.loadDrivers();
    aliasManager=new AliasManager();
    aliasManager.loadAliases();
    try {
      resourceBundle=ResourceBundle.getBundle("String_Node_Str");
    }
 catch (    MissingResourceException x) {
      resourceBundle=null;
    }
    _history=new SQLHistory();
  }
 catch (  Exception e) {
    error("String_Node_Str",e);
    throw e;
  }
}
Program: 139409
Project: 139409
Buggy source:
/** 
 * DOC qzhang Comment method "initAllDrivers".
 */
private void initAllDrivers(){
  DriverManager driverModel=getDriverModel();
  Collection<ManagedDriver> drivers=driverModel.getDrivers();
  for (  ManagedDriver mand : drivers) {
    String id2=mand.getId();
    EDriverName[] values=EDriverName.values();
    for (    EDriverName supportDBUrlType : values) {
      if (id2.equals(supportDBUrlType.getSqlEid())) {
        LinkedList<String> jars=mand.getJars();
        if (jars.isEmpty()) {
          mand.setJars(supportDBUrlType.getJars());
        }
        mand.setDriverClassName(supportDBUrlType.getDbDriver());
        try {
          mand.registerSQLDriver();
        }
 catch (        Exception e) {
        }
        break;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "initAllDrivers".
 */
public void initAllDrivers(){
  DriverManager driverModel=getDriverModel();
  Collection<ManagedDriver> drivers=driverModel.getDrivers();
  for (  ManagedDriver mand : drivers) {
    String id2=mand.getId();
    EDriverName[] values=EDriverName.values();
    for (    EDriverName supportDBUrlType : values) {
      if (id2.equals(supportDBUrlType.getSqlEid())) {
        LinkedList<String> jars=mand.getJars();
        if (jars.isEmpty()) {
          mand.setJars(supportDBUrlType.getJars());
        }
        mand.setDriverClassName(supportDBUrlType.getDbDriver());
        try {
          mand.registerSQLDriver();
        }
 catch (        Exception e) {
        }
        break;
      }
    }
  }
}
Program: 139411
Project: 139411
Buggy source:
/** 
 * DOC bZhou Comment method "initWorkspace".
 */
private void initWorkspace(){
  ResourceManager.initResourcePersistence();
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "initWorkspace".
 */
private void initWorkspace(){
  ResourceManager.initResourcePersistence();
  SQLExplorerPlugin.getDefault().initAllDrivers();
  List<TdDataProvider> providers=PrvResourceFileHelper.getInstance().getAllDataProviders();
  for (  DataProvider provider : providers) {
    CorePlugin.getDefault().addConnetionAliasToSQLPlugin(provider);
  }
}
Program: 139412
Project: 139412
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  TreeSelection selection=(TreeSelection)event.getSelection();
  if (selection.size() != 1) {
    return;
  }
  Object selectedElement=selection.getFirstElement();
  if (selectedElement instanceof TdTable || selectedElement instanceof TdView) {
    if (provider == null) {
      provider=(ITreeContentProvider)getCommonViewer().getContentProvider();
    }
    for (    Object child : provider.getChildren(selectedElement)) {
      if (child instanceof IFolderNode && ((IFolderNode)child).getFolderNodeType() == ColumnFolderNode.COLUMNFOLDER_NODE_TYPE) {
        ((IFolderNode)child).loadChildren();
        break;
      }
    }
  }
}

Fixed version (ground truth):
public void selectionChanged(SelectionChangedEvent event){
  TreeSelection selection=(TreeSelection)event.getSelection();
  if (selection.size() != 1) {
    return;
  }
  Object selectedElement=selection.getFirstElement();
  if (selectedElement instanceof TdTable || selectedElement instanceof TdView) {
    if (contentProvider == null) {
      contentProvider=(ITreeContentProvider)getCommonViewer().getContentProvider();
    }
    for (    Object child : contentProvider.getChildren(selectedElement)) {
      if (child instanceof IFolderNode && ((IFolderNode)child).getFolderNodeType() == ColumnFolderNode.COLUMNFOLDER_NODE_TYPE) {
        ((IFolderNode)child).loadChildren();
        break;
      }
    }
  }
}
Program: 139414
Project: 139414
Buggy source:
public DQRespositoryView(){
  super();
  DQStructureManager manager=DQStructureManager.getInstance();
  if (manager.isNeedCreateStructure()) {
    manager.createDQStructure();
  }
 else {
    List<IWorkspaceMigrationTask> tasks=MigrationTaskManager.findValidMigrationTasks();
    MigrationTaskManager.doMigrationTask(tasks);
  }
}

Fixed version (ground truth):
public DQRespositoryView(){
  super();
  DQStructureManager manager=DQStructureManager.getInstance();
  if (manager.isNeedCreateStructure()) {
    manager.createDQStructure();
  }
  if (manager.isNeedMigration()) {
    MigrationTaskManager.doMigrationTask(MigrationTaskManager.findValidTasks());
  }
}
Program: 139415
Project: 139415
Buggy source:
@Override public String getRangeAsString(){
  StringBuilder msg=new StringBuilder();
  if (isOutOfRange(getNumMatch()) || isOutOfRange(getNumNoMatch())) {
    msg.append("String_Node_Str" + range);
    msg.append("String_Node_Str");
  }
  if (isOutOfRange(getPerMatch()) || isOutOfRange(getPerNoMatch())) {
    msg.append("String_Node_Str" + range);
  }
  return msg.length() == 0 ? null : msg.toString();
}

Fixed version (ground truth):
@Override public String getRangeAsString(){
  StringBuilder msg=new StringBuilder();
  if (isOutOfRange(getNumMatch())) {
    msg.append("String_Node_Str" + range);
    msg.append("String_Node_Str");
  }
  if (isOutOfRange(getPerMatch())) {
    msg.append("String_Node_Str" + range);
  }
  return msg.length() == 0 ? null : msg.toString();
}
Program: 139417
Project: 139417
Buggy source:
public Composite generate(Composite parent,boolean isWithHelp){
  Composite frameComp=createAWTSWTComposite(parent);
  frame=SWT_AWT.new_Frame(frameComp);
  frame.setTitle(DefaultMessagesImpl.getString("String_Node_Str"));
  pr=new LineRender(graphbuilder);
  sr=new LineRender(graphbuilder);
  PersistentLayout layout=new PersistentLayoutImpl(new FRLayout(graph));
  VisualizationModel vm=new DefaultVisualizationModel(layout);
  vv=new VisualizationViewer(vm,pr);
  sv=new SatelliteVisualizationViewer(vv,vm,sr,new Dimension(200,200));
  configureVViewer(vv);
  JPanel controllers=createToolControllers(vv);
  if (this.isPreview)   controllers.setVisible(false);
  JPanel panel=new GraphZoomScrollPane(vv);
  if (isWithHelp) {
    helpDialog=createSatelliteDialog(vv,sv);
    controllers.add(createShowSatelliteCheck(helpDialog));
  }
  frame.add(panel);
  frame.add(controllers,BorderLayout.SOUTH);
  frame.validate();
  addListeners();
  return frameComp;
}

Fixed version (ground truth):
public Composite generate(Composite parent,boolean isWithHelp){
  Composite frameComp=createAWTSWTComposite(parent);
  frame=SWT_AWT.new_Frame(frameComp);
  frame.setTitle(DefaultMessagesImpl.getString("String_Node_Str"));
  pr=new LineRender(graphbuilder);
  sr=new LineRender(graphbuilder);
  PersistentLayout layout=new PersistentLayoutImpl(new ISOMLayout(graph));
  VisualizationModel vm=new DefaultVisualizationModel(layout);
  vv=new VisualizationViewer(vm,pr);
  sv=new SatelliteVisualizationViewer(vv,vm,sr,new Dimension(200,200));
  configureVViewer(vv);
  JPanel controllers=createToolControllers(vv);
  if (this.isPreview)   controllers.setVisible(false);
  JPanel panel=new GraphZoomScrollPane(vv);
  if (isWithHelp) {
    helpDialog=createSatelliteDialog(vv,sv);
    controllers.add(createShowSatelliteCheck(helpDialog));
  }
  frame.add(panel);
  frame.add(controllers,BorderLayout.SOUTH);
  frame.validate();
  addListeners();
  return frameComp;
}
Program: 139418
Project: 139418
Buggy source:
/** 
 * DOC bZhou Comment method "getPatternes".
 * @param folder
 * @param allPattern
 */
public void getPatternes(IFolder folder,List<Pattern> allPattern){
  try {
    for (    IResource resource : folder.members()) {
      if (resource.getType() == IResource.FOLDER) {
        getPatternes(folder.getFolder(resource.getName()),allPattern);
        continue;
      }
      IFile file=(IFile)resource;
      if (file.getFileExtension().equals(FactoriesUtil.PATTERN)) {
        Resource fileResource=getFileResource(file);
        Pattern pattern=retirePattern(fileResource);
        if (pattern != null) {
          allPattern.add(pattern);
        }
      }
    }
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getPatternes".
 * @param folder
 * @param allPattern
 */
public void getPatternes(IFolder folder,List<Pattern> allPattern){
  try {
    for (    IResource resource : folder.members()) {
      if (resource.getType() == IResource.FOLDER) {
        getPatternes(folder.getFolder(resource.getName()),allPattern);
        continue;
      }
      IFile file=(IFile)resource;
      if (FactoriesUtil.isPatternFile(file)) {
        Resource fileResource=getFileResource(file);
        Pattern pattern=retirePattern(fileResource);
        if (pattern != null) {
          allPattern.add(pattern);
        }
      }
    }
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
  }
}