nus-yam/ex-repair huggingface dataset:
Program: 84052
Project: 84052
Buggy source:
private void addUnexpectedPrimaryKeyChanges(List<ChangeSet> changes){
  for (  PrimaryKey pk : getUnexpectedPrimaryKeys()) {
    if (!getUnexpectedTables().contains(pk.getTable())) {
      DropPrimaryKeyChange change=new DropPrimaryKeyChange();
      change.setTableName(pk.getTable().getName());
      change.setSchemaName(pk.getTable().getSchema());
      change.setConstraintName(pk.getName());
      change.setTableName(pk.getTablespace());
      changes.add(generateChangeSet(change));
    }
  }
}

Fixed version (ground truth):
private void addUnexpectedPrimaryKeyChanges(List<ChangeSet> changes){
  for (  PrimaryKey pk : getUnexpectedPrimaryKeys()) {
    if (!getUnexpectedTables().contains(pk.getTable())) {
      DropPrimaryKeyChange change=new DropPrimaryKeyChange();
      change.setTableName(pk.getTable().getName());
      change.setSchemaName(pk.getTable().getSchema());
      change.setConstraintName(pk.getName());
      changes.add(generateChangeSet(change));
    }
  }
}
Program: 84053
Project: 84053
Buggy source:
public int getDatabaseMajorVersion() throws DatabaseException {
  try {
    return connection.getDatabaseMajorVersion();
  }
 catch (  DatabaseException e) {
    throw new DatabaseException(e);
  }
}

Fixed version (ground truth):
public int getDatabaseMajorVersion() throws DatabaseException {
  if (connection == null) {
    return -1;
  }
  try {
    return connection.getDatabaseMajorVersion();
  }
 catch (  DatabaseException e) {
    throw new DatabaseException(e);
  }
}
Program: 84054
Project: 84054
Buggy source:
public int getDatabaseMinorVersion() throws DatabaseException {
  try {
    return connection.getDatabaseMinorVersion();
  }
 catch (  DatabaseException e) {
    throw new DatabaseException(e);
  }
}

Fixed version (ground truth):
public int getDatabaseMinorVersion() throws DatabaseException {
  if (connection == null) {
    return -1;
  }
  try {
    return connection.getDatabaseMinorVersion();
  }
 catch (  DatabaseException e) {
    throw new DatabaseException(e);
  }
}
Program: 84055
Project: 84055
Buggy source:
public String getDatabaseProductVersion() throws DatabaseException {
  try {
    return connection.getDatabaseProductVersion();
  }
 catch (  DatabaseException e) {
    throw new DatabaseException(e);
  }
}

Fixed version (ground truth):
public String getDatabaseProductVersion() throws DatabaseException {
  if (connection == null) {
    return null;
  }
  try {
    return connection.getDatabaseProductVersion();
  }
 catch (  DatabaseException e) {
    throw new DatabaseException(e);
  }
}
Program: 84056
Project: 84056
Buggy source:
/** 
 * Returns the name of the database product according to the underlying database.
 */
