nus-yam/ex-repair huggingface dataset:
Program: 15974
Project: 15974
Buggy source:
/** 
 * Check whether the map is open.
 * @throws IllegalStateException if the map is closed
 */
protected void checkOpen(){
  if (closed) {
    throw DataUtils.newIllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Check whether the map is open.
 * @throws IllegalStateException if the map is closed
 */
protected void checkOpen(){
  if (closed) {
    throw DataUtils.newIllegalStateException(DataUtils.ERROR_CLOSED,"String_Node_Str");
  }
}
Program: 15975
Project: 15975
Buggy source:
@Override public Value link(DataHandler database,int tabId){
  if (small == null) {
    if (tableId == LobStorageFrontend.TABLE_TEMP) {
      database.getLobStorage().setTable(lobId,tabId);
      this.tableId=tabId;
    }
 else {
      return lobStorage.copyLob(type,lobId,tabId,getPrecision());
    }
  }
 else   if (small.length > handler.getMaxLengthInplaceLob()) {
    LobStorageInterface s=handler.getLobStorage();
    Value v;
    if (type == Value.BLOB) {
      v=s.createBlob(getInputStream(),getPrecision());
    }
 else {
      v=s.createClob(getReader(),getPrecision());
    }
    return v.link(handler,tabId);
  }
  return this;
}

Fixed version (ground truth):
@Override public Value link(DataHandler database,int tabId){
  if (small == null) {
    if (tableId == LobStorageFrontend.TABLE_TEMP) {
      database.getLobStorage().setTable(lobId,tabId);
      this.tableId=tabId;
    }
 else {
      return lobStorage.copyLob(type,lobId,tabId,getPrecision());
    }
  }
 else   if (small.length > database.getMaxLengthInplaceLob()) {
    LobStorageInterface s=database.getLobStorage();
    Value v;
    if (type == Value.BLOB) {
      v=s.createBlob(getInputStream(),getPrecision());
    }
 else {
      v=s.createClob(getReader(),getPrecision());
    }
    return v.link(database,tabId);
  }
  return this;
}
Program: 15976
Project: 15976
Buggy source:
@Override public TempFileDeleter getTempFileDeleter(){
  return TempFileDeleter.getInstance();
}

Fixed version (ground truth):
@Override public TempFileDeleter getTempFileDeleter(){
  if (tempFileDeleter == null) {
    tempFileDeleter=TempFileDeleter.getInstance();
  }
  return tempFileDeleter;
}
Program: 15977
Project: 15977
Buggy source:
private void stop(){
  session.endStatement();
  session.closeTemporaryResults();
  session.setCurrentCommand(null);
  if (!isTransactional()) {
    session.commit(true);
  }
 else   if (session.getAutoCommit()) {
    session.commit(false);
  }
 else   if (session.getDatabase().isMultiThreaded()) {
    Database db=session.getDatabase();
    if (db != null) {
      if (db.getLockMode() == Constants.LOCK_MODE_READ_COMMITTED) {
        session.unlockReadLocks();
      }
    }
  }
  if (trace.isInfoEnabled() && startTime > 0) {
    long time=System.currentTimeMillis() - startTime;
    if (time > Constants.SLOW_QUERY_LIMIT_MS) {
      trace.info("String_Node_Str",time);
    }
  }
}

Fixed version (ground truth):
private void stop(){
  session.endStatement();
  session.setCurrentCommand(null);
  if (!isTransactional()) {
    session.commit(true);
  }
 else   if (session.getAutoCommit()) {
    session.commit(false);
  }
 else   if (session.getDatabase().isMultiThreaded()) {
    Database db=session.getDatabase();
    if (db != null) {
      if (db.getLockMode() == Constants.LOCK_MODE_READ_COMMITTED) {
        session.unlockReadLocks();
      }
    }
  }
  if (trace.isInfoEnabled() && startTime > 0) {
    long time=System.currentTimeMillis() - startTime;
    if (time > Constants.SLOW_QUERY_LIMIT_MS) {
      trace.info("String_Node_Str",time);
    }
  }
}
Program: 15978
Project: 15978
Buggy source:
/** 
 * Close all temporary result set. This also deletes all temporary files held by the result sets.
 */
public void closeTemporaryResults(){
  if (temporaryResults != null) {
    for (    ResultInterface result : temporaryResults) {
      result.close();
    }
    temporaryResults=null;
  }
}

Fixed version (ground truth):
private void closeTemporaryResults(){
  if (temporaryResults != null) {
    for (    ResultInterface result : temporaryResults) {
      result.close();
    }
    temporaryResults=null;
  }
}
Program: 15979
Project: 15979
Buggy source:
public Savepoint setSavepoint(){
  Savepoint sp=new Savepoint();
  sp.logIndex=undoLog.size();
  if (database.getMvStore() != null) {
    sp.transactionSavepoint=getStatementSavepoint();
  }
  return sp;
}

Fixed version (ground truth):
/** 
 * Create a savepoint to allow rolling back to this state.
 * @return the savepoint
 */
public Savepoint setSavepoint(){
  Savepoint sp=new Savepoint();
  sp.logIndex=undoLog.size();
  if (database.getMvStore() != null) {
    sp.transactionSavepoint=getStatementSavepoint();
  }
  return sp;
}
Program: 15980
Project: 15980
Buggy source:
public void endStatement(){
  startStatement=-1;
}

Fixed version (ground truth):
/** 
 * Mark the statement as completed. This also close all temporary result set, and deletes all temporary files held by the result sets.
 */
public void endStatement(){
  startStatement=-1;
  closeTemporaryResults();
}
Program: 15981
Project: 15981
Buggy source:
/** 
 * Add an additional element if possible. Example: given two conditions A IN(1, 2) OR A=3, the constant 3 is added: A IN(1, 2, 3).
 * @param other the second condition
 * @return null if the condition was not added, or the new condition
 */
Expression getAdditional(Session session,Comparison other){
  Expression add=other.getIfEquals(left);
  if (add != null) {
    if (add.isConstant()) {
      valueList.add(add);
      valueSet.add(add.getValue(session).convertTo(left.getType()));
      return this;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Add an additional element if possible. Example: given two conditions A IN(1, 2) OR A=3, the constant 3 is added: A IN(1, 2, 3).
 * @param session the session
 * @param other the second condition
 * @return null if the condition was not added, or the new condition
 */
Expression getAdditional(Session session,Comparison other){
  Expression add=other.getIfEquals(left);
  if (add != null) {
    if (add.isConstant()) {
      valueList.add(add);
      valueSet.add(add.getValue(session).convertTo(left.getType()));
      return this;
    }
  }
  return null;
}
Program: 15982
Project: 15982
Buggy source:
public void closeImmediately(){
  if (store.isClosed()) {
    return;
  }
  FileChannel f=store.getFile();
  if (f != null) {
    try {
      f.close();
    }
 catch (    IOException e) {
      throw DbException.convertIOException(e,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Close the store, without persisting changes.
 */
public void closeImmediately(){
  if (store.isClosed()) {
    return;
  }
  FileChannel f=store.getFile();
  if (f != null) {
    try {
      f.close();
    }
 catch (    IOException e) {
      throw DbException.convertIOException(e,"String_Node_Str");
    }
  }
}
Program: 15983
Project: 15983
Buggy source:
public void store(){
  if (!store.isReadOnly()) {
    store.commit();
    store.compact(50);
    store.store();
  }
}

Fixed version (ground truth):
/** 
 * Store all pending changes.
 */
public void store(){
  if (!store.isReadOnly()) {
    store.commit();
    store.compact(50);
    store.store();
  }
}
Program: 15984
Project: 15984
Buggy source:
public void close(){
  if (!store.isReadOnly()) {
    store.store();
  }
  store.close();
}

Fixed version (ground truth):
/** 
 * Close the store. Pending changes are persisted.
 */
public void close(){
  if (!store.isReadOnly()) {
    store.store();
  }
  store.close();
}
Program: 15985
Project: 15985
Buggy source:
boolean isTransactionOpen(long transactionId){
  if (transactionId < firstOpenTransaction) {
    return false;
  }
  if (firstOpenTransaction == -1) {
    if (undoLog.size() == 0) {
      return false;
    }
    long[] key=undoLog.firstKey();
    firstOpenTransaction=key[0];
  }
  if (firstOpenTransaction == transactionId) {
    return true;
  }
  long[] key={transactionId,-1};
  key=undoLog.higherKey(key);
  return key != null && key[0] == transactionId;
}

Fixed version (ground truth):
/** 
 * Check whether the given transaction id is still open and contains log entries.
 * @param transactionId the transaction id
 * @return true if it is open
 */
boolean isTransactionOpen(long transactionId){
  if (transactionId < firstOpenTransaction) {
    return false;
  }
  if (firstOpenTransaction == -1) {
    if (undoLog.size() == 0) {
      return false;
    }
    long[] key=undoLog.firstKey();
    firstOpenTransaction=key[0];
  }
  if (firstOpenTransaction == transactionId) {
    return true;
  }
  long[] key={transactionId,-1};
  key=undoLog.higherKey(key);
  return key != null && key[0] == transactionId;
}
Program: 15986
Project: 15986
Buggy source:
void endTransaction(Transaction t){
  if (t.getStatus() == Transaction.STATUS_PREPARED) {
    preparedTransactions.remove(t.getId());
  }
  t.setStatus(Transaction.STATUS_CLOSED);
  if (t.getId() == firstOpenTransaction) {
    firstOpenTransaction=-1;
  }
}

Fixed version (ground truth):
/** 
 * End this transaction
 * @param t the transaction
 */
void endTransaction(Transaction t){
  if (t.getStatus() == Transaction.STATUS_PREPARED) {
    preparedTransactions.remove(t.getId());
  }
  t.setStatus(Transaction.STATUS_CLOSED);
  if (t.getId() == firstOpenTransaction) {
    firstOpenTransaction=-1;
  }
}
Program: 15987
Project: 15987
Buggy source:
/** 
 * Set the table reference of this lob.
 * @param lobId the lob
 * @param table the table
 */
void setTable(long lobId,int tableIdSessionVariable);

Fixed version (ground truth):
/** 
 * Set the table reference of this lob.
 * @param lobId the lob
 * @param table the table
 */
void setTable(long lobId,int table);
Program: 15988
Project: 15988
Buggy source:
/** 
 * Create a LOB value with the given parameters.
 * @param type the data type
 * @param handler the file handler
 * @param tableId the table object id
 * @param objectId the object id
 * @param precision the precision (length in elements)
 * @param compression if compression is used
 * @return the value object
 */
public static ValueLob openUnlinked(int type,DataHandler handler,int tableId,int objectId,long precision,boolean compression,String fileName){
  return new ValueLob(type,handler,fileName,tableId,objectId,false,precision,compression);
}

Fixed version (ground truth):
/** 
 * Create a LOB value with the given parameters.
 * @param type the data type
 * @param handler the file handler
 * @param tableId the table object id
 * @param objectId the object id
 * @param precision the precision (length in elements)
 * @param compression if compression is used
 * @param fileName the file name
 * @return the value object
 */
public static ValueLob openUnlinked(int type,DataHandler handler,int tableId,int objectId,long precision,boolean compression,String fileName){
  return new ValueLob(type,handler,fileName,tableId,objectId,false,precision,compression);
}
Program: 15989
Project: 15989
Buggy source:
public static String getFileNamePrefix(String path,int objectId){
  String name;
  int f=objectId % SysProperties.LOB_FILES_PER_DIRECTORY;
  if (f > 0) {
    name=SysProperties.FILE_SEPARATOR + objectId;
  }
 else {
    name="String_Node_Str";
  }
  objectId/=SysProperties.LOB_FILES_PER_DIRECTORY;
  while (objectId > 0) {
    f=objectId % SysProperties.LOB_FILES_PER_DIRECTORY;
    name=SysProperties.FILE_SEPARATOR + f + Constants.SUFFIX_LOBS_DIRECTORY+ name;
    objectId/=SysProperties.LOB_FILES_PER_DIRECTORY;
  }
  name=FileUtils.toRealPath(path + Constants.SUFFIX_LOBS_DIRECTORY + name);
  return name;
}

Fixed version (ground truth):
private static String getFileNamePrefix(String path,int objectId){
  String name;
  int f=objectId % SysProperties.LOB_FILES_PER_DIRECTORY;
  if (f > 0) {
    name=SysProperties.FILE_SEPARATOR + objectId;
  }
 else {
    name="String_Node_Str";
  }
  objectId/=SysProperties.LOB_FILES_PER_DIRECTORY;
  while (objectId > 0) {
    f=objectId % SysProperties.LOB_FILES_PER_DIRECTORY;
    name=SysProperties.FILE_SEPARATOR + f + Constants.SUFFIX_LOBS_DIRECTORY+ name;
    objectId/=SysProperties.LOB_FILES_PER_DIRECTORY;
  }
  name=FileUtils.toRealPath(path + Constants.SUFFIX_LOBS_DIRECTORY + name);
  return name;
}
Program: 15990
Project: 15990
Buggy source:
public static synchronized void deleteFile(DataHandler handler,String fileName){
synchronized (handler.getLobSyncObject()) {
    FileUtils.delete(fileName);
  }
}

Fixed version (ground truth):
private static synchronized void deleteFile(DataHandler handler,String fileName){
synchronized (handler.getLobSyncObject()) {
    FileUtils.delete(fileName);
  }
}
Program: 15991
Project: 15991
Buggy source:
public void unlink(){
  if (linked && fileName != null) {
    String temp;
synchronized (handler) {
      temp=getFileName(handler,-1,objectId);
      deleteFile(handler,temp);
      renameFile(handler,fileName,temp);
      tempFile=FileStore.open(handler,temp,"String_Node_Str");
      tempFile.autoDelete();
      tempFile.closeSilently();
      fileName=temp;
      linked=false;
    }
  }
}

Fixed version (ground truth):
@Override public void unlink(DataHandler handler){
  if (linked && fileName != null) {
    String temp;
synchronized (handler) {
      temp=getFileName(handler,-1,objectId);
      deleteFile(handler,temp);
      renameFile(handler,fileName,temp);
      tempFile=FileStore.open(handler,temp,"String_Node_Str");
      tempFile.autoDelete();
      tempFile.closeSilently();
      fileName=temp;
      linked=false;
    }
  }
}
Program: 15995
Project: 15995
Buggy source:
private void testTruncateReconnect() throws SQLException {
  if (config.memory) {
    return;
  }
  deleteDb("String_Node_Str");
  Connection conn;
  conn=getConnection("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn=getConnection("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn=getConnection("String_Node_Str");
  conn.close();
}

Fixed version (ground truth):
private void testTruncateReconnect() throws SQLException {
  if (config.memory) {
    return;
  }
  deleteDb("String_Node_Str");
  Connection conn;
  conn=getConnection("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  JdbcUtils.closeSilently(conn);
  conn=getConnection("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  JdbcUtils.closeSilently(conn);
  conn=getConnection("String_Node_Str");
  conn.close();
}
Program: 15996
Project: 15996
Buggy source:
private void testUpdateOverflow() throws SQLException {
  if (config.memory) {
    return;
  }
  deleteDb("String_Node_Str");
  Connection conn;
  conn=getConnection("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn=getConnection("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn=getConnection("String_Node_Str");
  conn.close();
}

Fixed version (ground truth):
private void testUpdateOverflow() throws SQLException {
  if (config.memory) {
    return;
  }
  deleteDb("String_Node_Str");
  Connection conn;
  conn=getConnection("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  JdbcUtils.closeSilently(conn);
  conn=getConnection("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  conn.createStatement().execute("String_Node_Str");
  JdbcUtils.closeSilently(conn);
  conn=getConnection("String_Node_Str");
  conn.close();
}
Program: 15997
Project: 15997
Buggy source:
private void testRecoverLobInDatabase() throws SQLException {
  deleteDb("String_Node_Str");
  String url=getURL("String_Node_Str",true);
  Connection conn;
  Statement stat;
  conn=getConnection(url,getUser(),getPassword());
  stat=conn.createStatement();
  stat.execute("String_Node_Str");
  stat.execute("String_Node_Str");
  stat.execute("String_Node_Str");
  Connection conn2;
  Statement stat2;
  Random r=new Random(1);
  ArrayList<Connection> list=New.arrayList();
  for (int i=0; i < 10; i++) {
    conn2=getConnection(url,getUser(),getPassword());
    list.add(conn2);
    stat2=conn.createStatement();
    conn2.setAutoCommit(false);
    if (r.nextBoolean()) {
      stat2.execute("String_Node_Str" + r.nextInt(100));
    }
 else {
      stat2.execute("String_Node_Str" + r.nextInt(100));
    }
  }
  stat.execute("String_Node_Str");
  try {
    conn.close();
  }
 catch (  SQLException e) {
  }
  conn=getConnection(url,getUser(),getPassword());
  conn.close();
}

Fixed version (ground truth):
private void testRecoverLobInDatabase() throws SQLException {
  deleteDb("String_Node_Str");
  String url=getURL("String_Node_Str",true);
  Connection conn;
  Statement stat;
  conn=getConnection(url,getUser(),getPassword());
  stat=conn.createStatement();
  stat.execute("String_Node_Str");
  stat.execute("String_Node_Str");
  stat.execute("String_Node_Str");
  Random r=new Random(1);
  ArrayList<Connection> list=New.arrayList();
  for (int i=0; i < 10; i++) {
    Connection conn2=getConnection(url,getUser(),getPassword());
    list.add(conn2);
    Statement stat2=conn2.createStatement();
    conn2.setAutoCommit(false);
    if (r.nextBoolean()) {
      stat2.execute("String_Node_Str" + r.nextInt(100));
    }
 else {
      stat2.execute("String_Node_Str" + r.nextInt(100));
    }
  }
  stat.execute("String_Node_Str");
  JdbcUtils.closeSilently(conn);
  for (  Connection c : list) {
    JdbcUtils.closeSilently(c);
  }
  conn=getConnection(url,getUser(),getPassword());
  conn.close();
}
Program: 15998
Project: 15998
Buggy source:
/** 
 * Returns whether this result set has been closed.
 * @return true if the result set was closed
 */
public boolean isClosed(){
  return rows == null;
}

Fixed version (ground truth):
/** 
 * Returns whether this result set has been closed.
 * @return true if the result set was closed
 */
public boolean isClosed(){
  return rows == null && source == null;
}
Program: 15999
Project: 15999
Buggy source:
/** 
 * Remove a map.
 * @param name the map name
 */
void removeMap(String name){
  MVMap<?,?> m=maps.remove(name);
  mapsChanged.remove(m);
}

Fixed version (ground truth):
/** 
 * Remove a map.
 * @param name the map name
 */
void removeMap(String name){
  MVMap<?,?> map=maps.remove(name);
  mapsChanged.remove(map.getId());
}
Program: 16001
Project: 16001
Buggy source:
public InputStream newInputStream() throws IOException {
  if (name.indexOf(':') > 1) {
    if (name.startsWith(CLASSPATH_PREFIX)) {
      String fileName=name.substring(CLASSPATH_PREFIX.length());
      if (!fileName.startsWith("String_Node_Str")) {
        fileName="String_Node_Str" + fileName;
      }
      InputStream in=getClass().getResourceAsStream(fileName);
      if (in == null) {
        Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);
      }
      if (in == null) {
        throw new FileNotFoundException("String_Node_Str" + fileName);
      }
      return in;
    }
    URL url=new URL(name);
    InputStream in=url.openStream();
    return in;
  }
  FileInputStream in=new FileInputStream(name);
  IOUtils.trace("String_Node_Str",name,in);
  return in;
}

Fixed version (ground truth):
public InputStream newInputStream() throws IOException {
  if (name.indexOf(':') > 1) {
    if (name.startsWith(CLASSPATH_PREFIX)) {
      String fileName=name.substring(CLASSPATH_PREFIX.length());
      if (!fileName.startsWith("String_Node_Str")) {
        fileName="String_Node_Str" + fileName;
      }
      InputStream in=getClass().getResourceAsStream(fileName);
      if (in == null) {
        in=Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);
      }
      if (in == null) {
        throw new FileNotFoundException("String_Node_Str" + fileName);
      }
      return in;
    }
    URL url=new URL(name);
    InputStream in=url.openStream();
    return in;
  }
  FileInputStream in=new FileInputStream(name);
  IOUtils.trace("String_Node_Str",name,in);
  return in;
}
Program: 16003
Project: 16003
Buggy source:
public String getPlanSQL(){
  StringBuilder buff=new StringBuilder();
  buff.append("String_Node_Str");
  buff.append("String_Node_Str").append(tableFilter.getPlanSQL(false));
  if (condition != null) {
    buff.append("String_Node_Str").append(StringUtils.unEnclose(condition.getSQL()));
  }
  if (limitExpr != null) {
    buff.append("String_Node_Str").append(StringUtils.unEnclose(limitExpr.getSQL())).append("String_Node_Str");
  }
  return buff.toString();
}

Fixed version (ground truth):
public String getPlanSQL(){
  StringBuilder buff=new StringBuilder();
  buff.append("String_Node_Str");
  buff.append("String_Node_Str").append(tableFilter.getPlanSQL(false));
  if (condition != null) {
    buff.append("String_Node_Str").append(StringUtils.unEnclose(condition.getSQL()));
  }
  if (limitExpr != null) {
    buff.append("String_Node_Str").append(StringUtils.unEnclose(limitExpr.getSQL())).append(')');
  }
  return buff.toString();
}
Program: 16004
Project: 16004
Buggy source:
public String getPlanSQL(){
  StatementBuilder buff=new StatementBuilder("String_Node_Str");
  buff.append(table.getSQL()).append('(');
  for (  Column c : columns) {
    buff.appendExceptFirst("String_Node_Str");
    buff.append(c.getSQL());
  }
  buff.append("String_Node_Str");
  if (insertFromSelect) {
    buff.append("String_Node_Str");
  }
  if (sortedInsertMode) {
    buff.append("String_Node_Str");
  }
  if (list.size() > 0) {
    buff.append("String_Node_Str");
    int row=0;
    if (list.size() > 1) {
      buff.append("String_Node_Str");
    }
    for (    Expression[] expr : list) {
      if (row++ > 0) {
        buff.append("String_Node_Str");
      }
      buff.append('(');
      buff.resetCount();
      for (      Expression e : expr) {
        buff.appendExceptFirst("String_Node_Str");
        if (e == null) {
          buff.append("String_Node_Str");
        }
 else {
          buff.append(e.getSQL());
        }
      }
      buff.append(')');
    }
  }
 else {
    buff.append(query.getPlanSQL());
  }
  return buff.toString();
}

Fixed version (ground truth):
public String getPlanSQL(){
  StatementBuilder buff=new StatementBuilder("String_Node_Str");
  buff.append(table.getSQL()).append('(');
  for (  Column c : columns) {
    buff.appendExceptFirst("String_Node_Str");
    buff.append(c.getSQL());
  }
  buff.append("String_Node_Str");
  if (insertFromSelect) {
    buff.append("String_Node_Str");
  }
  if (sortedInsertMode) {
    buff.append("String_Node_Str");
  }
  if (list.size() > 0) {
    buff.append("String_Node_Str");
    int row=0;
    if (list.size() > 1) {
      buff.append('\n');
    }
    for (    Expression[] expr : list) {
      if (row++ > 0) {
        buff.append("String_Node_Str");
      }
      buff.append('(');
      buff.resetCount();
      for (      Expression e : expr) {
        buff.appendExceptFirst("String_Node_Str");
        if (e == null) {
          buff.append("String_Node_Str");
        }
 else {
          buff.append(e.getSQL());
        }
      }
      buff.append(')');
    }
  }
 else {
    buff.append(query.getPlanSQL());
  }
  return buff.toString();
}
Program: 16006
Project: 16006
Buggy source:
private static void createOrDropTrigger(Connection conn,String schema,String table,boolean create) throws SQLException {
  Statement stat=conn.createStatement();
  String trigger=StringUtils.quoteIdentifier(schema) + "String_Node_Str" + StringUtils.quoteIdentifier(TRIGGER_PREFIX + table);
  stat.execute("String_Node_Str" + trigger);
  if (create) {
    StringBuilder buff=new StringBuilder("String_Node_Str");
    buff.append(trigger).append("String_Node_Str").append(StringUtils.quoteIdentifier(schema)).append('.').append(StringUtils.quoteIdentifier(table)).append("String_Node_Str").append(FullText.FullTextTrigger.class.getName()).append("String_Node_Str");
    stat.execute(buff.toString());
  }
}

Fixed version (ground truth):
private static void createOrDropTrigger(Connection conn,String schema,String table,boolean create) throws SQLException {
  Statement stat=conn.createStatement();
  String trigger=StringUtils.quoteIdentifier(schema) + "String_Node_Str" + StringUtils.quoteIdentifier(TRIGGER_PREFIX + table);
  stat.execute("String_Node_Str" + trigger);
  if (create) {
    StringBuilder buff=new StringBuilder("String_Node_Str");
    buff.append(trigger).append("String_Node_Str").append(StringUtils.quoteIdentifier(schema)).append('.').append(StringUtils.quoteIdentifier(table)).append("String_Node_Str").append(FullText.FullTextTrigger.class.getName()).append('\"');
    stat.execute(buff.toString());
  }
}
Program: 16007
Project: 16007
Buggy source:
/** 
 * Create the trigger.
 * @param conn the database connection
 * @param schema the schema name
 * @param table the table name
 */
protected static void createTrigger(Connection conn,String schema,String table) throws SQLException {
  Statement stat=conn.createStatement();
  String trigger=StringUtils.quoteIdentifier(schema) + "String_Node_Str" + StringUtils.quoteIdentifier(TRIGGER_PREFIX + table);
  stat.execute("String_Node_Str" + trigger);
  StringBuilder buff=new StringBuilder("String_Node_Str");
  buff.append(trigger).append("String_Node_Str").append(StringUtils.quoteIdentifier(schema)).append('.').append(StringUtils.quoteIdentifier(table)).append("String_Node_Str").append(FullTextLucene.FullTextTrigger.class.getName()).append("String_Node_Str");
  stat.execute(buff.toString());
}

Fixed version (ground truth):
/** 
 * Create the trigger.
 * @param conn the database connection
 * @param schema the schema name
 * @param table the table name
 */
protected static void createTrigger(Connection conn,String schema,String table) throws SQLException {
  Statement stat=conn.createStatement();
  String trigger=StringUtils.quoteIdentifier(schema) + "String_Node_Str" + StringUtils.quoteIdentifier(TRIGGER_PREFIX + table);
  stat.execute("String_Node_Str" + trigger);
  StringBuilder buff=new StringBuilder("String_Node_Str");
  buff.append(trigger).append("String_Node_Str").append(StringUtils.quoteIdentifier(schema)).append('.').append(StringUtils.quoteIdentifier(table)).append("String_Node_Str").append(FullTextLucene.FullTextTrigger.class.getName()).append('\"');
  stat.execute(buff.toString());
}
Program: 16009
Project: 16009
Buggy source:
public void listen(){
  listenerThread=Thread.currentThread();
  String threadName=listenerThread.getName();
  try {
    while (!stop) {
      Socket s=serverSocket.accept();
      TcpServerThread c=new TcpServerThread(s,this,nextThreadId++);
      running.add(c);
      Thread thread=new Thread(c);
      thread.setDaemon(isDaemon);
      thread.setName(threadName + "String_Node_Str");
      c.setThread(thread);
      thread.start();
    }
    serverSocket=NetUtils.closeSilently(serverSocket);
  }
 catch (  Exception e) {
    if (!stop) {
      TraceSystem.traceThrowable(e);
    }
  }
  stopManagementDb();
}

Fixed version (ground truth):
public void listen(){
  listenerThread=Thread.currentThread();
  String threadName=listenerThread.getName();
  try {
    while (!stop) {
      Socket s=serverSocket.accept();
      TcpServerThread c=new TcpServerThread(s,this,nextThreadId++);
      running.add(c);
      Thread thread=new Thread(c,threadName + "String_Node_Str");
      thread.setDaemon(isDaemon);
      c.setThread(thread);
      thread.start();
    }
    serverSocket=NetUtils.closeSilently(serverSocket);
  }
 catch (  Exception e) {
    if (!stop) {
      TraceSystem.traceThrowable(e);
    }
  }
  stopManagementDb();
}
Program: 16010
Project: 16010
Buggy source:
public void listen(){
  String threadName=Thread.currentThread().getName();
  try {
    while (!stop) {
      Socket s=serverSocket.accept();
      if (!allow(s)) {
        trace("String_Node_Str");
        s.close();
      }
 else {
        PgServerThread c=new PgServerThread(s,this);
        running.add(c);
        c.setProcessId(running.size());
        Thread thread=new Thread(c);
        thread.setDaemon(isDaemon);
        thread.setName(threadName + "String_Node_Str");
        c.setThread(thread);
        thread.start();
      }
    }
  }
 catch (  Exception e) {
    if (!stop) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void listen(){
  String threadName=Thread.currentThread().getName();
  try {
    while (!stop) {
      Socket s=serverSocket.accept();
      if (!allow(s)) {
        trace("String_Node_Str");
        s.close();
      }
 else {
        PgServerThread c=new PgServerThread(s,this);
        running.add(c);
        c.setProcessId(running.size());
        Thread thread=new Thread(c,threadName + "String_Node_Str");
        thread.setDaemon(isDaemon);
        c.setThread(thread);
        thread.start();
      }
    }
  }
 catch (  Exception e) {
    if (!stop) {
      e.printStackTrace();
    }
  }
}
Program: 16011
Project: 16011
Buggy source:
private static String getComboBox(String[][] elements,String selected){
  StringBuilder buff=new StringBuilder();
  for (  String[] n : elements) {
    buff.append("String_Node_Str").append(PageParser.escapeHtmlData(n[0])).append("String_Node_Str");
    if (n[0].equals(selected)) {
      buff.append("String_Node_Str");
    }
    buff.append('>').append(PageParser.escapeHtml(n[1])).append("String_Node_Str");
  }
  return buff.toString();
}

Fixed version (ground truth):
private static String getComboBox(String[][] elements,String selected){
  StringBuilder buff=new StringBuilder();
  for (  String[] n : elements) {
    buff.append("String_Node_Str").append(PageParser.escapeHtmlData(n[0])).append('\"');
    if (n[0].equals(selected)) {
      buff.append("String_Node_Str");
    }
    buff.append('>').append(PageParser.escapeHtml(n[1])).append("String_Node_Str");
  }
  return buff.toString();
}
Program: 16012
Project: 16012
Buggy source:
private void lockFile(){
  method=FILE;
  properties=new SortedProperties();
  properties.setProperty("String_Node_Str",String.valueOf(method));
  setUniqueId();
  fs.createDirs(fileName);
  if (!fs.createNewFile(fileName)) {
    waitUntilOld();
    String m2=load().getProperty("String_Node_Str",FILE);
    if (!m2.equals(FILE)) {
      throw getExceptionFatal("String_Node_Str" + m2,null);
    }
    save();
    sleep(2 * sleep);
    if (!load().equals(properties)) {
      throw getExceptionAlreadyInUse("String_Node_Str");
    }
    fs.delete(fileName);
    if (!fs.createNewFile(fileName)) {
      throw getExceptionFatal("String_Node_Str",null);
    }
  }
  save();
  sleep(SLEEP_GAP);
  if (!load().equals(properties)) {
    fileName=null;
    throw getExceptionFatal("String_Node_Str",null);
  }
  watchdog=new Thread(this);
  watchdog.setName("String_Node_Str" + fileName);
  watchdog.setDaemon(true);
  watchdog.setPriority(Thread.MAX_PRIORITY - 1);
  watchdog.start();
}

Fixed version (ground truth):
private void lockFile(){
  method=FILE;
  properties=new SortedProperties();
  properties.setProperty("String_Node_Str",String.valueOf(method));
  setUniqueId();
  fs.createDirs(fileName);
  if (!fs.createNewFile(fileName)) {
    waitUntilOld();
    String m2=load().getProperty("String_Node_Str",FILE);
    if (!m2.equals(FILE)) {
      throw getExceptionFatal("String_Node_Str" + m2,null);
    }
    save();
    sleep(2 * sleep);
    if (!load().equals(properties)) {
      throw getExceptionAlreadyInUse("String_Node_Str");
    }
    fs.delete(fileName);
    if (!fs.createNewFile(fileName)) {
      throw getExceptionFatal("String_Node_Str",null);
    }
  }
  save();
  sleep(SLEEP_GAP);
  if (!load().equals(properties)) {
    fileName=null;
    throw getExceptionFatal("String_Node_Str",null);
  }
  watchdog=new Thread(this,"String_Node_Str" + fileName);
  watchdog.setDaemon(true);
  watchdog.setPriority(Thread.MAX_PRIORITY - 1);
  watchdog.start();
}
Program: 16014
Project: 16014
Buggy source:
/** 
 * Create and start a new writer thread for the given database. If the thread can't be created, this method returns null.
 * @param database the database
 * @param writeDelay the delay
 * @return the writer thread object or null
 */
public static WriterThread create(Database database,int writeDelay){
  try {
    WriterThread writer=new WriterThread(database,writeDelay);
    writer.thread=new Thread(writer);
    writer.thread.setName("String_Node_Str" + database.getShortName());
    writer.thread.setDaemon(true);
    return writer;
  }
 catch (  AccessControlException e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Create and start a new writer thread for the given database. If the thread can't be created, this method returns null.
 * @param database the database
 * @param writeDelay the delay
 * @return the writer thread object or null
 */
public static WriterThread create(Database database,int writeDelay){
  try {
    WriterThread writer=new WriterThread(database,writeDelay);
    writer.thread=new Thread(writer,"String_Node_Str" + database.getShortName());
    writer.thread.setDaemon(true);
    return writer;
  }
 catch (  AccessControlException e) {
    return null;
  }
}
Program: 16015
Project: 16015
Buggy source:
public String getCreateSQL(){
  StatementBuilder buff=new StatementBuilder("String_Node_Str");
  if (isTemporary()) {
    if (isGlobalTemporary()) {
      buff.append("String_Node_Str");
    }
 else {
      buff.append("String_Node_Str");
    }
    buff.append("String_Node_Str");
  }
 else   if (isPersistIndexes()) {
    buff.append("String_Node_Str");
  }
 else {
    buff.append("String_Node_Str");
  }
  buff.append("String_Node_Str");
  if (isHidden) {
    buff.append("String_Node_Str");
  }
  buff.append(getSQL());
  if (comment != null) {
    buff.append("String_Node_Str").append(StringUtils.quoteStringSQL(comment));
  }
  buff.append("String_Node_Str");
  for (  Column column : columns) {
    buff.appendExceptFirst("String_Node_Str");
    buff.append(column.getCreateSQL());
  }
  buff.append("String_Node_Str");
  if (tableEngine != null) {
    buff.append("String_Node_Str");
    buff.append(tableEngine);
    buff.append("String_Node_Str");
  }
  if (!isPersistIndexes() && !isPersistData()) {
    buff.append("String_Node_Str");
  }
  if (isHidden) {
    buff.append("String_Node_Str");
  }
  return buff.toString();
}

Fixed version (ground truth):
public String getCreateSQL(){
  StatementBuilder buff=new StatementBuilder("String_Node_Str");
  if (isTemporary()) {
    if (isGlobalTemporary()) {
      buff.append("String_Node_Str");
    }
 else {
      buff.append("String_Node_Str");
    }
    buff.append("String_Node_Str");
  }
 else   if (isPersistIndexes()) {
    buff.append("String_Node_Str");
  }
 else {
    buff.append("String_Node_Str");
  }
  buff.append("String_Node_Str");
  if (isHidden) {
    buff.append("String_Node_Str");
  }
  buff.append(getSQL());
  if (comment != null) {
    buff.append("String_Node_Str").append(StringUtils.quoteStringSQL(comment));
  }
  buff.append("String_Node_Str");
  for (  Column column : columns) {
    buff.appendExceptFirst("String_Node_Str");
    buff.append(column.getCreateSQL());
  }
  buff.append("String_Node_Str");
  if (tableEngine != null) {
    buff.append("String_Node_Str");
    buff.append(tableEngine);
    buff.append('\"');
  }
  if (!isPersistIndexes() && !isPersistData()) {
    buff.append("String_Node_Str");
  }
  if (isHidden) {
    buff.append("String_Node_Str");
  }
  return buff.toString();
}
Program: 16018
Project: 16018
Buggy source:
private String readPassword() throws IOException {
  try {
    Object console=Utils.callStaticMethod("String_Node_Str");
    print("String_Node_Str");
    char[] password=(char[])Utils.callMethod(console,"String_Node_Str");
    return password == null ? null : new String(password);
  }
 catch (  Exception e) {
  }
  Thread passwordHider=new Thread(this);
  stopHide=false;
  passwordHider.start();
  print("String_Node_Str");
  String p=readLine();
  stopHide=true;
  try {
    passwordHider.join();
  }
 catch (  InterruptedException e) {
  }
  print("String_Node_Str");
  return p;
}

Fixed version (ground truth):
private String readPassword() throws IOException {
  try {
    Object console=Utils.callStaticMethod("String_Node_Str");
    print("String_Node_Str");
    char[] password=(char[])Utils.callMethod(console,"String_Node_Str");
    return password == null ? null : new String(password);
  }
 catch (  Exception e) {
  }
  Thread passwordHider=new Thread(this,"String_Node_Str");
  stopHide=false;
  passwordHider.start();
  print("String_Node_Str");
  String p=readLine();
  stopHide=true;
  try {
    passwordHider.join();
  }
 catch (  InterruptedException e) {
  }
  print("String_Node_Str");
  return p;
}
Program: 16019
Project: 16019
Buggy source:
private static synchronized SecureRandom getSecureRandom(){
  if (cachedSecureRandom != null) {
    return cachedSecureRandom;
  }
  try {
    cachedSecureRandom=SecureRandom.getInstance("String_Node_Str");
    Runnable runnable=new Runnable(){
      public void run(){
        try {
          SecureRandom sr=SecureRandom.getInstance("String_Node_Str");
          byte[] seed=sr.generateSeed(20);
synchronized (cachedSecureRandom) {
            cachedSecureRandom.setSeed(seed);
            seeded=true;
          }
        }
 catch (        Exception e) {
          warn("String_Node_Str",e);
        }
      }
    }
;
    try {
      Thread t=new Thread(runnable);
      t.setDaemon(true);
      t.start();
      Thread.yield();
      try {
        t.join(400);
      }
 catch (      InterruptedException e) {
        warn("String_Node_Str",e);
      }
      if (!seeded) {
        byte[] seed=generateAlternativeSeed();
synchronized (cachedSecureRandom) {
          cachedSecureRandom.setSeed(seed);
        }
      }
    }
 catch (    SecurityException e) {
      runnable.run();
      generateAlternativeSeed();
    }
  }
 catch (  Exception e) {
    warn("String_Node_Str",e);
    cachedSecureRandom=new SecureRandom();
  }
  return cachedSecureRandom;
}

Fixed version (ground truth):
private static synchronized SecureRandom getSecureRandom(){
  if (cachedSecureRandom != null) {
    return cachedSecureRandom;
  }
  try {
    cachedSecureRandom=SecureRandom.getInstance("String_Node_Str");
    Runnable runnable=new Runnable(){
      public void run(){
        try {
          SecureRandom sr=SecureRandom.getInstance("String_Node_Str");
          byte[] seed=sr.generateSeed(20);
synchronized (cachedSecureRandom) {
            cachedSecureRandom.setSeed(seed);
            seeded=true;
          }
        }
 catch (        Exception e) {
          warn("String_Node_Str",e);
        }
      }
    }
;
    try {
      Thread t=new Thread(runnable,"String_Node_Str");
      t.setDaemon(true);
      t.start();
      Thread.yield();
      try {
        t.join(400);
      }
 catch (      InterruptedException e) {
        warn("String_Node_Str",e);
      }
      if (!seeded) {
        byte[] seed=generateAlternativeSeed();
synchronized (cachedSecureRandom) {
          cachedSecureRandom.setSeed(seed);
        }
      }
    }
 catch (    SecurityException e) {
      runnable.run();
      generateAlternativeSeed();
    }
  }
 catch (  Exception e) {
    warn("String_Node_Str",e);
    cachedSecureRandom=new SecureRandom();
  }
  return cachedSecureRandom;
}
Program: 16020
Project: 16020
Buggy source:
/** 
 * Start collecting profiling data.
 */
public void startCollecting(){
  thread=new Thread(this);
  thread.setName("String_Node_Str");
  thread.setDaemon(true);
  thread.start();
}

Fixed version (ground truth):
/** 
 * Start collecting profiling data.
 */
public void startCollecting(){
  thread=new Thread(this,"String_Node_Str");
  thread.setDaemon(true);
  thread.start();
}
Program: 16021
Project: 16021
Buggy source:
/** 
 * Start the thread.
 * @return this
 */
public Task execute(){
  thread=new Thread(this);
  thread.setDaemon(true);
  thread.setName(getClass().getName());
  thread.start();
  return this;
}

Fixed version (ground truth):
/** 
 * Start the thread.
 * @return this
 */
public Task execute(){
  thread=new Thread(this,getClass().getName());
  thread.setDaemon(true);
  thread.start();
  return this;
}
Program: 16022
Project: 16022
Buggy source:
public void setFileLength(long newLength) throws IOException {
  checkFileSizeLimit(newLength);
  int oldPos=pos;
  unMap();
  IOUtils.setLength(file,newLength);
  reMap();
  pos=(int)Math.min(newLength,oldPos);
}

Fixed version (ground truth):
public void setFileLength(long newLength) throws IOException {
  checkFileSizeLimit(newLength);
  int oldPos=pos;
  unMap();
  for (int i=0; ; i++) {
    try {
      IOUtils.setLength(file,newLength);
      break;
    }
 catch (    IOException e) {
      if (i > 16 || e.toString().indexOf("String_Node_Str") < 0) {
        throw e;
      }
    }
    System.gc();
  }
  reMap();
  pos=(int)Math.min(newLength,oldPos);
}
Program: 16024
Project: 16024
Buggy source:
/** 
 * Convert primitive class names to java.lang.* class names.
 * @param clazz the class (for example: int)
 * @return the non-primitive class (for example: java.lang.Integer)
 */
public static Class<?> getNonPrimitiveClass(Class<?> clazz){
  if (!clazz.isPrimitive()) {
    return clazz;
  }
 else   if (clazz == boolean.class) {
    return Boolean.class;
  }
 else   if (clazz == byte.class) {
    return Byte.class;
  }
 else   if (clazz == char.class) {
    return Character.class;
  }
 else   if (clazz == double.class) {
    return Double.class;
  }
 else   if (clazz == float.class) {
    return Character.class;
  }
 else   if (clazz == int.class) {
    return Integer.class;
  }
 else   if (clazz == long.class) {
    return Long.class;
  }
 else   if (clazz == short.class) {
    return Short.class;
  }
 else   if (clazz == void.class) {
    return Void.class;
  }
  return clazz;
}

Fixed version (ground truth):
/** 
 * Convert primitive class names to java.lang.* class names.
 * @param clazz the class (for example: int)
 * @return the non-primitive class (for example: java.lang.Integer)
 */
public static Class<?> getNonPrimitiveClass(Class<?> clazz){
  if (!clazz.isPrimitive()) {
    return clazz;
  }
 else   if (clazz == boolean.class) {
    return Boolean.class;
  }
 else   if (clazz == byte.class) {
    return Byte.class;
  }
 else   if (clazz == char.class) {
    return Character.class;
  }
 else   if (clazz == double.class) {
    return Double.class;
  }
 else   if (clazz == float.class) {
    return Float.class;
  }
 else   if (clazz == int.class) {
    return Integer.class;
  }
 else   if (clazz == long.class) {
    return Long.class;
  }
 else   if (clazz == short.class) {
    return Short.class;
  }
 else   if (clazz == void.class) {
    return Void.class;
  }
  return clazz;
}
Program: 16025
Project: 16025
Buggy source:
/** 
 * Ensure all rows are read in memory.
 */
protected void readAllRows() throws SQLException {
  for (int i=0; i < entryCount; i++) {
    getRow(i);
  }
}

Fixed version (ground truth):
/** 
 * Ensure all rows are read in memory.
 */
protected void readAllRows() throws SQLException {
  for (int i=0; i < entryCount; i++) {
    SearchRow row=rows[i];
    if (row == null) {
      row=index.readRow(data,offsets[i],onlyPosition,false);
      rows[i]=row;
    }
  }
}
Program: 16026
Project: 16026
Buggy source:
/** 
 * Get the row at this position.
 * @param at the index
 * @return the row
 */
SearchRow getRow(int at) throws SQLException {
  SearchRow row=rows[at];
  if (row == null) {
    row=index.readRow(data,offsets[at],onlyPosition);
    rows[at]=row;
  }
  return row;
}

Fixed version (ground truth):
/** 
 * Get the row at this position.
 * @param at the index
 * @return the row
 */
SearchRow getRow(int at) throws SQLException {
  SearchRow row=rows[at];
  if (row == null) {
    row=index.readRow(data,offsets[at],onlyPosition,true);
    rows[at]=row;
  }
 else   if (!index.hasData(row)) {
    row=index.readRow(row.getKey());
    rows[at]=row;
  }
  return row;
}
Program: 16027
Project: 16027
Buggy source:
/** 
 * Change the parent page id.
 * @param id the new parent page id
 */
void setParentPageId(int id) throws SQLException {
  index.getPageStore().logUndo(this,data);
  written=false;
  parentPageId=id;
}

Fixed version (ground truth):
/** 
 * Change the parent page id.
 * @param id the new parent page id
 */
void setParentPageId(int id) throws SQLException {
  index.getPageStore().logUndo(this,data);
  changeCount=index.getPageStore().getChangeCount();
  written=false;
  parentPageId=id;
}
Program: 16028
Project: 16028
Buggy source:
/** 
 * Change the page id.
 * @param id the new page id
 */
void setPageId(int id) throws SQLException {
  written=false;
  index.getPageStore().removeRecord(getPos());
  setPos(id);
  index.getPageStore().logUndo(this,null);
  remapChildren();
}

Fixed version (ground truth):
/** 
 * Change the page id.
 * @param id the new page id
 */
void setPageId(int id) throws SQLException {
  changeCount=index.getPageStore().getChangeCount();
  written=false;
  index.getPageStore().removeRecord(getPos());
  setPos(id);
  index.getPageStore().logUndo(this,null);
  remapChildren();
}
Program: 16029
Project: 16029
Buggy source:
/** 
 * Read a row from the data page at the given offset.
 * @param data the data
 * @param offset the offset
 * @param onlyPosition whether only the position of the row is stored
 * @return the row
 */
SearchRow readRow(Data data,int offset,boolean onlyPosition) throws SQLException {
  data.setPos(offset);
  long key=data.readVarLong();
  if (onlyPosition) {
    return tableData.getRow(null,key);
  }
  SearchRow row=table.getTemplateSimpleRow(columns.length == 1);
  row.setKey(key);
  for (  Column col : columns) {
    int idx=col.getColumnId();
    row.setValue(idx,data.readValue());
  }
  return row;
}

Fixed version (ground truth):
/** 
 * Get the complete row from the data index.
 * @param key the key
 * @return the row
 */
SearchRow readRow(long key) throws SQLException {
  return tableData.getRow(null,key);
}
Program: 16030
Project: 16030
Buggy source:
private void removeAllRows() throws SQLException {
  PageBtree root=getPage(rootPageId);
  root.freeRecursive();
  root=PageBtreeLeaf.create(this,rootPageId,PageBtree.ROOT);
  store.removeRecord(rootPageId);
  store.update(root);
  rowCount=0;
}

Fixed version (ground truth):
private void removeAllRows() throws SQLException {
  try {
    PageBtree root=getPage(rootPageId);
    root.freeRecursive();
    root=PageBtreeLeaf.create(this,rootPageId,PageBtree.ROOT);
    store.removeRecord(rootPageId);
    store.update(root);
    rowCount=0;
  }
  finally {
    store.incrementChangeCount();
  }
}
Program: 16031
Project: 16031
Buggy source:
public void close(Session session) throws SQLException {
  if (trace.isDebugEnabled()) {
    trace.debug("String_Node_Str");
  }
  writeRowCount();
}

Fixed version (ground truth):
public void close(Session session) throws SQLException {
  if (trace.isDebugEnabled()) {
    trace.debug("String_Node_Str");
  }
  try {
    writeRowCount();
  }
  finally {
    store.incrementChangeCount();
  }
}