Program: 113571
Project: 113571
Buggy source:
private void initializeDatabase(){
  final byte[] versionKey="String_Node_Str".getBytes();
  try {
    Database db=dbMan.createDatabase("String_Node_Str",1);
    ReusableBuffer rb=null;
    try {
      byte[] keyData=new byte[4];
      rb=ReusableBuffer.wrap(keyData);
      rb.putInt(DB_VERSION);
      db.singleInsert(0,versionKey,keyData,null).get();
    }
 catch (    Exception ex) {
      ex.printStackTrace();
      System.err.println("String_Node_Str");
      System.exit(1);
    }
 finally {
      if (rb != null)       BufferPool.free(rb);
    }
  }
 catch (  BabuDBException ex) {
    if (ex.getErrorCode() == BabuDBException.ErrorCode.DB_EXISTS) {
      ReusableBuffer rb=null;
      try {
        Database db=dbMan.getDatabase("String_Node_Str");
        byte[] value=db.lookup(0,versionKey,null).get();
        int ver=-1;
        if ((value != null) && (value.length == 4)) {
          rb=ReusableBuffer.wrap(value);
          ver=rb.getInt();
        }
        if (ver != DB_VERSION) {
          Logging.logMessage(Logging.LEVEL_ERROR,this,"String_Node_Str");
          Logging.logMessage(Logging.LEVEL_ERROR,this,"String_Node_Str",ver,DIRInterface.getVersion());
          Logging.logMessage(Logging.LEVEL_ERROR,this,"String_Node_Str");
          System.exit(1);
        }
      }
 catch (      Exception ex2) {
        ex2.printStackTrace();
        System.err.println("String_Node_Str");
        System.exit(1);
      }
 finally {
        if (rb != null)         BufferPool.free(rb);
      }
    }
 else {
      ex.printStackTrace();
      System.err.println("String_Node_Str");
      System.exit(1);
    }
  }
  try {
    dbMan.createDatabase("String_Node_Str",3);
  }
 catch (  BabuDBException ex) {
  }
}

Fixed version (ground truth):
private void initializeDatabase(){
  final byte[] versionKey="String_Node_Str".getBytes();
  try {
    Database db=dbMan.createDatabase("String_Node_Str",1);
    ReusableBuffer rb=null;
    try {
      byte[] keyData=new byte[4];
      rb=ReusableBuffer.wrap(keyData);
      rb.putInt(DB_VERSION);
      db.singleInsert(0,versionKey,keyData,null).get();
    }
 catch (    Exception ex) {
      ex.printStackTrace();
      System.err.println("String_Node_Str");
      System.exit(1);
    }
 finally {
      if (rb != null)       BufferPool.free(rb);
    }
  }
 catch (  BabuDBException ex) {
    if (ex.getErrorCode() == BabuDBException.ErrorCode.DB_EXISTS) {
      ReusableBuffer rb=null;
      try {
        Database db=dbMan.getDatabase("String_Node_Str");
        byte[] value=db.lookup(0,versionKey,null).get();
        int ver=-1;
        if ((value != null) && (value.length == 4)) {
          rb=ReusableBuffer.wrap(value);
          ver=rb.getInt();
        }
        if (ver != DB_VERSION) {
          Logging.logMessage(Logging.LEVEL_ERROR,this,"String_Node_Str");
          Logging.logMessage(Logging.LEVEL_ERROR,this,"String_Node_Str",ver,DB_VERSION);
          Logging.logMessage(Logging.LEVEL_ERROR,this,"String_Node_Str");
          System.exit(1);
        }
      }
 catch (      Exception ex2) {
        ex2.printStackTrace();
        System.err.println("String_Node_Str");
        System.exit(1);
      }
 finally {
        if (rb != null)         BufferPool.free(rb);
      }
    }
 else {
      ex.printStackTrace();
      System.err.println("String_Node_Str");
      System.exit(1);
    }
  }
  try {
    dbMan.createDatabase("String_Node_Str",3);
  }
 catch (  BabuDBException ex) {
  }
}