Program: 26019
Project: 26019
Buggy source:
/** 
 * This method is specific for inserts.
 * @param query SQL for inserts.
 * @param autoIncrementColumnName name of a column that is auto-incremented.
 * @param params list of parameter values.
 * @return new value of auto-incremented column that is uniquely identifying a new record inserted. May return -1 if thisfunctionality is not supported by DB or driver.
 */
long execInsert(String query,String autoIncrementColumnName,Object... params){
  if (!query.toLowerCase().contains("String_Node_Str"))   throw new IllegalArgumentException("String_Node_Str");
  long start=System.currentTimeMillis();
  PreparedStatement ps;
  try {
    Connection connection=connection();
    ps=StatementCache.instance().getPreparedStatement(connection,query);
    if (ps == null) {
      ps=connection.prepareStatement(query,new String[]{autoIncrementColumnName});
      StatementCache.instance().cache(connection,query,ps);
    }
    for (int index=0; index < params.length; index++) {
      Object param=params[index];
      if (param instanceof byte[]) {
        byte[] bytes=(byte[])param;
        try {
          Blob b=connection.createBlob();
          b.setBytes(1,bytes);
          ps.setBlob(index + 1,b);
        }
 catch (        AbstractMethodError e) {
          ps.setObject(index + 1,param);
        }
      }
 else {
        ps.setObject(index + 1,param);
      }
    }
    ps.executeUpdate();
    ResultSet rs=null;
    try {
      rs=ps.getGeneratedKeys();
      if (rs.next()) {
        long id=rs.getLong(1);
        LogFilter.logQuery(logger,query,params,start);
        return id;
      }
 else {
        return -1;
      }
    }
 catch (    Exception e) {
      logger.error("String_Node_Str" + query,e);
      return -1;
    }
 finally {
      try {
        if (rs != null)         rs.close();
      }
 catch (      Exception e) {
      }
    }
  }
 catch (  Exception e) {
    throw new DBException(query,params,e);
  }
}

Fixed version (ground truth):
/** 
 * This method is specific for inserts.
 * @param query SQL for inserts.
 * @param autoIncrementColumnName name of a column that is auto-incremented.
 * @param params list of parameter values.
 * @return new value of auto-incremented column that is uniquely identifying a new record inserted. May return -1 if thisfunctionality is not supported by DB or driver.
 */
long execInsert(String query,String autoIncrementColumnName,Object... params){
  if (!query.toLowerCase().contains("String_Node_Str"))   throw new IllegalArgumentException("String_Node_Str");
  long start=System.currentTimeMillis();
  PreparedStatement ps;
  try {
    Connection connection=connection();
    ps=StatementCache.instance().getPreparedStatement(connection,query);
    if (ps == null) {
      ps=connection.prepareStatement(query,new String[]{autoIncrementColumnName});
      StatementCache.instance().cache(connection,query,ps);
    }
    for (int index=0; index < params.length; index++) {
      Object param=params[index];
      if (param instanceof byte[]) {
        byte[] bytes=(byte[])param;
        try {
          Blob b=connection.createBlob();
          b.setBytes(1,bytes);
          ps.setBlob(index + 1,b);
        }
 catch (        AbstractMethodError e) {
          ps.setObject(index + 1,param);
        }
catch (        SQLFeatureNotSupportedException e) {
          ps.setObject(index + 1,param);
        }
catch (        SQLException e) {
          ps.setObject(index + 1,param);
        }
      }
 else {
        ps.setObject(index + 1,param);
      }
    }
    ps.executeUpdate();
    ResultSet rs=null;
    try {
      rs=ps.getGeneratedKeys();
      if (rs.next()) {
        long id=rs.getLong(1);
        LogFilter.logQuery(logger,query,params,start);
        return id;
      }
 else {
        return -1;
      }
    }
 catch (    Exception e) {
      logger.error("String_Node_Str" + query,e);
      return -1;
    }
 finally {
      try {
        if (rs != null)         rs.close();
      }
 catch (      Exception e) {
      }
    }
  }
 catch (  Exception e) {
    throw new DBException(query,params,e);
  }
}