nus-yam/ex-repair huggingface dataset:
Program: 29872
Project: 29872
Buggy source:
/** 
 * Get the value of the parameter with the given name belonging to this service as a boolean. If the parameter is not found, false is returned.
 * @param paramName Name of parameter to find.
 * @return          Parameter value found or false if not found.
 */
public boolean getParamBoolean(String paramName){
  Object paramValue=getParam(paramName);
  if (paramValue == null) {
    return false;
  }
  return Boolean.parseBoolean(paramValue.toString());
}

Fixed version (ground truth):
/** 
 * Get the value of the parameter with the given name belonging to this service as a boolean. If the parameter is not found, defaultValue is returned.
 * @param paramName Name of parameter to find.
 * @return          Parameter value found or defaultValue if not found.
 */
public boolean getParamBoolean(String paramName,boolean defaultValue){
  Object paramValue=getParam(paramName);
  if (paramValue == null) {
    return defaultValue;
  }
  return Boolean.parseBoolean(paramValue.toString());
}
Program: 29873
Project: 29873
Buggy source:
void onNewrequest(){
  m_webservice.notifyNewRequest();
}

Fixed version (ground truth):
void onNewrequest(){
  if (m_webservice != null) {
    m_webservice.notifyNewRequest();
  }
}
Program: 29874
Project: 29874
Buggy source:
void onRequestSuccess(long startTimeNanos){
  m_webservice.notifyRequestSuccess(startTimeNanos);
}

Fixed version (ground truth):
void onRequestSuccess(long startTimeNanos){
  if (m_webservice != null) {
    m_webservice.notifyRequestSuccess(startTimeNanos);
  }
}
Program: 29875
Project: 29875
Buggy source:
void onRequestFailed(Throwable e){
  m_webservice.notifyRequestFailed(e);
}

Fixed version (ground truth):
void onRequestFailed(Throwable e){
  if (m_webservice != null) {
    m_webservice.notifyRequestFailed(e);
  }
}
Program: 29876
Project: 29876
Buggy source:
void onRequestRejected(String reason){
  m_webservice.notifyRequestRejected(reason);
}

Fixed version (ground truth):
void onRequestRejected(String reason){
  if (m_webservice != null) {
    m_webservice.notifyRequestRejected(reason);
  }
}
Program: 29877
Project: 29877
Buggy source:
private void createApplication(){
  String schema=getSchema();
  ContentType contentType=null;
  if (m_config.schema.toLowerCase().endsWith("String_Node_Str")) {
    contentType=ContentType.APPLICATION_JSON;
  }
 else   if (m_config.schema.toLowerCase().endsWith("String_Node_Str")) {
    contentType=ContentType.TEXT_XML;
  }
 else {
    logErrorThrow("String_Node_Str",m_config.schema);
  }
  try {
    m_logger.info("String_Node_Str",m_config.app,m_config.schema);
    m_client.createApplication(schema,contentType);
  }
 catch (  Exception e) {
    logErrorThrow("String_Node_Str",e);
  }
  try {
    m_session=m_client.openApplication(m_config.app);
  }
 catch (  RuntimeException e) {
    logErrorThrow("String_Node_Str",m_config.app);
  }
  String ss=m_session.getAppDef().getStorageService();
  if (!Utils.isEmpty(ss) && ss.equals("String_Node_Str")) {
    m_bOLAPApp=true;
  }
  loadTables();
}

Fixed version (ground truth):
private void createApplication(){
  String schema=getSchema();
  ContentType contentType=null;
  if (m_config.schema.toLowerCase().endsWith("String_Node_Str")) {
    contentType=ContentType.APPLICATION_JSON;
  }
 else   if (m_config.schema.toLowerCase().endsWith("String_Node_Str")) {
    contentType=ContentType.TEXT_XML;
  }
 else {
    logErrorThrow("String_Node_Str",m_config.schema);
  }
  try {
    m_logger.info("String_Node_Str",m_config.app,m_config.schema);
    m_client.createApplication(schema,contentType);
  }
 catch (  Exception e) {
    logErrorThrow("String_Node_Str",e);
  }
  try {
    m_session=m_client.openApplication(m_config.app);
  }
 catch (  RuntimeException e) {
    logErrorThrow("String_Node_Str",m_config.app,e.toString());
  }
  String ss=m_session.getAppDef().getStorageService();
  if (!Utils.isEmpty(ss) && ss.startsWith("String_Node_Str")) {
    m_bOLAPApp=true;
  }
  loadTables();
}
Program: 29878
Project: 29878
Buggy source:
/** 
 * Make a copy of this object with the same updates and values but with a new object ID.
 * @param objID   Object IF of new object.
 * @return          Copy of this object except for the object ID.
 */
public DBObject makeCopy(String objID){
  DBObject newObj=new DBObject();
  newObj.m_valueMap.putAll(m_valueMap);
  newObj.m_valueRemoveMap.putAll(m_valueRemoveMap);
  return newObj;
}

Fixed version (ground truth):
/** 
 * Make a copy of this object with the same updates and values but with a new object ID.
 * @param objID   Object IF of new object.
 * @return          Copy of this object except for the object ID.
 */
public DBObject makeCopy(String objID){
  DBObject newObj=new DBObject();
  newObj.m_valueMap.putAll(m_valueMap);
  newObj.setObjectID(objID);
  newObj.m_valueRemoveMap.putAll(m_valueRemoveMap);
  return newObj;
}
Program: 29879
Project: 29879
Buggy source:
private boolean storeExists(String keyspace,String tableName){
  KeyspaceMetadata ksMetadata=m_cluster.getMetadata().getKeyspace(keyspace);
  return (ksMetadata != null) && (ksMetadata.getTable(tableName) != null);
}

