Program: 51195
Project: 51195
Buggy source:
public void execute() throws SQLException {
  this.jdbcConnection=dataSource.getConnection();
  querySemaphore.enter();
  haveSemaphore=true;
  Statement statement=null;
  String status="String_Node_Str";
  long currId=0;
  if (RolapUtil.SQL_LOGGER.isDebugEnabled()) {
    currId=executeCount++;
    StringBuffer sqllog=new StringBuffer();
    sqllog.append(currId + "String_Node_Str" + component+ "String_Node_Str");
    if (sql.indexOf('\n') >= 0) {
      sqllog.append("String_Node_Str");
    }
    sqllog.append(sql);
    sqllog.append(']');
    RolapUtil.SQL_LOGGER.debug(sqllog.toString());
  }
  RolapUtil.ExecuteQueryHook hook=RolapUtil.threadHooks.get();
  if (hook != null) {
    hook.onExecuteQuery(sql);
  }
  try {
    startTime=System.currentTimeMillis();
    if (resultSetType < 0 || resultSetConcurrency < 0) {
      statement=jdbcConnection.createStatement();
    }
 else {
      statement=jdbcConnection.createStatement(resultSetType,resultSetConcurrency);
    }
    if (maxRows > 0) {
      statement.setMaxRows(maxRows);
    }
    this.resultSet=statement.executeQuery(sql);
    long time=System.currentTimeMillis();
    final long execMs=time - startTime;
    Util.addDatabaseTime(execMs);
    status="String_Node_Str" + execMs + "String_Node_Str";
  }
 catch (  SQLException e) {
    status="String_Node_Str" + e + "String_Node_Str";
    try {
      if (statement != null) {
        statement.close();
      }
    }
 catch (    SQLException e2) {
    }
    throw handle(e);
  }
 finally {
    RolapUtil.SQL_LOGGER.debug(currId + "String_Node_Str" + status);
    if (RolapUtil.LOGGER.isDebugEnabled()) {
      RolapUtil.LOGGER.debug(component + "String_Node_Str" + sql+ "String_Node_Str"+ status);
    }
  }
}

Fixed version (ground truth):
public void execute() throws SQLException {
  this.jdbcConnection=dataSource.getConnection();
  querySemaphore.enter();
  haveSemaphore=true;
  Statement statement=null;
  String status="String_Node_Str";
  long currId=0;
  if (RolapUtil.SQL_LOGGER.isDebugEnabled()) {
    currId=++executeCount;
    StringBuffer sqllog=new StringBuffer();
    sqllog.append(currId + "String_Node_Str" + component+ "String_Node_Str");
    if (sql.indexOf('\n') >= 0) {
      sqllog.append("String_Node_Str");
    }
    sqllog.append(sql);
    sqllog.append(']');
    RolapUtil.SQL_LOGGER.debug(sqllog.toString());
  }
  RolapUtil.ExecuteQueryHook hook=RolapUtil.threadHooks.get();
  if (hook != null) {
    hook.onExecuteQuery(sql);
  }
  try {
    startTime=System.currentTimeMillis();
    if (resultSetType < 0 || resultSetConcurrency < 0) {
      statement=jdbcConnection.createStatement();
    }
 else {
      statement=jdbcConnection.createStatement(resultSetType,resultSetConcurrency);
    }
    if (maxRows > 0) {
      statement.setMaxRows(maxRows);
    }
    this.resultSet=statement.executeQuery(sql);
    long time=System.currentTimeMillis();
    final long execMs=time - startTime;
    Util.addDatabaseTime(execMs);
    status="String_Node_Str" + execMs + "String_Node_Str";
  }
 catch (  SQLException e) {
    status="String_Node_Str" + e + "String_Node_Str";
    try {
      if (statement != null) {
        statement.close();
      }
    }
 catch (    SQLException e2) {
    }
    throw handle(e);
  }
 finally {
    RolapUtil.SQL_LOGGER.debug(currId + "String_Node_Str" + status);
    if (RolapUtil.LOGGER.isDebugEnabled()) {
      RolapUtil.LOGGER.debug(component + "String_Node_Str" + sql+ "String_Node_Str"+ status);
    }
  }
}