public String getDatabaseProductName(){
  try {
    return connection.getDatabaseProductName();
  }
 catch (  DatabaseException e) {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Returns the name of the database product according to the underlying database.
 */
public String getDatabaseProductName(){
  if (connection == null) {
    return null;
  }
  try {
    return connection.getDatabaseProductName();
  }
 catch (  DatabaseException e) {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 84057
Project: 84057
Buggy source:
@Override public int hashCode(){
  return (connection != null ? connection.hashCode() : 0);
}

Fixed version (ground truth):
@Override public int hashCode(){
  return (connection != null ? connection.hashCode() : super.hashCode());
}
Program: 84058
Project: 84058
Buggy source:
@Override public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  AbstractDatabase that=(AbstractDatabase)o;
  return !(connection != null ? !connection.equals(that.connection) : that.connection != null);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  AbstractDatabase that=(AbstractDatabase)o;
  if (connection == null) {
    if (that.connection == null) {
      return this == that;
    }
 else {
      return false;
    }
  }
 else {
    return connection.equals(that.connection);
  }
}
Program: 84059
Project: 84059
Buggy source:
private void checkViews(DiffResult diffResult){
  for (  View baseView : referenceSnapshot.getViews()) {
    if (!targetSnapshot.getViews().contains(baseView)) {
      diffResult.addMissingView(baseView);
    }
 else {
      View targetView=null;
      for (      View view : targetSnapshot.getViews()) {
        if (view.getName().equals(baseView.getName())) {
          if (!view.getDefinition().equals(baseView.getDefinition())) {
            diffResult.addChangedView(view);
          }
        }
      }
    }
  }
  for (  View targetView : targetSnapshot.getViews()) {
    if (!referenceSnapshot.getViews().contains(targetView)) {
      diffResult.addUnexpectedView(targetView);
    }
 else {
      for (      View view : targetSnapshot.getViews()) {
        if (view.getName().equals(targetView.getName())) {
          if (!view.getDefinition().equals(targetView.getDefinition())) {
            diffResult.addChangedView(view);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void checkViews(DiffResult diffResult){
  for (  View baseView : referenceSnapshot.getViews()) {
    if (!targetSnapshot.getViews().contains(baseView)) {
      diffResult.addMissingView(baseView);
    }
 else {
      for (      View targetView : targetSnapshot.getViews()) {
        if (targetView.getName().equals(baseView.getName())) {
          if (!targetView.getDefinition().equals(baseView.getDefinition())) {
            diffResult.addChangedView(targetView);
          }
        }
      }
    }
  }
  for (  View targetView : targetSnapshot.getViews()) {
    if (!referenceSnapshot.getViews().contains(targetView)) {
      diffResult.addUnexpectedView(targetView);
    }
 else {
      for (      View referenceView : referenceSnapshot.getViews()) {
        if (referenceView.getName().equals(targetView.getName())) {
          if (!referenceView.getDefinition().equals(targetView.getDefinition())) {
            diffResult.addChangedView(referenceView);
          }
        }
      }
    }
  }
}
Program: 84060
Project: 84060
Buggy source:
@Override public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  if (null == this.getColumnNames())   return false;
  UniqueConstraint that=(UniqueConstraint)o;
  boolean result=false;
  result=!(getColumnNames() != null ? !getColumnNames().equalsIgnoreCase(that.getColumnNames()) : that.getColumnNames() != null) && isDeferrable() == that.isDeferrable() && isInitiallyDeferred() == that.isInitiallyDeferred() && isDisabled() == that.isDisabled();
  if (result) {
    if (null == this.getTable()) {
      result=null == that.getTable();
    }
 else     if (null == this.getTable()) {
      result=false;
    }
 else {
      result=this.getTable().getName().equals(that.getTable().getName());
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  if (null == this.getColumnNames())   return false;
  UniqueConstraint that=(UniqueConstraint)o;
  boolean result=false;
  result=!(getColumnNames() != null ? !getColumnNames().equalsIgnoreCase(that.getColumnNames()) : that.getColumnNames() != null) && isDeferrable() == that.isDeferrable() && isInitiallyDeferred() == that.isInitiallyDeferred() && isDisabled() == that.isDisabled();
  if (result) {
    if (null == this.getTable()) {
      result=null == that.getTable();
    }
 else     if (null == that.getTable()) {
      result=false;
    }
 else {
      result=this.getTable().getName().equals(that.getTable().getName());
    }
  }
  return result;
}
Program: 84061
Project: 84061
Buggy source:
private void addMissingIndexChanges(List<ChangeSet> changes){
  for (  Index index : getMissingIndexes()) {
    CreateIndexChange change=new CreateIndexChange();
    change.setTableName(index.getTable().getName());
    change.setSchemaName(index.getTable().getSchema());
    change.setIndexName(index.getName());
    change.setUnique(index.isUnique());
    change.setAssociatedWith(index.getAssociatedWithAsString());
    for (    String columnName : index.getColumns()) {
      ColumnConfig column=new ColumnConfig();
      column.setName(columnName);
      change.addColumn(column);
    }
    changes.add(generateChangeSet(change));
  }
}

Fixed version (ground truth):
private void addMissingIndexChanges(List<ChangeSet> changes){
  for (  Index index : getMissingIndexes()) {
    CreateIndexChange change=new CreateIndexChange();
    change.setTableName(index.getTable().getName());
    change.setTablespace(index.getTablespace());
    change.setSchemaName(index.getTable().getSchema());
    change.setIndexName(index.getName());
    change.setUnique(index.isUnique());
    change.setAssociatedWith(index.getAssociatedWithAsString());
    for (    String columnName : index.getColumns()) {
      ColumnConfig column=new ColumnConfig();
      column.setName(columnName);
      change.addColumn(column);
    }
    changes.add(generateChangeSet(change));
  }
}
Program: 84063
Project: 84063
Buggy source:
private void addUnexpectedPrimaryKeyChanges(List<ChangeSet> changes){
  for (  PrimaryKey pk : getUnexpectedPrimaryKeys()) {
    if (!getUnexpectedTables().contains(pk.getTable())) {
      DropPrimaryKeyChange change=new DropPrimaryKeyChange();
      change.setTableName(pk.getTable().getName());
      change.setSchemaName(pk.getTable().getSchema());
      change.setConstraintName(pk.getName());
      changes.add(generateChangeSet(change));
    }
  }
}

Fixed version (ground truth):
private void addUnexpectedPrimaryKeyChanges(List<ChangeSet> changes){
  for (  PrimaryKey pk : getUnexpectedPrimaryKeys()) {
    if (!getUnexpectedTables().contains(pk.getTable())) {
      DropPrimaryKeyChange change=new DropPrimaryKeyChange();
      change.setTableName(pk.getTable().getName());
      change.setSchemaName(pk.getTable().getSchema());
      change.setConstraintName(pk.getName());
      change.setTableName(pk.getTablespace());
      changes.add(generateChangeSet(change));
    }
  }
}
Program: 84064
Project: 84064
Buggy source:
private void addMissingPrimaryKeyChanges(List<ChangeSet> changes){
  for (  PrimaryKey pk : getMissingPrimaryKeys()) {
    AddPrimaryKeyChange change=new AddPrimaryKeyChange();
    change.setTableName(pk.getTable().getName());
    change.setSchemaName(pk.getTable().getSchema());
    change.setConstraintName(pk.getName());
    change.setColumnNames(pk.getColumnNames());
    changes.add(generateChangeSet(change));
  }
}

Fixed version (ground truth):
private void addMissingPrimaryKeyChanges(List<ChangeSet> changes){
  for (  PrimaryKey pk : getMissingPrimaryKeys()) {
    AddPrimaryKeyChange change=new AddPrimaryKeyChange();
    change.setTableName(pk.getTable().getName());
    change.setSchemaName(pk.getTable().getSchema());
    change.setConstraintName(pk.getName());
    change.setColumnNames(pk.getColumnNames());
    change.setTablespace(pk.getTablespace());
    changes.add(generateChangeSet(change));
  }
}
Program: 84065
Project: 84065
Buggy source:
public static CheckSum parse(String checksumValue){
  if (checksumValue.startsWith(CheckSum.getCurrentVersion() + "String_Node_Str")) {
    return new CheckSum(checksumValue.substring(2),getCurrentVersion());
  }
 else {
    return new CheckSum(checksumValue,1);
  }
}

Fixed version (ground truth):
public static CheckSum parse(String checksumValue){
  if (checksumValue == null) {
    return null;
  }
  if (checksumValue.startsWith(CheckSum.getCurrentVersion() + "String_Node_Str")) {
    return new CheckSum(checksumValue.substring(2),getCurrentVersion());
  }
 else {
    return new CheckSum(checksumValue,1);
  }
}
Program: 84066
Project: 84066
Buggy source:
public boolean isNullable(){
  return getConstraints() != null && getConstraints().isNullable();
}

Fixed version (ground truth):
public boolean isNullable(){
  return getConstraints() == null || getConstraints().isNullable();
}
Program: 84067
Project: 84067
Buggy source:
@Override public ValidationErrors validate(Database database){
  return customChange.validate(database);
}

Fixed version (ground truth):
@Override public ValidationErrors validate(Database database){
  try {
    return customChange.validate(database);
  }
 catch (  AbstractMethodError e) {
    return new ValidationErrors();
  }
}
Program: 84068
Project: 84068
Buggy source:
@SuppressWarnings({"String_Node_Str"}) public boolean accepts(ChangeSet changeSet){
  for (  RanChangeSet ranChangeSet : ranChangeSets) {
    if (ranChangeSet.getId().equals(changeSet.getId()) && ranChangeSet.getAuthor().equals(changeSet.getAuthor()) && isPathEquals(changeSet,ranChangeSet)) {
      if (!changeSet.generateCheckSum().equals(ranChangeSet.getLastCheckSum())) {
        UpdateStatement md5sumUpdateStatement=new UpdateStatement(database.getDefaultSchemaName(),database.getDatabaseChangeLogTableName());
        md5sumUpdateStatement.addNewColumnValue("String_Node_Str",changeSet.generateCheckSum());
        md5sumUpdateStatement.setWhereClause("String_Node_Str");
        md5sumUpdateStatement.addWhereParameter(changeSet.getId());
        md5sumUpdateStatement.addWhereParameter(changeSet.getAuthor());
        md5sumUpdateStatement.addWhereParameter(changeSet.getFilePath());
        try {
          ExecutorService.getInstance().getWriteExecutor(database).update(md5sumUpdateStatement,new ArrayList<SqlVisitor>());
        }
 catch (        JDBCException e) {
          throw new RuntimeException(e);
        }
      }
      if (changeSet.shouldAlwaysRun()) {
        return true;
      }
 else       if (changeSet.shouldRunOnChange() && !changeSet.generateCheckSum().equals(ranChangeSet.getLastCheckSum())) {
        return true;
      }
 else {
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) public boolean accepts(ChangeSet changeSet){
  for (  RanChangeSet ranChangeSet : ranChangeSets) {
    if (ranChangeSet.getId().equals(changeSet.getId()) && ranChangeSet.getAuthor().equals(changeSet.getAuthor()) && isPathEquals(changeSet,ranChangeSet)) {
      if (!changeSet.generateCheckSum().equals(ranChangeSet.getLastCheckSum())) {
        UpdateStatement md5sumUpdateStatement=new UpdateStatement(database.getDefaultSchemaName(),database.getDatabaseChangeLogTableName());
        md5sumUpdateStatement.addNewColumnValue("String_Node_Str",changeSet.generateCheckSum().toString());
        md5sumUpdateStatement.setWhereClause("String_Node_Str");
        md5sumUpdateStatement.addWhereParameter(changeSet.getId());
        md5sumUpdateStatement.addWhereParameter(changeSet.getAuthor());
        md5sumUpdateStatement.addWhereParameter(changeSet.getFilePath());
        try {
          ExecutorService.getInstance().getWriteExecutor(database).update(md5sumUpdateStatement,new ArrayList<SqlVisitor>());
        }
 catch (        JDBCException e) {
          throw new RuntimeException(e);
        }
      }
      if (changeSet.shouldAlwaysRun()) {
        return true;
      }
 else       if (changeSet.shouldRunOnChange() && !changeSet.generateCheckSum().equals(ranChangeSet.getLastCheckSum())) {
        return true;
      }
 else {
        return false;
      }
    }
  }
  return true;
}
Program: 84069
Project: 84069
Buggy source:
/** 
 * Returns the ChangeSets that have been run against the current database.
 */
public List<RanChangeSet> getRanChangeSetList() throws JDBCException {
  if (this.ranChangeSetList != null) {
    return this.ranChangeSetList;
  }
  String databaseChangeLogTableName=escapeTableName(getLiquibaseSchemaName(),getDatabaseChangeLogTableName());
  ranChangeSetList=new ArrayList<RanChangeSet>();
  if (doesChangeLogTableExist()) {
    log.info("String_Node_Str" + databaseChangeLogTableName);
    SqlStatement select=new SelectFromDatabaseChangeLogStatement("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").setOrderBy("String_Node_Str","String_Node_Str");
    List<Map> results=ExecutorService.getInstance().getReadExecutor(this).queryForList(select);
    for (    Map rs : results) {
      String fileName=rs.get("String_Node_Str").toString();
      String author=rs.get("String_Node_Str").toString();
      String id=rs.get("String_Node_Str").toString();
      String md5sum=rs.get("String_Node_Str").toString();
      Date dateExecuted=(Date)rs.get("String_Node_Str");
      String tag=rs.get("String_Node_Str").toString();
      RanChangeSet ranChangeSet=new RanChangeSet(fileName,id,author,CheckSum.parse(md5sum),dateExecuted,tag);
      ranChangeSetList.add(ranChangeSet);
    }
  }
  return ranChangeSetList;
}

Fixed version (ground truth):
/** 
 * Returns the ChangeSets that have been run against the current database.
 */
public List<RanChangeSet> getRanChangeSetList() throws JDBCException {
  if (this.ranChangeSetList != null) {
    return this.ranChangeSetList;
  }
  String databaseChangeLogTableName=escapeTableName(getLiquibaseSchemaName(),getDatabaseChangeLogTableName());
  ranChangeSetList=new ArrayList<RanChangeSet>();
  if (doesChangeLogTableExist()) {
    log.info("String_Node_Str" + databaseChangeLogTableName);
    SqlStatement select=new SelectFromDatabaseChangeLogStatement("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").setOrderBy("String_Node_Str","String_Node_Str");
    List<Map> results=ExecutorService.getInstance().getReadExecutor(this).queryForList(select);
    for (    Map rs : results) {
      String fileName=rs.get("String_Node_Str").toString();
      String author=rs.get("String_Node_Str").toString();
      String id=rs.get("String_Node_Str").toString();
      String md5sum=rs.get("String_Node_Str") == null ? null : rs.get("String_Node_Str").toString();
      Date dateExecuted=(Date)rs.get("String_Node_Str");
      String tag=rs.get("String_Node_Str") == null ? null : rs.get("String_Node_Str").toString();
      RanChangeSet ranChangeSet=new RanChangeSet(fileName,id,author,CheckSum.parse(md5sum),dateExecuted,tag);
      ranChangeSetList.add(ranChangeSet);
    }
  }
  return ranChangeSetList;
}
Program: 84071
Project: 84071
Buggy source:
public Sql[] generateSql(ModifyColumnsStatement statement,Database database,SqlGeneratorChain sqlGeneratorChain){
  if (database instanceof SQLiteDatabase) {
    return generateStatementsForSQLiteDatabase(statement,database);
  }
  List<Sql> sql=new ArrayList<Sql>();
  for (  ColumnConfig column : statement.getColumns()) {
    String alterTable="String_Node_Str" + database.escapeTableName(statement.getSchemaName(),statement.getTableName());
    alterTable+="String_Node_Str" + getModifyString(database) + "String_Node_Str";
    alterTable+=database.escapeColumnName(statement.getSchemaName(),statement.getTableName(),column.getName());
    alterTable+=getPreDataTypeString(database);
    alterTable+=database.getColumnType(column.getType(),false);
    if (supportsExtraMetaData(database)) {
      if (!column.isNullable()) {
        alterTable+="String_Node_Str";
      }
 else {
        if (database instanceof SybaseDatabase || database instanceof SybaseASADatabase) {
          alterTable+="String_Node_Str";
        }
      }
      alterTable+=getDefaultClause(column,database);
      if (column.isAutoIncrement()) {
        alterTable+="String_Node_Str" + database.getAutoIncrementClause();
      }
      if (column.isPrimaryKey()) {
        alterTable+="String_Node_Str";
      }
    }
    alterTable+=getPostDataTypeString(database);
    sql.add(new UnparsedSql(alterTable));
  }
  return sql.toArray(new Sql[sql.size()]);
}

Fixed version (ground truth):
public Sql[] generateSql(ModifyColumnsStatement statement,Database database,SqlGeneratorChain sqlGeneratorChain){
  if (database instanceof SQLiteDatabase) {
    return generateStatementsForSQLiteDatabase(statement,database);
  }
  List<Sql> sql=new ArrayList<Sql>();
  for (  ColumnConfig column : statement.getColumns()) {
    String alterTable="String_Node_Str" + database.escapeTableName(statement.getSchemaName(),statement.getTableName());
    alterTable+="String_Node_Str" + getModifyString(database) + "String_Node_Str";
    alterTable+=database.escapeColumnName(statement.getSchemaName(),statement.getTableName(),column.getName());
    alterTable+=getPreDataTypeString(database);
    alterTable+=database.getColumnType(column.getType(),false);
    if (supportsExtraMetaData(database)) {
      if (!column.isNullable()) {
        alterTable+="String_Node_Str";
      }
 else {
        if (database instanceof SybaseDatabase || database instanceof SybaseASADatabase) {
          alterTable+="String_Node_Str";
        }
      }
      alterTable+=getDefaultClause(column,database);
      if (column.isAutoIncrement() != null && column.isAutoIncrement()) {
        alterTable+="String_Node_Str" + database.getAutoIncrementClause();
      }
      if (column.isPrimaryKey()) {
        alterTable+="String_Node_Str";
      }
    }
    alterTable+=getPostDataTypeString(database);
    sql.add(new UnparsedSql(alterTable));
  }
  return sql.toArray(new Sql[sql.size()]);
}
Program: 84072
Project: 84072
Buggy source:
private void writeHeader(Object object,FileWriter fileWriter) throws IOException {
  String title=createTitle(object);
  fileWriter.append("String_Node_Str").append("String_Node_Str").append(title).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(title).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
}

Fixed version (ground truth):
private void writeHeader(Object object,FileWriter fileWriter) throws IOException {
  String title=createTitle(object);
  fileWriter.append("String_Node_Str").append("String_Node_Str").append(title).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(title.replaceAll("String_Node_Str","String_Node_Str")).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
}
Program: 84073
Project: 84073
Buggy source:
protected SqlGenerator getGenerator(SqlStatement statement,Database database){
  SortedSet<SqlGenerator> validGenerators=getGenerators(statement,database);
  if (validGenerators.size() == 0) {
    return null;
  }
 else {
    return validGenerators.first();
  }
}

Fixed version (ground truth):
public SqlGenerator getGenerator(SqlStatement statement,Database database){
  SortedSet<SqlGenerator> validGenerators=getGenerators(statement,database);
  if (validGenerators.size() == 0) {
    return null;
  }
 else {
    return validGenerators.first();
  }
}
Program: 84078
Project: 84078
Buggy source:
/** 
 * Creates a snapshot of the given database.
 */
public SqlDatabaseSnapshot(Database database,Set<DiffStatusListener> statusListeners,String requestedSchema) throws JDBCException {
  try {
    this.schema=requestedSchema;
    this.database=database;
    this.databaseMetaData=database.getConnection().getMetaData();
    this.statusListeners=statusListeners;
    readTablesAndViews(requestedSchema);
    readForeignKeyInformation(requestedSchema);
    readPrimaryKeys(requestedSchema);
    readColumns(requestedSchema);
    readUniqueConstraints(requestedSchema);
    readIndexes(requestedSchema);
    readSequences(requestedSchema);
    this.tables=new HashSet<Table>(tablesMap.values());
    this.views=new HashSet<View>(viewsMap.values());
    this.columns=new HashSet<Column>(columnsMap.values());
  }
 catch (  SQLException e) {
    throw new JDBCException(e);
  }
}

Fixed version (ground truth):
/** 
 * Creates a snapshot of the given database.
 */
public SqlDatabaseSnapshot(Database database,Set<DiffStatusListener> statusListeners,String requestedSchema) throws JDBCException {
  if (requestedSchema == null) {
    requestedSchema=database.getDefaultSchemaName();
  }
  try {
    this.schema=requestedSchema;
    this.database=database;
    this.databaseMetaData=database.getConnection().getMetaData();
    this.statusListeners=statusListeners;
    readTablesAndViews(requestedSchema);
    readForeignKeyInformation(requestedSchema);
    readPrimaryKeys(requestedSchema);
    readColumns(requestedSchema);
    readUniqueConstraints(requestedSchema);
    readIndexes(requestedSchema);
    readSequences(requestedSchema);
    this.tables=new HashSet<Table>(tablesMap.values());
    this.views=new HashSet<View>(viewsMap.values());
    this.columns=new HashSet<Column>(columnsMap.values());
  }
 catch (  SQLException e) {
    throw new JDBCException(e);
  }
}
Program: 84081
Project: 84081
Buggy source:
public UIFacade getFacade(){
  return facade;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public UIFacade getFacade(){
  if (facade == null) {
    System.out.println("String_Node_Str");
    ClassLoader cl=UIFacade.class.getClassLoader();
    try {
      Class<UIFacade> swingUIClazz=(Class<UIFacade>)cl.loadClass(UI_IMPL_CLASSNAME);
      Constructor<UIFacade> con=swingUIClazz.getConstructor(new Class[0]);
      facade=con.newInstance(new Object[0]);
    }
 catch (    Exception e) {
      throw new RuntimeException(e);
    }
  }
  return facade;
}
Program: 84082
Project: 84082
Buggy source:
public void close() throws SQLException {
  con.rollback();
  con.close();
}

Fixed version (ground truth):
public void close() throws SQLException {
  rollback();
  con.close();
}
Program: 84083
Project: 84083
Buggy source:
public void rollback(Savepoint savepoint) throws SQLException {
  con.rollback(savepoint);
}

Fixed version (ground truth):
public void rollback(Savepoint savepoint) throws SQLException {
  if (!con.getAutoCommit()) {
    con.rollback(savepoint);
  }
}
Program: 84084
Project: 84084
Buggy source:
public TestLiquibase(){
  super("String_Node_Str",new ClassLoaderFileOpener(),null);
  inputStream=createMock(InputStream.class);
  replay(inputStream);
}

Fixed version (ground truth):
public TestLiquibase(){
  super("String_Node_Str",new ClassLoaderFileOpener(),((Database)null));
  inputStream=createMock(InputStream.class);
  replay(inputStream);
}
Program: 84085
Project: 84085
Buggy source:
private SqlStatement[] generateStatementsForSQLiteDatabase(Database database) throws UnsupportedChangeException {
  List<SqlStatement> statements=new ArrayList<SqlStatement>();
  AlterTableVisitor rename_alter_visitor=new AlterTableVisitor(){
    public ColumnConfig[] getColumnsToAdd(){
      return new ColumnConfig[0];
    }
    public boolean copyThisColumn(    ColumnConfig column){
      return true;
    }
    public boolean createThisColumn(    ColumnConfig column){
      String[] split_columns=getColumnNames().split("String_Node_Str");
      for (      String split_column : split_columns) {
        if (column.getName().equals(split_column)) {
          column.getConstraints().setPrimaryKey(new Boolean(true));
        }
      }
      return true;
    }
    public boolean createThisIndex(    Index index){
      return true;
    }
  }
;
  try {
    statements.addAll(SQLiteDatabase.getAlterTableStatements(rename_alter_visitor,database,getSchemaName(),getTableName()));
  }
 catch (  JDBCException e) {
    e.printStackTrace();
  }
  return statements.toArray(new SqlStatement[statements.size()]);
}

Fixed version (ground truth):
private SqlStatement[] generateStatementsForSQLiteDatabase(Database database) throws UnsupportedChangeException {
  List<SqlStatement> statements=new ArrayList<SqlStatement>();
  AlterTableVisitor rename_alter_visitor=new AlterTableVisitor(){
    public ColumnConfig[] getColumnsToAdd(){
      return new ColumnConfig[0];
    }
    public boolean copyThisColumn(    ColumnConfig column){
      return true;
    }
    public boolean createThisColumn(    ColumnConfig column){
      String[] split_columns=getColumnNames().split("String_Node_Str");
      for (      String split_column : split_columns) {
        if (column.getName().equals(split_column)) {
          column.getConstraints().setPrimaryKey(true);
        }
      }
      return true;
    }
    public boolean createThisIndex(    Index index){
      return true;
    }
  }
;
  try {
    statements.addAll(SQLiteDatabase.getAlterTableStatements(rename_alter_visitor,database,getSchemaName(),getTableName()));
  }
 catch (  JDBCException e) {
    e.printStackTrace();
  }
  return statements.toArray(new SqlStatement[statements.size()]);
}
Program: 84086
Project: 84086
Buggy source:
public boolean createThisColumn(ColumnConfig column){
  String[] split_columns=getColumnNames().split("String_Node_Str");
  for (  String split_column : split_columns) {
    if (column.getName().equals(split_column)) {
      column.getConstraints().setPrimaryKey(new Boolean(true));
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean createThisColumn(ColumnConfig column){
  String[] split_columns=getColumnNames().split("String_Node_Str");
  for (  String split_column : split_columns) {
    if (column.getName().equals(split_column)) {
      column.getConstraints().setPrimaryKey(true);
    }
  }
  return true;
}
Program: 84087
Project: 84087
Buggy source:
public SqlStatement[] generateStatements(Database database) throws UnsupportedChangeException {
  List<SqlStatement> statements=new ArrayList<SqlStatement>();
  if (database instanceof SQLiteDatabase) {
    return generateStatementsForSQLiteDatabase(database);
  }
  return new SqlStatement[]{new RenameColumnStatement(getSchemaName() == null ? database.getDefaultSchemaName() : getSchemaName(),getTableName(),getOldColumnName(),getNewColumnName(),getColumnDataType())};
}

Fixed version (ground truth):
public SqlStatement[] generateStatements(Database database) throws UnsupportedChangeException {
  if (database instanceof SQLiteDatabase) {
    return generateStatementsForSQLiteDatabase(database);
  }
  return new SqlStatement[]{new RenameColumnStatement(getSchemaName() == null ? database.getDefaultSchemaName() : getSchemaName(),getTableName(),getOldColumnName(),getNewColumnName(),getColumnDataType())};
}
Program: 84088
Project: 84088
Buggy source:
public String format(LogRecord rec){
  return new String(rec.getMessage() + "String_Node_Str");
}

Fixed version (ground truth):
public String format(LogRecord rec){
  return rec.getMessage() + "String_Node_Str";
}
Program: 84089
Project: 84089
Buggy source:
public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  Index index=(Index)o;
  boolean equals=true;
  for (  String column : index.getColumns()) {
    if (!columns.contains(column)) {
      equals=false;
    }
  }
  if (this.unique != index.isUnique()) {
    equals=false;
  }
  return equals || table.getName().equalsIgnoreCase(index.table.getName());
}

Fixed version (ground truth):
public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  Index index=(Index)o;
  boolean equals=true;
  for (  String column : index.getColumns()) {
    if (!columns.contains(column)) {
      equals=false;
    }
  }
  if (!this.unique.equals(index.isUnique())) {
    equals=false;
  }
  return equals || table.getName().equalsIgnoreCase(index.table.getName());
}
Program: 84090
Project: 84090
Buggy source:
public String toString(){
  StringBuffer stringBuffer=new StringBuffer();
  stringBuffer.append(getName());
  if (!this.unique.booleanValue()) {
    stringBuffer.append("String_Node_Str");
  }
  stringBuffer.append("String_Node_Str").append(table.getName()).append("String_Node_Str");
  for (  String column : columns) {
    stringBuffer.append(column).append("String_Node_Str");
  }
  stringBuffer.delete(stringBuffer.length() - 2,stringBuffer.length());
  stringBuffer.append("String_Node_Str");
  return stringBuffer.toString();
}

Fixed version (ground truth):
public String toString(){
  StringBuffer stringBuffer=new StringBuffer();
  stringBuffer.append(getName());
  if (!this.unique) {
    stringBuffer.append("String_Node_Str");
  }
  stringBuffer.append("String_Node_Str").append(table.getName()).append("String_Node_Str");
  for (  String column : columns) {
    stringBuffer.append(column).append("String_Node_Str");
  }
  stringBuffer.delete(stringBuffer.length() - 2,stringBuffer.length());
  stringBuffer.append("String_Node_Str");
  return stringBuffer.toString();
}
Program: 84091
Project: 84091
Buggy source:
public int compareTo(ForeignKey o){
  int returnValue=0;
  if (this.getForeignKeyTable() != null && o.getForeignKeyTable() != null) {
    returnValue=this.getForeignKeyTable().compareTo(o.getForeignKeyTable());
  }
  if (returnValue == 0 && this.getForeignKeyColumns() != null && o.getForeignKeyColumns() != null) {
    returnValue=this.getForeignKeyColumns().compareTo(o.getForeignKeyColumns());
  }
  if (returnValue == 0 && this.getName() != null && o.getName() != null) {
    returnValue=this.getName().compareTo(o.getName());
  }
  if (returnValue == 0 && this.getPrimaryKeyTable() != null && o.getPrimaryKeyTable() != null) {
    returnValue=this.getPrimaryKeyTable().compareTo(o.getPrimaryKeyTable());
  }
  if (returnValue == 0 && this.getPrimaryKeyColumns() != null && o.getPrimaryKeyColumns() != null) {
    returnValue=this.getPrimaryKeyColumns().compareTo(o.getPrimaryKeyColumns());
  }
  if (returnValue == 0 && this.updateRule != null && o.getUpdateRule() != null)   returnValue=this.updateRule.compareTo(o.getUpdateRule());
  if (returnValue == 0 && this.deleteRule != null && o.getDeleteRule() != null)   returnValue=this.deleteRule.compareTo(o.getDeleteRule());
  return returnValue;
}

Fixed version (ground truth):
public int compareTo(ForeignKey o){
  int returnValue=0;
  if (this.getForeignKeyTable() != null && o.getForeignKeyTable() != null) {
    returnValue=this.getForeignKeyTable().compareTo(o.getForeignKeyTable());
  }
  if (returnValue == 0 && this.getForeignKeyColumns() != null && o.getForeignKeyColumns() != null) {
    returnValue=this.getForeignKeyColumns().compareToIgnoreCase(o.getForeignKeyColumns());
  }
  if (returnValue == 0 && this.getName() != null && o.getName() != null) {
    returnValue=this.getName().compareToIgnoreCase(o.getName());
  }
  if (returnValue == 0 && this.getPrimaryKeyTable() != null && o.getPrimaryKeyTable() != null) {
    returnValue=this.getPrimaryKeyTable().compareTo(o.getPrimaryKeyTable());
  }
  if (returnValue == 0 && this.getPrimaryKeyColumns() != null && o.getPrimaryKeyColumns() != null) {
    returnValue=this.getPrimaryKeyColumns().compareToIgnoreCase(o.getPrimaryKeyColumns());
  }
  if (returnValue == 0 && this.updateRule != null && o.getUpdateRule() != null)   returnValue=this.updateRule.compareTo(o.getUpdateRule());
  if (returnValue == 0 && this.deleteRule != null && o.getDeleteRule() != null)   returnValue=this.deleteRule.compareTo(o.getDeleteRule());
  return returnValue;
}
Program: 84092
Project: 84092
Buggy source:
public int hashCode(){
  int result=0;
  if (primaryKeyTable != null) {
    result=primaryKeyTable.hashCode();
  }
  if (this.name != null) {
    result=31 * result + this.name.toUpperCase().hashCode();
  }
  if (primaryKeyColumns != null) {
    result=31 * result + primaryKeyColumns.toUpperCase().hashCode();
  }
  if (foreignKeyTable != null) {
    result=31 * result + foreignKeyTable.hashCode();
  }
  if (foreignKeyColumns != null) {
    result=31 * result + foreignKeyColumns.toUpperCase().hashCode();
  }
  if (this.updateRule != null)   result=31 * result + this.updateRule.hashCode();
  if (this.deleteRule != null)   result=31 * result + this.deleteRule.hashCode();
  return result;
}

Fixed version (ground truth):
public int hashCode(){
  int result=0;
  if (primaryKeyTable != null) {
    result=primaryKeyTable.hashCode();
  }
  if (primaryKeyColumns != null) {
    result=31 * result + primaryKeyColumns.toUpperCase().hashCode();
  }
  if (foreignKeyTable != null) {
    result=31 * result + foreignKeyTable.hashCode();
  }
  if (foreignKeyColumns != null) {
    result=31 * result + foreignKeyColumns.toUpperCase().hashCode();
  }
  if (this.updateRule != null)   result=31 * result + this.updateRule.hashCode();
  if (this.deleteRule != null)   result=31 * result + this.deleteRule.hashCode();
  return result;
}
Program: 84093
Project: 84093
Buggy source:
public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  ForeignKey that=(ForeignKey)o;
  return getForeignKeyColumns().equalsIgnoreCase(that.getForeignKeyColumns()) && foreignKeyTable.equals(that.foreignKeyTable) && this.name.equalsIgnoreCase(that.getName())&& getPrimaryKeyColumns().equalsIgnoreCase(that.getPrimaryKeyColumns())&& primaryKeyTable.equals(that.primaryKeyTable);
}

Fixed version (ground truth):
public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  ForeignKey that=(ForeignKey)o;
  return getForeignKeyColumns().equalsIgnoreCase(that.getForeignKeyColumns()) && foreignKeyTable.equals(that.foreignKeyTable) && getPrimaryKeyColumns().equalsIgnoreCase(that.getPrimaryKeyColumns())&& primaryKeyTable.equals(that.primaryKeyTable);
}
Program: 84094
Project: 84094
Buggy source:
public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  Index index=(Index)o;
  boolean equals=true;
  for (  String column : index.getColumns()) {
    if (!columns.contains(column)) {
      equals=false;
    }
  }
  if (!this.unique.equals(index.isUnique())) {
    equals=false;
  }
  return equals || table.getName().equalsIgnoreCase(index.table.getName());
}

Fixed version (ground truth):
public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  Index index=(Index)o;
  boolean equals=true;
  for (  String column : index.getColumns()) {
    if (!columns.contains(column)) {
      equals=false;
    }
  }
  if (this.unique == null && index.isUnique() != null) {
    equals=false;
  }
 else   if (!this.unique.equals(index.isUnique())) {
    equals=false;
  }
  return equals || table.getName().equalsIgnoreCase(index.table.getName());
}
Program: 84095
Project: 84095
Buggy source:
public int compareTo(Table o){
  return this.getName().compareTo(o.getName());
}

Fixed version (ground truth):
public int compareTo(Table o){
  return this.getName().compareToIgnoreCase(o.getName());
}
Program: 84097
Project: 84097
Buggy source:
protected String getDefaultDatabaseSchemaName() throws JDBCException {
  if (defaultDatabaseSchemaName == null) {
    try {
      List<String> searchPaths=getSearchPaths();
      if (searchPaths != null && searchPaths.size() > 0) {
        for (        String searchPath : searchPaths) {
          if (searchPath != null && searchPath.length() > 0) {
            defaultDatabaseSchemaName=searchPath;
            if (defaultDatabaseSchemaName.equals("String_Node_Str") && getConnectionUsername() != null) {
              if (!schemaExists(getConnectionUsername())) {
                defaultDatabaseSchemaName=null;
              }
            }
            if (defaultDatabaseSchemaName != null)             break;
          }
        }
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
      log.log(Level.SEVERE,"String_Node_Str",e);
    }
  }
  return defaultDatabaseSchemaName;
}

Fixed version (ground truth):
protected String getDefaultDatabaseSchemaName() throws JDBCException {
  if (defaultDatabaseSchemaName == null) {
    try {
      List<String> searchPaths=getSearchPaths();
      if (searchPaths != null && searchPaths.size() > 0) {
        for (        String searchPath : searchPaths) {
          if (searchPath != null && searchPath.length() > 0) {
            defaultDatabaseSchemaName=searchPath;
            if (defaultDatabaseSchemaName.equals("String_Node_Str") && getConnectionUsername() != null) {
              if (!schemaExists(getConnectionUsername())) {
                defaultDatabaseSchemaName=null;
              }
 else {
                defaultDatabaseSchemaName=getConnectionUsername();
              }
            }
            if (defaultDatabaseSchemaName != null)             break;
          }
        }
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
      log.log(Level.SEVERE,"String_Node_Str",e);
    }
  }
  return defaultDatabaseSchemaName;
}
Program: 84098
Project: 84098
Buggy source:
public String getDefaultCatalogName() throws JDBCException {
  if (defaultCatalogName == null) {
    try {
      List<String> searchPaths=getSearchPaths();
      if (searchPaths != null && searchPaths.size() > 0) {
        for (        String searchPath : searchPaths) {
          if (searchPath != null && searchPath.length() > 0) {
            defaultCatalogName=searchPath;
            if (defaultCatalogName.equals("String_Node_Str") && getConnectionUsername() != null) {
              if (!catalogExists(getConnectionUsername())) {
                defaultCatalogName=null;
              }
 else {
                defaultCatalogName=getConnectionUsername();
              }
            }
            if (defaultCatalogName != null)             break;
          }
        }
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
      log.log(Level.SEVERE,"String_Node_Str",e);
    }
    if (defaultCatalogName == null) {
      defaultCatalogName="String_Node_Str";
    }
  }
  return defaultCatalogName;
}

Fixed version (ground truth):
public String getDefaultCatalogName() throws JDBCException {
  return super.getDefaultCatalogName();
}
Program: 84099
Project: 84099
Buggy source:
protected Liquibase createLiquibase() throws Exception {
  FileOpener antFO=new AntFileOpener(getProject(),classpath);
  FileOpener fsFO=new FileSystemFileOpener();
  Database database=createDatabaseObject(getDriver(),getUrl(),getUsername(),getPassword(),getDefaultSchemaName());
  Liquibase liquibase=new Liquibase(getChangeLogFile().trim(),new CompositeFileOpener(antFO,fsFO),database);
  liquibase.setCurrentDateTimeFunction(currentDateTimeFunction);
  return liquibase;
}

Fixed version (ground truth):
protected Liquibase createLiquibase() throws Exception {
  FileOpener antFO=new AntFileOpener(getProject(),classpath);
  FileOpener fsFO=new FileSystemFileOpener();
  Database database=createDatabaseObject(getDriver(),getUrl(),getUsername(),getPassword(),getDefaultSchemaName());
  String changeLogFile=null;
  if (getChangeLogFile() != null) {
    changeLogFile=getChangeLogFile().trim();
  }
  Liquibase liquibase=new Liquibase(changeLogFile,new CompositeFileOpener(antFO,fsFO),database);
  liquibase.setCurrentDateTimeFunction(currentDateTimeFunction);
  return liquibase;
}
Program: 84100
Project: 84100
Buggy source:
public String getColumnType(String columnType,Boolean autoIncrement){
  if (columnType.startsWith("String_Node_Str")) {
    return columnType.replace("String_Node_Str","String_Node_Str");
  }
  String type=super.getColumnType(columnType,autoIncrement);
  if (type.startsWith("String_Node_Str")) {
    return getClobType();
  }
 else   if (type.toLowerCase().startsWith("String_Node_Str")) {
    return "String_Node_Str";
  }
 else   if (type.toLowerCase().startsWith("String_Node_Str")) {
    return "String_Node_Str";
  }
  if (autoIncrement != null && autoIncrement) {
    if ("String_Node_Str".equals(type.toLowerCase())) {
      return "String_Node_Str";
    }
 else     if ("String_Node_Str".equals(type.toLowerCase())) {
      return "String_Node_Str";
    }
 else {
      return "String_Node_Str";
    }
  }
  return type;
}

Fixed version (ground truth):
public String getColumnType(String columnType,Boolean autoIncrement){
  if (columnType.startsWith("String_Node_Str")) {
    return columnType.replace("String_Node_Str","String_Node_Str");
  }
  String type=super.getColumnType(columnType,autoIncrement);
  if (type.startsWith("String_Node_Str")) {
    return getClobType();
  }
 else   if (type.toLowerCase().startsWith("String_Node_Str")) {
    return "String_Node_Str";
  }
 else   if (type.toLowerCase().startsWith("String_Node_Str")) {
    return "String_Node_Str";
  }
  if (autoIncrement != null && autoIncrement) {
    if ("String_Node_Str".equals(type.toLowerCase())) {
      return "String_Node_Str";
    }
 else     if ("String_Node_Str".equals(type.toLowerCase()) || "String_Node_Str".equals(type.toLowerCase())) {
      return "String_Node_Str";
    }
 else {
      return "String_Node_Str";
    }
  }
  return type;
}
Program: 84101
Project: 84101
Buggy source:
public String getViewDefinition(String schemaName,String viewName) throws JDBCException {
  if (schemaName == null) {
    schemaName=convertRequestedSchemaToSchema(schemaName);
  }
  String definition=(String)this.getJdbcTemplate().queryForObject(getViewDefinitionSql(schemaName,viewName),String.class);
  if (definition == null) {
    return null;
  }
  return definition.replaceFirst("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public String getViewDefinition(String schemaName,String viewName) throws JDBCException {
  if (schemaName != null) {
    schemaName=convertRequestedSchemaToSchema(schemaName);
  }
  String definition=(String)this.getJdbcTemplate().queryForObject(getViewDefinitionSql(schemaName,viewName),String.class);
  if (definition == null) {
    return null;
  }
  return definition.replaceFirst("String_Node_Str","String_Node_Str");
}
Program: 84102
Project: 84102
Buggy source:
private void nodeToStringBuffer(Element node,StringBuffer buffer){
  buffer.append("String_Node_Str").append(node.getNodeName());
  SortedMap<String,String> attributeMap=new TreeMap<String,String>();
  NamedNodeMap attributes=node.getAttributes();
  for (int i=0; i < attributes.getLength(); i++) {
    Node attribute=attributes.item(i);
    attributeMap.put(attribute.getNodeName(),attribute.getNodeValue());
  }
  for (  Map.Entry entry : attributeMap.entrySet()) {
    String value=(String)entry.getValue();
    if (value != null) {
      buffer.append("String_Node_Str").append(entry.getKey()).append("String_Node_Str").append(attributeMap.get(value)).append("String_Node_Str");
    }
  }
  buffer.append("String_Node_Str").append(StringUtils.trimToEmpty(XMLUtil.getTextContent(node)));
  NodeList childNodes=node.getChildNodes();
  for (int i=0; i < childNodes.getLength(); i++) {
    Node childNode=childNodes.item(i);
    if (childNode instanceof Element) {
      nodeToStringBuffer(((Element)childNode),buffer);
    }
  }
  buffer.append("String_Node_Str").append(node.getNodeName()).append("String_Node_Str");
}

Fixed version (ground truth):
private void nodeToStringBuffer(Element node,StringBuffer buffer){
  buffer.append("String_Node_Str").append(node.getNodeName());
  SortedMap<String,String> attributeMap=new TreeMap<String,String>();
  NamedNodeMap attributes=node.getAttributes();
  for (int i=0; i < attributes.getLength(); i++) {
    Node attribute=attributes.item(i);
    attributeMap.put(attribute.getNodeName(),attribute.getNodeValue());
  }
  for (  Map.Entry entry : attributeMap.entrySet()) {
    String value=(String)entry.getValue();
    if (value != null) {
      buffer.append("String_Node_Str").append(entry.getKey()).append("String_Node_Str").append(value).append("String_Node_Str");
    }
  }
  buffer.append("String_Node_Str").append(StringUtils.trimToEmpty(XMLUtil.getTextContent(node)));
  NodeList childNodes=node.getChildNodes();
  for (int i=0; i < childNodes.getLength(); i++) {
    Node childNode=childNodes.item(i);
    if (childNode instanceof Element) {
      nodeToStringBuffer(((Element)childNode),buffer);
    }
  }
  buffer.append("String_Node_Str").append(node.getNodeName()).append("String_Node_Str");
}