Fixed version (ground truth):
private boolean storeExists(String cqlKeyspace,String tableName){
}
Program: 29880
Project: 29880
Buggy source:
/** 
 * Get the   {@link PreparedStatement} for the given {@link CQLStatementCache.Update} tothe given table name, residing in the given keyspace. If needed, the update statement is compiled and cached.
 * @param keyspace      Keyspace name.
 * @param update        Update statement type.
 * @param tableName     Quoted table name.
 * @return              PreparedStatement for requested keyspace/table/update.
 */
public PreparedStatement getPreparedUpdate(String keyspace,Update update,String tableName){
}

Fixed version (ground truth):
/** 
 * Get the   {@link PreparedStatement} for the given {@link CQLStatementCache.Update} tothe given table name, residing in the given keyspace. If needed, the update statement is compiled and cached.
 * @param keyspace      Keyspace name.
 * @param update        Update statement type.
 * @param storeName     Store (ColumnFamily) name.
 * @return              PreparedStatement for requested keyspace/table/update.
 */
public PreparedStatement getPreparedUpdate(String keyspace,Update update,String storeName){
}
Program: 29881
Project: 29881
Buggy source:
@Override public Iterator<DColumn> getColumnSlice(Tenant tenant,String storeName,String rowKey,String startCol,String endCol){
  checkState();
  String keyspace=tenant.getKeyspace();
  String tableName=storeToCQLName(storeName);
  return new CQLColumnIterator(executeQuery(Query.SELECT_1_ROW_COLUMN_RANGE,keyspace,tableName,rowKey,startCol,endCol));
}

Fixed version (ground truth):
@Override public Iterator<DColumn> getColumnSlice(Tenant tenant,String storeName,String rowKey,String startCol,String endCol){
  checkState();
  String keyspace=storeToCQLName(tenant.getKeyspace());
  String tableName=storeToCQLName(storeName);
  return new CQLColumnIterator(executeQuery(Query.SELECT_1_ROW_COLUMN_RANGE,keyspace,tableName,rowKey,startCol,endCol));
}
Program: 29882
Project: 29882
Buggy source:
/** 
 * Get the   {@link PreparedStatement} for the given {@link CQLStatementCache.Query} tothe given table name, residing in the given keyspace. If needed, the query statement is compiled and cached.
 * @param keyspace      Keyspace name.
 * @param query         Query statement type.
 * @param tableName     Quoted table name.
 * @return              PreparedStatement for requested keyspace/table/update.
 */
public PreparedStatement getPreparedQuery(String keyspace,Query query,String tableName){
}

Fixed version (ground truth):
/** 
 * Get the   {@link PreparedStatement} for the given {@link CQLStatementCache.Query} tothe given table name, residing in the given keyspace. If needed, the query statement is compiled and cached.
 * @param keyspace      Keyspace name.
 * @param query         Query statement type.
 * @param storeName     Store (ColumnFamily) name.
 * @return              PreparedStatement for requested keyspace/table/update.
 */
public PreparedStatement getPreparedQuery(String keyspace,Query query,String storeName){
}
Program: 29883
Project: 29883
Buggy source:
@Override public DColumn getColumn(Tenant tenant,String storeName,String rowKey,String colName){
  checkState();
  String keyspace=tenant.getKeyspace();
  String tableName=storeToCQLName(storeName);
  CQLColumnIterator colIter=new CQLColumnIterator(executeQuery(Query.SELECT_1_ROW_1_COLUMN,keyspace,tableName,rowKey,colName));
  if (!colIter.hasNext()) {
    return null;
  }
  return colIter.next();
}

Fixed version (ground truth):
@Override public DColumn getColumn(Tenant tenant,String storeName,String rowKey,String colName){
  checkState();
  String keyspace=storeToCQLName(tenant.getKeyspace());
  String tableName=storeToCQLName(storeName);
  CQLColumnIterator colIter=new CQLColumnIterator(executeQuery(Query.SELECT_1_ROW_1_COLUMN,keyspace,tableName,rowKey,colName));
  if (!colIter.hasNext()) {
    return null;
  }
  return colIter.next();
}
Program: 29884
Project: 29884
Buggy source:
@Override public Iterator<DRow> getRowsColumns(Tenant tenant,String storeName,Collection<String> rowKeys,Collection<String> colNames){
  checkState();
  String keyspace=tenant.getKeyspace();
  String tableName=storeToCQLName(storeName);
  return new CQLRowIterator(executeQuery(Query.SELECT_ROW_SET_COLUMN_SET,keyspace,tableName,new ArrayList<String>(rowKeys),new ArrayList<String>(colNames)));
}

Fixed version (ground truth):
@Override public Iterator<DRow> getRowsColumns(Tenant tenant,String storeName,Collection<String> rowKeys,Collection<String> colNames){
  checkState();
  String keyspace=storeToCQLName(tenant.getKeyspace());
  String tableName=storeToCQLName(storeName);
  return new CQLRowIterator(executeQuery(Query.SELECT_ROW_SET_COLUMN_SET,keyspace,tableName,new ArrayList<String>(rowKeys),new ArrayList<String>(colNames)));
}
Program: 29885
Project: 29885
Buggy source:
@Override public void dropTenant(Tenant tenant){
  String cqlKeyspace=storeToCQLName(tenant.getKeyspace());
synchronized (m_ksSessionMap) {
    Session session=m_ksSessionMap.get(cqlKeyspace);
    if (session != null) {
      session.close();
      m_ksSessionMap.remove(cqlKeyspace);
      m_ksStatementCacheMap.remove(cqlKeyspace);
    }
    try (Session noKSSession=m_cluster.connect()){
      CQLSchemaManager schemaMgr=new CQLSchemaManager(noKSSession,null);
      schemaMgr.dropKeyspace(cqlKeyspace);
    }
   }
}

Fixed version (ground truth):
@Override public void dropTenant(Tenant tenant){
  checkState();
  String cqlKeyspace=storeToCQLName(tenant.getKeyspace());
synchronized (m_ksSessionMap) {
    Session session=m_ksSessionMap.get(cqlKeyspace);
    if (session != null) {
      session.close();
      m_ksSessionMap.remove(cqlKeyspace);
      m_ksStatementCacheMap.remove(cqlKeyspace);
    }
    try (Session noKSSession=m_cluster.connect()){
      CQLSchemaManager schemaMgr=new CQLSchemaManager(noKSSession,null);
      schemaMgr.dropKeyspace(cqlKeyspace);
    }
   }
}
Program: 29886
Project: 29886
Buggy source:
@Override public Collection<Tenant> getTenants(){
  checkState();
  List<Tenant> tenants=new ArrayList<>();
  try (Session session=m_cluster.connect()){
    List<KeyspaceMetadata> keyspaceList=m_cluster.getMetadata().getKeyspaces();
    for (    KeyspaceMetadata ksMetadata : keyspaceList) {
      if (ksMetadata.getTable(SchemaService.APPS_STORE_NAME) != null) {
        tenants.add(new Tenant(ksMetadata.getName()));
      }
    }
  }
   return tenants;
}

Fixed version (ground truth):
@Override public Collection<Tenant> getTenants(){
  checkState();
  List<Tenant> tenants=new ArrayList<>();
  try (Session session=m_cluster.connect()){
    List<KeyspaceMetadata> keyspaceList=m_cluster.getMetadata().getKeyspaces();
    for (    KeyspaceMetadata ksMetadata : keyspaceList) {
      if (ksMetadata.getTable(APPS_CQL_NAME) != null) {
        tenants.add(new Tenant(ksMetadata.getName()));
      }
    }
  }
   return tenants;
}
Program: 29887
Project: 29887
Buggy source:
/** 
 * Return true if column values for the given keyspace/table name are binary.
 * @param keyspace  Quoted keyspace name.
 * @param tableName Quoted columnfamily name.
 * @return          True if the given table's column values are binary.
 */
public boolean columnValueIsBinary(String keyspace,String tableName){
}

Fixed version (ground truth):
/** 
 * Return true if column values for the given keyspace/table name are binary.
 * @param keyspace  Keyspace name.
 * @param storeName Store (ColumnFamily) name.
 * @return          True if the given table's column values are binary.
 */
public boolean columnValueIsBinary(String keyspace,String storeName){
  String cqlKeyspace=storeToCQLName(keyspace);
  String tableName=storeToCQLName(storeName);
  KeyspaceMetadata ksMetadata=m_cluster.getMetadata().getKeyspace(cqlKeyspace);
  TableMetadata tableMetadata=ksMetadata.getTable(tableName);
  ColumnMetadata colMetadata=tableMetadata.getColumn("String_Node_Str");
  return colMetadata.getType().equals(DataType.blob());
}
Program: 29888
Project: 29888
Buggy source:
@Override public Iterator<DRow> getAllRowsAllColumns(Tenant tenant,String storeName){
  checkState();
  String keyspace=tenant.getKeyspace();
  String tableName=storeToCQLName(storeName);
  return new CQLRowIterator(executeQuery(Query.SELECT_ALL_ROWS_ALL_COLUMNS,keyspace,tableName));
}

Fixed version (ground truth):
@Override public Iterator<DRow> getAllRowsAllColumns(Tenant tenant,String storeName){
  checkState();
  String keyspace=storeToCQLName(tenant.getKeyspace());
  String tableName=storeToCQLName(storeName);
  return new CQLRowIterator(executeQuery(Query.SELECT_ALL_ROWS_ALL_COLUMNS,keyspace,tableName));
}
Program: 29889
Project: 29889
Buggy source:
@Override public void createTenant(Tenant tenant){
  String cqlKeyspace=storeToCQLName(tenant.getKeyspace());
  KeyspaceMetadata ksMetadata=m_cluster.getMetadata().getKeyspace(cqlKeyspace);
  if (ksMetadata == null) {
    try (Session session=m_cluster.connect()){
      CQLSchemaManager schemaMgr=new CQLSchemaManager(session,null);
      schemaMgr.createKeyspace(cqlKeyspace);
    }
   }
}

Fixed version (ground truth):
@Override public void createTenant(Tenant tenant){
  checkState();
  String cqlKeyspace=storeToCQLName(tenant.getKeyspace());
  KeyspaceMetadata ksMetadata=m_cluster.getMetadata().getKeyspace(cqlKeyspace);
  if (ksMetadata == null) {
    try (Session session=m_cluster.connect()){
      CQLSchemaManager schemaMgr=new CQLSchemaManager(session,null);
      schemaMgr.createKeyspace(cqlKeyspace);
    }
   }
}
Program: 29890
Project: 29890
Buggy source:
private ResultSet executeQuery(Query query,String cqlKeyspace,String tableName,Object... values){
  m_logger.debug("String_Node_Str",new Object[]{query,cqlKeyspace,tableName,values.length});
  Session session=getOrCreateKeyspaceSession(cqlKeyspace);
  PreparedStatement prepState=getPreparedQuery(cqlKeyspace,query,tableName);
  BoundStatement boundState=prepState.bind(values);
  return session.execute(boundState);
}

Fixed version (ground truth):
private ResultSet executeQuery(Query query,String cqlKeyspace,String tableName,Object... values){
}
Program: 29891
Project: 29891
Buggy source:
private Session getOrCreateKeyspaceSession(String keyspace){
  String cqlKeyspace=storeToCQLName(keyspace);
  Session session=m_ksSessionMap.get(cqlKeyspace);
  if (session == null) {
synchronized (m_ksSessionMap) {
      session=m_ksSessionMap.get(cqlKeyspace);
      if (session == null) {
        session=m_cluster.connect(cqlKeyspace);
        m_ksSessionMap.put(cqlKeyspace,session);
        m_ksStatementCacheMap.put(cqlKeyspace,new CQLStatementCache(session));
      }
    }
  }
  return session;
}

Fixed version (ground truth):
private Session getOrCreateKeyspaceSession(String cqlKeyspace){
}
Program: 29892
Project: 29892
Buggy source:
@Override public Iterator<DColumn> getAllColumns(Tenant tenant,String storeName,String rowKey){
  checkState();
  String keyspace=tenant.getKeyspace();
  String tableName=storeToCQLName(storeName);
  return new CQLColumnIterator(executeQuery(Query.SELECT_1_ROW_ALL_COLUMNS,keyspace,tableName,rowKey));
}

Fixed version (ground truth):
@Override public Iterator<DColumn> getAllColumns(Tenant tenant,String storeName,String rowKey){
  checkState();
  String keyspace=storeToCQLName(tenant.getKeyspace());
  String tableName=storeToCQLName(storeName);
  return new CQLColumnIterator(executeQuery(Query.SELECT_1_ROW_ALL_COLUMNS,keyspace,tableName,rowKey));
}
Program: 29893
Project: 29893
Buggy source:
@Override public Iterator<DRow> getRowsAllColumns(Tenant tenant,String storeName,Collection<String> rowKeys){
  checkState();
  String keyspace=tenant.getKeyspace();
  String tableName=storeToCQLName(storeName);
  return new CQLRowIterator(executeQuery(Query.SELECT_ROW_SET_ALL_COLUMNS,keyspace,tableName,new ArrayList<String>(rowKeys)));
}

Fixed version (ground truth):
@Override public Iterator<DRow> getRowsAllColumns(Tenant tenant,String storeName,Collection<String> rowKeys){
  checkState();
  String keyspace=storeToCQLName(tenant.getKeyspace());
  String tableName=storeToCQLName(storeName);
  return new CQLRowIterator(executeQuery(Query.SELECT_ROW_SET_ALL_COLUMNS,keyspace,tableName,new ArrayList<String>(rowKeys)));
}
Program: 29894
Project: 29894
Buggy source:
/** 
 * Get the CQL session being used by this CQL service.
 * @param keyspace Keyspace to which session applies.
 * @return         The CQL Session object connected to the appropriate keyspace.
 */
public Session getSession(String keyspace){
  return getOrCreateKeyspaceSession(keyspace);
}

Fixed version (ground truth):
/** 
 * Get the CQL session being used by this CQL service.
 * @param keyspace Keyspace to which session applies.
 * @return         The CQL Session object connected to the appropriate keyspace.
 */
public Session getSession(String keyspace){
  String cqlKeyspace=storeToCQLName(keyspace);
  return getOrCreateKeyspaceSession(cqlKeyspace);
}
Program: 29895
Project: 29895
Buggy source:
@Override public Iterator<DRow> getRowsColumnSlice(Tenant tenant,String storeName,Collection<String> rowKeys,String startCol,String endCol){
  checkState();
  String keyspace=tenant.getKeyspace();
  String tableName=storeToCQLName(storeName);
  return new CQLRowIterator(executeQuery(Query.SELECT_ROW_SET_COLUMN_RANGE,keyspace,tableName,new ArrayList<String>(rowKeys),startCol,endCol));
}

Fixed version (ground truth):
@Override public Iterator<DRow> getRowsColumnSlice(Tenant tenant,String storeName,Collection<String> rowKeys,String startCol,String endCol){
  checkState();
  String keyspace=storeToCQLName(tenant.getKeyspace());
  String tableName=storeToCQLName(storeName);
  return new CQLRowIterator(executeQuery(Query.SELECT_ROW_SET_COLUMN_RANGE,keyspace,tableName,new ArrayList<String>(rowKeys),startCol,endCol));
}
Program: 29896
Project: 29896
Buggy source:
/** 
 * Start a new CQLTransaction.
 */
public CQLTransaction(Tenant tenant){
  m_keyspace=tenant.getKeyspace();
  m_session=CQLService.instance().getSession(m_keyspace);
}

Fixed version (ground truth):
/** 
 * Start a new CQLTransaction.
 */
public CQLTransaction(Tenant tenant){
  m_keyspace=CQLService.storeToCQLName(tenant.getKeyspace());
  m_session=CQLService.instance().getSession(m_keyspace);
}
Program: 29897
Project: 29897
Buggy source:
/** 
 * Update the schema for this session's application with the given definition. The text must be formatted in XML or JSON, as defined by the given content type. True is returned if the update was successful. An exception is thrown if an error occurred.
 * @param text          Text of updated schema definition.
 * @param contentType   Format of text. Must be {@link ContentType#APPLICATION_JSON} or{@link ContentType#TEXT_XML}.
 * @return              True if the schema update was successful.
 */
public boolean updateSchema(String text,ContentType contentType){
  Utils.require(text != null && text.length() > 0,"String_Node_Str");
  Utils.require(contentType != null,"String_Node_Str");
  try {
    byte[] body=Utils.toBytes(text);
    String uri=uriRoot() + "String_Node_Str" + Utils.urlEncode(m_appDef.getAppName());
    RESTResponse response=m_restClient.sendRequest(HttpMethod.PUT,uri,ContentType.APPLICATION_JSON,body);
    m_logger.debug("String_Node_Str",response.toString());
    throwIfErrorResponse(response);
    return true;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Update the schema for this session's application with the given definition. The text must be formatted in XML or JSON, as defined by the given content type. True is returned if the update was successful. An exception is thrown if an error occurred.
 * @param text          Text of updated schema definition.
 * @param contentType   Format of text. Must be {@link ContentType#APPLICATION_JSON} or{@link ContentType#TEXT_XML}.
 * @return              True if the schema update was successful.
 */
public boolean updateSchema(String text,ContentType contentType){
  Utils.require(text != null && text.length() > 0,"String_Node_Str");
  Utils.require(contentType != null,"String_Node_Str");
  try {
    byte[] body=Utils.toBytes(text);
    StringBuilder uri=new StringBuilder("String_Node_Str");
    uri.append(Utils.urlEncode(m_appDef.getAppName()));
    addTenantParam(uri);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.PUT,uri.toString(),ContentType.APPLICATION_JSON,body);
    m_logger.debug("String_Node_Str",response.toString());
    throwIfErrorResponse(response);
    return true;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 29898
Project: 29898
Buggy source:
/** 
 * Refresh this session's application schema from the database. Since the application's   {@link ApplicationDefinition} is cached, it could be out of dateif the schema has been modified. This method fetches the latest version and returns it. An exception is thrown if the application has been deleted or any other error occurs.
 * @return  Latest version of this session's application as an{@link ApplicationDefinition}, which is also cahced.
 * @see #getAppDef()
 */
public ApplicationDefinition refreshSchema(){
  try {
    String uri=uriRoot() + "String_Node_Str" + Utils.urlEncode(m_appDef.getAppName());
    RESTResponse response=m_restClient.sendRequest(HttpMethod.GET,uri);
    m_logger.debug("String_Node_Str",response.toString());
    throwIfErrorResponse(response);
    m_appDef.parse(getUNodeResult(response));
    return m_appDef;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Refresh this session's application schema from the database. Since the application's   {@link ApplicationDefinition} is cached, it could be out of dateif the schema has been modified. This method fetches the latest version and returns it. An exception is thrown if the application has been deleted or any other error occurs.
 * @return  Latest version of this session's application as an{@link ApplicationDefinition}, which is also cahced.
 * @see #getAppDef()
 */
public ApplicationDefinition refreshSchema(){
  try {
    StringBuilder uri=new StringBuilder("String_Node_Str");
    uri.append(Utils.urlEncode(m_appDef.getAppName()));
    addTenantParam(uri);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.GET,uri.toString());
    m_logger.debug("String_Node_Str",response.toString());
    throwIfErrorResponse(response);
    m_appDef.parse(getUNodeResult(response));
    return m_appDef;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 29899
Project: 29899
Buggy source:
/** 
 * Get the   {@link ApplicationDefinition} for the given application name. If theconnected Doradus server has no such application defined, null is returned.
 * @param appName   Application name.
 * @return          Application's {@link ApplicationDefinition}, if it exists, otherwise null.
 */
public ApplicationDefinition getAppDef(String appName){
  Utils.require(!m_restClient.isClosed(),"String_Node_Str");
  Utils.require(appName != null && appName.length() > 0,"String_Node_Str");
  try {
    String uri=uriRoot() + "String_Node_Str" + Utils.urlEncode(appName);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.GET,uri);
    m_logger.debug("String_Node_Str",response.toString());
    if (response.getCode() == HttpCode.NOT_FOUND) {
      return null;
    }
    throwIfErrorResponse(response);
    ApplicationDefinition appDef=new ApplicationDefinition();
    appDef.parse(UNode.parse(response.getBody(),response.getContentType()));
    return appDef;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Get the   {@link ApplicationDefinition} for the given application name. If theconnected Doradus server has no such application defined, null is returned.
 * @param appName   Application name.
 * @return          Application's {@link ApplicationDefinition}, if it exists, otherwise null.
 */
public ApplicationDefinition getAppDef(String appName){
  Utils.require(!m_restClient.isClosed(),"String_Node_Str");
  Utils.require(appName != null && appName.length() > 0,"String_Node_Str");
  try {
    StringBuilder uri=new StringBuilder("String_Node_Str");
    uri.append(Utils.urlEncode(appName));
    addTenantParam(uri);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.GET,uri.toString());
    m_logger.debug("String_Node_Str",response.toString());
    if (response.getCode() == HttpCode.NOT_FOUND) {
      return null;
    }
    throwIfErrorResponse(response);
    ApplicationDefinition appDef=new ApplicationDefinition();
    appDef.parse(UNode.parse(response.getBody(),response.getContentType()));
    return appDef;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 29900
Project: 29900
Buggy source:
/** 
 * Get the   {@link ApplicationDefinition} for all applications defined in the tenantidentified by this client's credentials.
 * @return  A collection of all applications defined in the database, possible empty.
 */
public Collection<ApplicationDefinition> getAllAppDefs(){
  Utils.require(!m_restClient.isClosed(),"String_Node_Str");
  try {
    String uri=uriRoot() + "String_Node_Str";
    RESTResponse response=m_restClient.sendRequest(HttpMethod.GET,uri);
    m_logger.debug("String_Node_Str",response.toString());
    throwIfErrorResponse(response);
    UNode rootNode=UNode.parse(response.getBody(),response.getContentType());
    List<ApplicationDefinition> appDefList=new ArrayList<ApplicationDefinition>();
    for (    UNode appNode : rootNode.getMemberList()) {
      ApplicationDefinition appDef=new ApplicationDefinition();
      appDef.parse(appNode);
      appDefList.add(appDef);
    }
    return appDefList;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Get the   {@link ApplicationDefinition} for all applications defined in the tenantidentified by this client's credentials.
 * @return  A collection of all applications defined in the database, possible empty.
 */
public Collection<ApplicationDefinition> getAllAppDefs(){
  Utils.require(!m_restClient.isClosed(),"String_Node_Str");
  try {
    StringBuilder uri=new StringBuilder("String_Node_Str");
    addTenantParam(uri);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.GET,uri.toString());
    m_logger.debug("String_Node_Str",response.toString());
    throwIfErrorResponse(response);
    UNode rootNode=UNode.parse(response.getBody(),response.getContentType());
    List<ApplicationDefinition> appDefList=new ArrayList<ApplicationDefinition>();
    for (    UNode appNode : rootNode.getMemberList()) {
      ApplicationDefinition appDef=new ApplicationDefinition();
      appDef.parse(appNode);
      appDefList.add(appDef);
    }
    return appDefList;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 29901
Project: 29901
Buggy source:
/** 
 * Delete an existing application from the current Doradus tenant, including all of its tables and data. Because updates are idempotent, deleting an already-deleted application is acceptable. Hence, if no error is thrown, the result is always true. An exception is thrown if an error occurs.
 * @param appName   Name of existing application to delete.
 * @param key       Name of key of application to delete. Can be null if theapplication has no key.
 * @return          True if the application was deleted or already deleted.
 */
public boolean deleteApplication(String appName,String key){
  Utils.require(!m_restClient.isClosed(),"String_Node_Str");
  Utils.require(appName != null && appName.length() > 0,"String_Node_Str");
  Utils.require(key != null && key.length() > 0,"String_Node_Str");
  try {
    String uri=uriRoot() + "String_Node_Str" + Utils.urlEncode(appName)+ "String_Node_Str"+ Utils.urlEncode(key);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.DELETE,uri);
    m_logger.debug("String_Node_Str",response.toString());
    if (response.getCode() != HttpCode.NOT_FOUND) {
      throwIfErrorResponse(response);
    }
    return true;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Delete an existing application from the current Doradus tenant, including all of its tables and data. Because updates are idempotent, deleting an already-deleted application is acceptable. Hence, if no error is thrown, the result is always true. An exception is thrown if an error occurs.
 * @param appName   Name of existing application to delete.
 * @param key       Name of key of application to delete. Can be null if theapplication has no key.
 * @return          True if the application was deleted or already deleted.
 */
public boolean deleteApplication(String appName,String key){
  Utils.require(!m_restClient.isClosed(),"String_Node_Str");
  Utils.require(appName != null && appName.length() > 0,"String_Node_Str");
  Utils.require(key != null && key.length() > 0,"String_Node_Str");
  try {
    StringBuilder uri=new StringBuilder("String_Node_Str");
    uri.append(Utils.urlEncode(appName));
    uri.append("String_Node_Str");
    uri.append(Utils.urlEncode(key));
    addTenantParam(uri);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.DELETE,uri.toString());
    m_logger.debug("String_Node_Str",response.toString());
    if (response.getCode() != HttpCode.NOT_FOUND) {
      throwIfErrorResponse(response);
    }
    return true;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 29902
Project: 29902
Buggy source:
/** 
 * Delete the OLAP shard with the given name belonging to this session's application. True is returned if the delete was successful. An exception is thrown if an error occurred.
 * @param shard     Shard name.
 * @return          True if the shard was successfully deleted.
 */
public boolean deleteShard(String shard){
  Utils.require(!Utils.isEmpty(shard),"String_Node_Str");
  try {
    String uri=uriRoot() + Utils.urlEncode(m_appDef.getAppName()) + "String_Node_Str"+ Utils.urlEncode(shard);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.DELETE,uri);
    m_logger.debug("String_Node_Str",response.toString());
    throwIfErrorResponse(response);
    return true;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Delete the OLAP shard with the given name belonging to this session's application. True is returned if the delete was successful. An exception is thrown if an error occurred.
 * @param shard     Shard name.
 * @return          True if the shard was successfully deleted.
 */
public boolean deleteShard(String shard){
  Utils.require(!Utils.isEmpty(shard),"String_Node_Str");
  try {
    StringBuilder uri=new StringBuilder("String_Node_Str");
    uri.append(Utils.urlEncode(m_appDef.getAppName()));
    uri.append("String_Node_Str");
    uri.append(Utils.urlEncode(shard));
    addTenantParam(uri);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.DELETE,uri.toString());
    m_logger.debug("String_Node_Str",response.toString());
    throwIfErrorResponse(response);
    return true;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 29905
Project: 29905
Buggy source:
/** 
 * Add the given batch of objects defined by the given   {@link DBObjectBatch} to thegiven OLAP shard. Objects can belong to different tables, but all tables must belong to this session's application. If the update was successful, the GUID of the segment is returned within the given  {@link BatchResult}. An exception is thrown if an error occurs.
 * @param shard         Name of shard to load.
 * @param dbObjBatch    {@link DBObjectBatch} of objects to add.
 * @return              {@link BatchResult} containing results of the update.
 */
public BatchResult addBatch(String shard,DBObjectBatch dbObjBatch){
  Utils.require(!Utils.isEmpty(shard),"String_Node_Str");
  Utils.require(dbObjBatch != null && dbObjBatch.getObjectCount() > 0,"String_Node_Str");
  try {
    byte[] body=null;
    body=dbObjBatch.toDoc().toCompressedJSON();
    String uri=uriRoot() + Utils.urlEncode(m_appDef.getAppName()) + "String_Node_Str"+ Utils.urlEncode(shard);
    RESTResponse response=m_restClient.sendRequestCompressed(HttpMethod.POST,uri,ContentType.APPLICATION_JSON,body);
    m_logger.debug("String_Node_Str",response.toString());
    return createBatchResult(response);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Add the given batch of objects defined by the given   {@link DBObjectBatch} to thegiven OLAP shard. Objects can belong to different tables, but all tables must belong to this session's application. If the update was successful, the GUID of the segment is returned within the given  {@link BatchResult}. An exception is thrown if an error occurs.
 * @param shard         Name of shard to load.
 * @param dbObjBatch    {@link DBObjectBatch} of objects to add.
 * @return              {@link BatchResult} containing results of the update.
 */
public BatchResult addBatch(String shard,DBObjectBatch dbObjBatch){
  Utils.require(!Utils.isEmpty(shard),"String_Node_Str");
  Utils.require(dbObjBatch != null && dbObjBatch.getObjectCount() > 0,"String_Node_Str");
  try {
    byte[] body=null;
    body=dbObjBatch.toDoc().toCompressedJSON();
    StringBuilder uri=new StringBuilder();
    uri.append(Utils.urlEncode(m_appDef.getAppName()));
    uri.append("String_Node_Str");
    uri.append(Utils.urlEncode(shard));
    addTenantParam(uri);
    RESTResponse response=m_restClient.sendRequestCompressed(HttpMethod.POST,uri.toString(),ContentType.APPLICATION_JSON,body);
    m_logger.debug("String_Node_Str",response.toString());
    return createBatchResult(response);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 29906
Project: 29906
Buggy source:
/** 
 * Delete the objects in the given batch from the given shard. The result of the update is returned as a   {@link BatchResult}.
 * @param shard         Name of the shard from which to delete objects.
 * @param dbObjBatch    {@link DBObjectBatch} of objects to delete.
 * @return              A {@link BatchResult} object containing the results of theupdate request.
 */
@Override public BatchResult deleteBatch(String shard,DBObjectBatch dbObjBatch){
  Utils.require(!Utils.isEmpty(shard),"String_Node_Str");
  Utils.require(dbObjBatch != null && dbObjBatch.getObjectCount() > 0,"String_Node_Str");
  try {
    byte[] body=Utils.toBytes(dbObjBatch.toDoc().toJSON());
    String uri=uriRoot() + Utils.urlEncode(m_appDef.getAppName()) + "String_Node_Str"+ Utils.urlEncode(shard);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.DELETE,uri,ContentType.APPLICATION_JSON,body);
    m_logger.debug("String_Node_Str",response.toString());
    return createBatchResult(response);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Delete the objects in the given batch from the given shard. The result of the update is returned as a   {@link BatchResult}.
 * @param shard         Name of the shard from which to delete objects.
 * @param dbObjBatch    {@link DBObjectBatch} of objects to delete.
 * @return              A {@link BatchResult} object containing the results of theupdate request.
 */
@Override public BatchResult deleteBatch(String shard,DBObjectBatch dbObjBatch){
  Utils.require(!Utils.isEmpty(shard),"String_Node_Str");
  Utils.require(dbObjBatch != null && dbObjBatch.getObjectCount() > 0,"String_Node_Str");
  try {
    byte[] body=Utils.toBytes(dbObjBatch.toDoc().toJSON());
    StringBuilder uri=new StringBuilder();
    uri.append(Utils.urlEncode(m_appDef.getAppName()));
    uri.append("String_Node_Str");
    uri.append(Utils.urlEncode(shard));
    addTenantParam(uri);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.DELETE,uri.toString(),ContentType.APPLICATION_JSON,body);
    m_logger.debug("String_Node_Str",response.toString());
    return createBatchResult(response);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 29907
Project: 29907
Buggy source:
/** 
 * Request a merge of the OLAP shard with the given name belonging to this session's application. Optionally set the shard's expire-date to the given value. True is returned if the merge was successful. An exception is thrown if an error occurred.
 * @param shard         Shard name.
 * @param expireDate    Optional value for shard's new expire-date. Leave null if theshard should have no expiration date.
 * @return              True if the merge was successful.
 */
public boolean mergeShard(String shard,Date expireDate){
  Utils.require(!Utils.isEmpty(shard),"String_Node_Str");
  try {
    StringBuilder uri=new StringBuilder();
    uri.append(uriRoot());
    uri.append(Utils.urlEncode(m_appDef.getAppName()));
    uri.append("String_Node_Str");
    uri.append(Utils.urlEncode(shard));
    if (expireDate != null) {
      uri.append("String_Node_Str");
      uri.append(Utils.urlEncode(Utils.formatDateUTC(expireDate)));
    }
    RESTResponse response=m_restClient.sendRequest(HttpMethod.POST,uri.toString());
    m_logger.debug("String_Node_Str",response.toString());
    throwIfErrorResponse(response);
    return true;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Request a merge of the OLAP shard with the given name belonging to this session's application. Optionally set the shard's expire-date to the given value. True is returned if the merge was successful. An exception is thrown if an error occurred.
 * @param shard         Shard name.
 * @param expireDate    Optional value for shard's new expire-date. Leave null if theshard should have no expiration date.
 * @return              True if the merge was successful.
 */
public boolean mergeShard(String shard,Date expireDate){
  Utils.require(!Utils.isEmpty(shard),"String_Node_Str");
  try {
    StringBuilder uri=new StringBuilder("String_Node_Str");
    uri.append(Utils.urlEncode(m_appDef.getAppName()));
    uri.append("String_Node_Str");
    uri.append(Utils.urlEncode(shard));
    if (expireDate != null) {
      uri.append("String_Node_Str");
      uri.append(Utils.urlEncode(Utils.formatDateUTC(expireDate)));
    }
    addTenantParam(uri);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.POST,uri.toString());
    m_logger.debug("String_Node_Str",response.toString());
    throwIfErrorResponse(response);
    return true;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 29908
Project: 29908
Buggy source:
/** 
 * Get the object with the given ID from the given table. Null is returned if there is no such object.
 * @param tableName     Name of table to get object from. It must belong to thissession's application.
 * @param objectID      Object's ID.
 * @return              {@link DBObject} containing all of the object's scalar and linkfield values, or null if the object does not exist.
 */
public DBObject getObject(String tableName,String objectID){
  Utils.require(!Utils.isEmpty(tableName),"String_Node_Str");
  Utils.require(!Utils.isEmpty(objectID),"String_Node_Str");
  TableDefinition tableDef=m_appDef.getTableDef(tableName);
  Utils.require(tableDef != null,"String_Node_Str",m_appDef.getAppName(),tableName);
  try {
    String uri=uriRoot() + Utils.urlEncode(m_appDef.getAppName()) + "String_Node_Str"+ Utils.urlEncode(tableName)+ "String_Node_Str"+ Utils.urlEncode(objectID);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.GET,uri);
    m_logger.debug("String_Node_Str",response.toString());
    if (response.getCode() != HttpCode.OK) {
      return null;
    }
    return new DBObject().parse(getUNodeResult(response));
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Get the object with the given ID from the given table. Null is returned if there is no such object.
 * @param tableName     Name of table to get object from. It must belong to thissession's application.
 * @param objectID      Object's ID.
 * @return              {@link DBObject} containing all of the object's scalar and linkfield values, or null if the object does not exist.
 */
public DBObject getObject(String tableName,String objectID){
  Utils.require(!Utils.isEmpty(tableName),"String_Node_Str");
  Utils.require(!Utils.isEmpty(objectID),"String_Node_Str");
  TableDefinition tableDef=m_appDef.getTableDef(tableName);
  Utils.require(tableDef != null,"String_Node_Str",m_appDef.getAppName(),tableName);
  try {
    StringBuilder uri=new StringBuilder("String_Node_Str");
    uri.append(Utils.urlEncode(m_appDef.getAppName()));
    uri.append("String_Node_Str");
    uri.append(Utils.urlEncode(tableName));
    uri.append("String_Node_Str");
    uri.append(Utils.urlEncode(objectID));
    addTenantParam(uri);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.GET,uri.toString());
    m_logger.debug("String_Node_Str",response.toString());
    if (response.getCode() != HttpCode.OK) {
      return null;
    }
    return new DBObject().parse(getUNodeResult(response));
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 29911
Project: 29911
Buggy source:
/** 
 * Add the given batch of objects to the given table, which must belong to this session's application. Objects are added if they do not currently exist or do not have an object ID assigned. Otherwise, existing objects are updated. The result of the update is returned as a   {@link BatchResult}.
 * @param tableName     Name of table to update.
 * @param dbObjBatch    {@link DBObjectBatch} of objects to add or update.
 * @return              A {@link BatchResult} object containing the results of theupdate request.
 */
@Override public BatchResult addBatch(String tableName,DBObjectBatch dbObjBatch){
  Utils.require(!Utils.isEmpty(tableName),"String_Node_Str");
  Utils.require(dbObjBatch != null && dbObjBatch.getObjectCount() > 0,"String_Node_Str");
  try {
    byte[] body=Utils.toBytes(dbObjBatch.toDoc().toJSON());
    String uri=uriRoot() + Utils.urlEncode(m_appDef.getAppName()) + "String_Node_Str"+ Utils.urlEncode(tableName);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.POST,uri,ContentType.APPLICATION_JSON,body);
    m_logger.debug("String_Node_Str",response.toString());
    return createBatchResult(response);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Add the given batch of objects to the given table, which must belong to this session's application. Objects are added if they do not currently exist or do not have an object ID assigned. Otherwise, existing objects are updated. The result of the update is returned as a   {@link BatchResult}.
 * @param tableName     Name of table to update.
 * @param dbObjBatch    {@link DBObjectBatch} of objects to add or update.
 * @return              A {@link BatchResult} object containing the results of theupdate request.
 */
@Override public BatchResult addBatch(String tableName,DBObjectBatch dbObjBatch){
  Utils.require(!Utils.isEmpty(tableName),"String_Node_Str");
  Utils.require(dbObjBatch != null && dbObjBatch.getObjectCount() > 0,"String_Node_Str");
  try {
    byte[] body=Utils.toBytes(dbObjBatch.toDoc().toJSON());
    StringBuilder uri=new StringBuilder("String_Node_Str");
    uri.append(Utils.urlEncode(m_appDef.getAppName()));
    uri.append("String_Node_Str");
    uri.append(Utils.urlEncode(tableName));
    addTenantParam(uri);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.POST,uri.toString(),ContentType.APPLICATION_JSON,body);
    m_logger.debug("String_Node_Str",response.toString());
    return createBatchResult(response);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 29912
Project: 29912
Buggy source:
/** 
 * Delete the objects in the given batch from the given table, which must belong to this session's Spider application. All objects in the batch must have IDs. The result of the update is returned as a   {@link BatchResult}.
 * @param tableName     Name of table from which to delete objects.
 * @param dbObjBatch    {@link DBObjectBatch} of objects to delete. The ID must be setfor each contained  {@link DBObject}.
 * @return              A {@link BatchResult} object containing the results of thedelete request.
 */
@Override public BatchResult deleteBatch(String tableName,DBObjectBatch dbObjBatch){
  Utils.require(!Utils.isEmpty(tableName),"String_Node_Str");
  Utils.require(dbObjBatch != null && dbObjBatch.getObjectCount() > 0,"String_Node_Str");
  TableDefinition tableDef=m_appDef.getTableDef(tableName);
  Utils.require(tableDef != null,"String_Node_Str",m_appDef.getAppName(),tableName);
  try {
    byte[] body=Utils.toBytes(dbObjBatch.toDoc().toJSON());
    String uri=uriRoot() + Utils.urlEncode(m_appDef.getAppName()) + "String_Node_Str"+ Utils.urlEncode(tableName);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.DELETE,uri,ContentType.APPLICATION_JSON,body);
    m_logger.debug("String_Node_Str",response.toString());
    return createBatchResult(response);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Delete the objects in the given batch from the given table, which must belong to this session's Spider application. All objects in the batch must have IDs. The result of the update is returned as a   {@link BatchResult}.
 * @param tableName     Name of table from which to delete objects.
 * @param dbObjBatch    {@link DBObjectBatch} of objects to delete. The ID must be setfor each contained  {@link DBObject}.
 * @return              A {@link BatchResult} object containing the results of thedelete request.
 */
@Override public BatchResult deleteBatch(String tableName,DBObjectBatch dbObjBatch){
  Utils.require(!Utils.isEmpty(tableName),"String_Node_Str");
  Utils.require(dbObjBatch != null && dbObjBatch.getObjectCount() > 0,"String_Node_Str");
  TableDefinition tableDef=m_appDef.getTableDef(tableName);
  Utils.require(tableDef != null,"String_Node_Str",m_appDef.getAppName(),tableName);
  try {
    byte[] body=Utils.toBytes(dbObjBatch.toDoc().toJSON());
    StringBuilder uri=new StringBuilder("String_Node_Str");
    uri.append(Utils.urlEncode(m_appDef.getAppName()));
    uri.append("String_Node_Str");
    uri.append(Utils.urlEncode(tableName));
    addTenantParam(uri);
    RESTResponse response=m_restClient.sendRequest(HttpMethod.DELETE,uri.toString(),ContentType.APPLICATION_JSON,body);
    m_logger.debug("String_Node_Str",response.toString());
    return createBatchResult(response);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}