nus-yam/ex-repair huggingface dataset:
Program: 7297
Project: 7297
Buggy source:
/** 
 * Suspend a schedule.
 */
@POST @Path("String_Node_Str") public void suspendSchedule(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String scheduleName){
  programLifecycleHttpHandler.performAction(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,"String_Node_Str",scheduleName,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Suspend a schedule.
 */
@POST @Path("String_Node_Str") public void suspendSchedule(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String scheduleName){
  programLifecycleHttpHandler.performAction(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId,"String_Node_Str",scheduleName,"String_Node_Str");
}
Program: 7298
Project: 7298
Buggy source:
/** 
 * Returns specification of spark program.
 */
@GET @Path("String_Node_Str") public void sparkSpecification(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String sparkId){
  programLifecycleHttpHandler.runnableSpecification(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,ProgramType.SPARK.getCategoryName(),sparkId);
}

Fixed version (ground truth):
/** 
 * Returns specification of spark program.
 */
@GET @Path("String_Node_Str") public void sparkSpecification(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String sparkId){
  programLifecycleHttpHandler.runnableSpecification(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId,ProgramType.SPARK.getCategoryName(),sparkId);
}
Program: 7299
Project: 7299
Buggy source:
/** 
 * Save runnable runtime args.
 */
@PUT @Path("String_Node_Str") public void saveRunnableRuntimeArgs(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String runnableType,@PathParam("String_Node_Str") final String runnableId){
  programLifecycleHttpHandler.saveRunnableRuntimeArgs(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,runnableType,runnableId);
}

Fixed version (ground truth):
/** 
 * Save runnable runtime args.
 */
@PUT @Path("String_Node_Str") public void saveRunnableRuntimeArgs(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String runnableType,@PathParam("String_Node_Str") final String runnableId){
  programLifecycleHttpHandler.saveRunnableRuntimeArgs(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId,runnableType,runnableId);
}
Program: 7300
Project: 7300
Buggy source:
@GET @Path("String_Node_Str") @SuppressWarnings("String_Node_Str") public void flowLiveInfo(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String flowId){
  programLifecycleHttpHandler.liveInfo(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,ProgramType.FLOW.getCategoryName(),flowId);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @SuppressWarnings("String_Node_Str") public void flowLiveInfo(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String flowId){
  programLifecycleHttpHandler.liveInfo(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId,ProgramType.FLOW.getCategoryName(),flowId);
}
Program: 7301
Project: 7301
Buggy source:
/** 
 * Starts a program.
 */
@POST @Path("String_Node_Str") public void startProgram(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String type,@PathParam("String_Node_Str") final String id){
  programLifecycleHttpHandler.performAction(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,type,id,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Starts a program.
 */
@POST @Path("String_Node_Str") public void startProgram(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String type,@PathParam("String_Node_Str") final String id){
  programLifecycleHttpHandler.performAction(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId,type,id,"String_Node_Str");
}
Program: 7302
Project: 7302
Buggy source:
/** 
 * Sets number of instances for a worker.
 */
@PUT @Path("String_Node_Str") public void setWorkerInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String workerId){
  programLifecycleHttpHandler.setWorkerInstances(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,workerId);
}

Fixed version (ground truth):
/** 
 * Sets number of instances for a worker.
 */
@PUT @Path("String_Node_Str") public void setWorkerInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String workerId){
  programLifecycleHttpHandler.setWorkerInstances(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId,workerId);
}
Program: 7303
Project: 7303
Buggy source:
/** 
 * Returns the info associated with the application.
 */
@GET @Path("String_Node_Str") public void getAppInfo(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId){
  appLifecycleHttpHandler.getAppInfo(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId);
}

Fixed version (ground truth):
/** 
 * Returns the info associated with the application.
 */
@GET @Path("String_Node_Str") public void getAppInfo(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId){
  appLifecycleHttpHandler.getAppInfo(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId);
}
Program: 7304
Project: 7304
Buggy source:
/** 
 * Starts a program with debugging enabled.
 */
@POST @Path("String_Node_Str") public void debugProgram(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String type,@PathParam("String_Node_Str") final String id){
  programLifecycleHttpHandler.performAction(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,type,id,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Starts a program with debugging enabled.
 */
@POST @Path("String_Node_Str") public void debugProgram(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String type,@PathParam("String_Node_Str") final String id){
  programLifecycleHttpHandler.performAction(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId,type,id,"String_Node_Str");
}
Program: 7305
Project: 7305
Buggy source:
/** 
 * Returns a list of procedures associated with an account.
 */
@GET @Path("String_Node_Str") public void getAllProcedures(HttpRequest request,HttpResponder responder){
  programLifecycleHttpHandler.getAllProcedures(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE);
}

Fixed version (ground truth):
/** 
 * Returns a list of procedures associated with an account.
 */
@GET @Path("String_Node_Str") public void getAllProcedures(HttpRequest request,HttpResponder responder){
  programLifecycleHttpHandler.getAllProcedures(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE);
}
Program: 7306
Project: 7306
Buggy source:
/** 
 * Stops a program.
 */
@POST @Path("String_Node_Str") public void stopProgram(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String type,@PathParam("String_Node_Str") final String id){
  programLifecycleHttpHandler.performAction(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,type,id,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Stops a program.
 */
@POST @Path("String_Node_Str") public void stopProgram(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String type,@PathParam("String_Node_Str") final String id){
  programLifecycleHttpHandler.performAction(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId,type,id,"String_Node_Str");
}
Program: 7307
Project: 7307
Buggy source:
/** 
 * Returns a list of worker jobs associated with an account.
 */
@GET @Path("String_Node_Str") public void getAllWorkers(HttpRequest request,HttpResponder responder){
  programLifecycleHttpHandler.getAllWorkers(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE);
}

Fixed version (ground truth):
/** 
 * Returns a list of worker jobs associated with an account.
 */
@GET @Path("String_Node_Str") public void getAllWorkers(HttpRequest request,HttpResponder responder){
  programLifecycleHttpHandler.getAllWorkers(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE);
}
Program: 7308
Project: 7308
Buggy source:
@DELETE @Path("String_Node_Str") public void deleteQueues(HttpRequest request,HttpResponder responder){
  programLifecycleHttpHandler.deleteQueues(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE);
}

Fixed version (ground truth):
@DELETE @Path("String_Node_Str") public void deleteQueues(HttpRequest request,HttpResponder responder){
  programLifecycleHttpHandler.deleteQueues(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE);
}
Program: 7310
Project: 7310
Buggy source:
/** 
 * Returns a list of workflows associated with an account.
 */
@GET @Path("String_Node_Str") public void getAllWorkflows(HttpRequest request,HttpResponder responder){
  programLifecycleHttpHandler.getAllWorkflows(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE);
}

Fixed version (ground truth):
/** 
 * Returns a list of workflows associated with an account.
 */
@GET @Path("String_Node_Str") public void getAllWorkflows(HttpRequest request,HttpResponder responder){
  programLifecycleHttpHandler.getAllWorkflows(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE);
}
Program: 7312
Project: 7312
Buggy source:
/** 
 * Delete an application specified by appId.
 */
@DELETE @Path("String_Node_Str") public void deleteApp(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId){
  appLifecycleHttpHandler.deleteApp(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId);
}

Fixed version (ground truth):
/** 
 * Delete an application specified by appId.
 */
@DELETE @Path("String_Node_Str") public void deleteApp(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId){
  appLifecycleHttpHandler.deleteApp(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId);
}
Program: 7313
Project: 7313
Buggy source:
/** 
 * Increases number of instance for a flowlet within a flow.
 */
@PUT @Path("String_Node_Str") public void setFlowletInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String flowId,@PathParam("String_Node_Str") String flowletId){
  programLifecycleHttpHandler.setFlowletInstances(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,flowId,flowletId);
}

Fixed version (ground truth):
/** 
 * Increases number of instance for a flowlet within a flow.
 */
@PUT @Path("String_Node_Str") public void setFlowletInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String flowId,@PathParam("String_Node_Str") String flowletId){
  programLifecycleHttpHandler.setFlowletInstances(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId,flowId,flowletId);
}
Program: 7314
Project: 7314
Buggy source:
/** 
 * Returns specification of mapreduce.
 */
@GET @Path("String_Node_Str") public void mapreduceSpecification(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String mapreduceId){
  programLifecycleHttpHandler.runnableSpecification(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,ProgramType.MAPREDUCE.getCategoryName(),mapreduceId);
}

Fixed version (ground truth):
/** 
 * Returns specification of mapreduce.
 */
@GET @Path("String_Node_Str") public void mapreduceSpecification(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String mapreduceId){
  programLifecycleHttpHandler.runnableSpecification(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId,ProgramType.MAPREDUCE.getCategoryName(),mapreduceId);
}
Program: 7315
Project: 7315
Buggy source:
/** 
 * Deletes all applications in CDAP.
 */
@DELETE @Path("String_Node_Str") public void deleteAllApps(HttpRequest request,HttpResponder responder){
  appLifecycleHttpHandler.deleteAllApps(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE);
}

Fixed version (ground truth):
/** 
 * Deletes all applications in CDAP.
 */
@DELETE @Path("String_Node_Str") public void deleteAllApps(HttpRequest request,HttpResponder responder){
  appLifecycleHttpHandler.deleteAllApps(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE);
}
Program: 7316
Project: 7316
Buggy source:
/** 
 * Returns a list of spark jobs associated with an account.
 */
@GET @Path("String_Node_Str") public void getAllSpark(HttpRequest request,HttpResponder responder){
  programLifecycleHttpHandler.getAllSpark(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE);
}

Fixed version (ground truth):
/** 
 * Returns a list of spark jobs associated with an account.
 */
@GET @Path("String_Node_Str") public void getAllSpark(HttpRequest request,HttpResponder responder){
  programLifecycleHttpHandler.getAllSpark(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE);
}
Program: 7317
Project: 7317
Buggy source:
/** 
 * Get runnable runtime args.
 */
@GET @Path("String_Node_Str") public void getRunnableRuntimeArgs(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String runnableType,@PathParam("String_Node_Str") final String runnableId){
  programLifecycleHttpHandler.getRunnableRuntimeArgs(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,runnableType,runnableId);
}

Fixed version (ground truth):
/** 
 * Get runnable runtime args.
 */
@GET @Path("String_Node_Str") public void getRunnableRuntimeArgs(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String runnableType,@PathParam("String_Node_Str") final String runnableId){
  programLifecycleHttpHandler.getRunnableRuntimeArgs(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId,runnableType,runnableId);
}
Program: 7318
Project: 7318
Buggy source:
/** 
 * Returns specification of procedure.
 */
@GET @Path("String_Node_Str") public void procedureSpecification(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String procId){
  programLifecycleHttpHandler.runnableSpecification(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,ProgramType.PROCEDURE.getCategoryName(),procId);
}

Fixed version (ground truth):
/** 
 * Returns specification of procedure.
 */
@GET @Path("String_Node_Str") public void procedureSpecification(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String procId){
  programLifecycleHttpHandler.runnableSpecification(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId,ProgramType.PROCEDURE.getCategoryName(),procId);
}
Program: 7319
Project: 7319
Buggy source:
/** 
 * Returns a list of workers associated with account & application.
 */
@GET @Path("String_Node_Str") public void getWorkersByApp(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId){
  programLifecycleHttpHandler.getProgramsByApp(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,ProgramType.WORKER.getCategoryName());
}

Fixed version (ground truth):
/** 
 * Returns a list of workers associated with account & application.
 */
@GET @Path("String_Node_Str") public void getWorkersByApp(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId){
  programLifecycleHttpHandler.getWorkersByApp(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId);
}
Program: 7320
Project: 7320
Buggy source:
/** 
 * Returns next scheduled runtime of a workflow.
 */
@GET @Path("String_Node_Str") public void getScheduledRunTime(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String workflowId){
  programLifecycleHttpHandler.getScheduledRunTime(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,workflowId);
}

Fixed version (ground truth):
/** 
 * Returns next scheduled runtime of a workflow.
 */
@GET @Path("String_Node_Str") public void getScheduledRunTime(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String workflowId){
  programLifecycleHttpHandler.getScheduledRunTime(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId,workflowId);
}
Program: 7321
Project: 7321
Buggy source:
/** 
 * Returns number of instances for a flowlet within a flow.
 */
@GET @Path("String_Node_Str") public void getFlowletInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String flowId,@PathParam("String_Node_Str") String flowletId){
  programLifecycleHttpHandler.getFlowletInstances(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,flowId,flowletId);
}

Fixed version (ground truth):
/** 
 * Returns number of instances for a flowlet within a flow.
 */
@GET @Path("String_Node_Str") public void getFlowletInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String flowId,@PathParam("String_Node_Str") String flowletId){
  programLifecycleHttpHandler.getFlowletInstances(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId,flowId,flowletId);
}
Program: 7322
Project: 7322
Buggy source:
/** 
 * Returns a list of flows associated with an account.
 */
@GET @Path("String_Node_Str") public void getAllFlows(HttpRequest request,HttpResponder responder){
  programLifecycleHttpHandler.getAllFlows(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE);
}

Fixed version (ground truth):
/** 
 * Returns a list of flows associated with an account.
 */
@GET @Path("String_Node_Str") public void getAllFlows(HttpRequest request,HttpResponder responder){
  programLifecycleHttpHandler.getAllFlows(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE);
}
Program: 7323
Project: 7323
Buggy source:
/** 
 * Returns a list of procedure associated with account & application.
 */
@GET @Path("String_Node_Str") public void getProceduresByApp(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId){
  programLifecycleHttpHandler.getProgramsByApp(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,ProgramType.PROCEDURE.getCategoryName());
}

Fixed version (ground truth):
/** 
 * Returns a list of procedure associated with account & application.
 */
@GET @Path("String_Node_Str") public void getProceduresByApp(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId){
  programLifecycleHttpHandler.getProgramsByApp(responder,Constants.DEFAULT_NAMESPACE,appId,ProgramType.PROCEDURE.getCategoryName());
}
Program: 7324
Project: 7324
Buggy source:
/** 
 * Returns a list of programs associated with an application within a namespace.
 */
@GET @Path("String_Node_Str") public void getProgramsByApp(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String programCategory){
  ProgramType type=getProgramType(programCategory);
  if (type == null) {
    responder.sendString(HttpResponseStatus.METHOD_NOT_ALLOWED,String.format("String_Node_Str",programCategory));
    return;
  }
  programList(responder,namespaceId,type,appId,store);
}

Fixed version (ground truth):
protected void getProgramsByApp(HttpResponder responder,String namespaceId,String appId,String programCategory){
  ProgramType type=getProgramType(programCategory);
  if (type == null) {
    responder.sendString(HttpResponseStatus.METHOD_NOT_ALLOWED,String.format("String_Node_Str",programCategory));
    return;
  }
  programList(responder,namespaceId,type,appId,store);
}
Program: 7325
Project: 7325
Buggy source:
/** 
 * Return the list of user Services in an application.
 */
@Path("String_Node_Str") @GET public void getServicesByApp(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId){
  programLifecycleHttpHandler.getProgramsByApp(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,ProgramType.SERVICE.getCategoryName());
}

Fixed version (ground truth):
/** 
 * Return the list of user Services in an application.
 */
@Path("String_Node_Str") @GET public void getServicesByApp(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId){
  programLifecycleHttpHandler.getServicesByApp(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId);
}
Program: 7326
Project: 7326
Buggy source:
/** 
 * Returns a list of Services associated with an account.
 */
@GET @Path("String_Node_Str") public void getAllServices(HttpRequest request,HttpResponder responder){
  programLifecycleHttpHandler.getAllServices(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE);
}

Fixed version (ground truth):
/** 
 * Returns a list of Services associated with an account.
 */
@GET @Path("String_Node_Str") public void getAllServices(HttpRequest request,HttpResponder responder){
  programLifecycleHttpHandler.getAllServices(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE);
}
Program: 7327
Project: 7327
Buggy source:
/** 
 * Return the number of instances for the given runnable of a service.
 */
@GET @Path("String_Node_Str") public void getInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String serviceId,@PathParam("String_Node_Str") String runnableName){
  programLifecycleHttpHandler.getServiceInstances(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,serviceId,runnableName);
}

Fixed version (ground truth):
/** 
 * Return the number of instances for the given runnable of a service.
 */
@GET @Path("String_Node_Str") public void getInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String serviceId,@PathParam("String_Node_Str") String runnableName){
  programLifecycleHttpHandler.getServiceInstances(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId,serviceId,runnableName);
}
Program: 7328
Project: 7328
Buggy source:
/** 
 * Set instances.
 */
@PUT @Path("String_Node_Str") public void setInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String serviceId,@PathParam("String_Node_Str") String runnableName){
  programLifecycleHttpHandler.setServiceInstances(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,serviceId,runnableName);
}

Fixed version (ground truth):
/** 
 * Set instances.
 */
@PUT @Path("String_Node_Str") public void setInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String serviceId,@PathParam("String_Node_Str") String runnableName){
  programLifecycleHttpHandler.setServiceInstances(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId,serviceId,runnableName);
}
Program: 7329
Project: 7329
Buggy source:
@GET @Path("String_Node_Str") public void serviceLiveInfo(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String serviceId){
  programLifecycleHttpHandler.liveInfo(rewriteRequest(request),responder,Constants.DEFAULT_NAMESPACE,appId,ProgramType.SERVICE.getCategoryName(),serviceId);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void serviceLiveInfo(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String serviceId){
  programLifecycleHttpHandler.liveInfo(RESTMigrationUtils.rewriteV2RequestToV3(request),responder,Constants.DEFAULT_NAMESPACE,appId,ProgramType.SERVICE.getCategoryName(),serviceId);
}
Program: 7331
Project: 7331
Buggy source:
private T readRow(Row row){
  try {
    if (row.isEmpty()) {
      return null;
    }
    return rowReader.read(row,objectSchema);
  }
 catch (  Exception e) {
    throw new DataSetException("String_Node_Str" + e.getMessage(),e);
  }
}

Fixed version (ground truth):
private T readRow(Row row){
  try {
    if (row.isEmpty()) {
      return null;
    }
    return getReflectionRowReader().read(row,objectSchema);
  }
 catch (  Exception e) {
    throw new DataSetException("String_Node_Str" + e.getMessage(),e);
  }
}
Program: 7332
Project: 7332
Buggy source:
@SuppressWarnings("String_Node_Str") public ObjectMappedTableDataset(String name,Table table,TypeRepresentation typeRep,Schema objectSchema,String keyName,Schema.Type keyType,@Nullable ClassLoader classLoader){
  super(name,table);
  Preconditions.checkArgument(keyType == Schema.Type.STRING || keyType == Schema.Type.BYTES,"String_Node_Str");
  this.table=table;
  this.objectSchema=objectSchema;
  this.tableSchema=getTableSchema(objectSchema,keyName,keyType);
  this.keyName=keyName;
  this.keyType=keyType;
  typeRep.setClassLoader(classLoader);
  Type type=typeRep.toType();
  this.putWriter=new ReflectionPutWriter<T>(objectSchema);
  this.rowReader=new ReflectionRowReader<T>(objectSchema,(TypeToken<T>)TypeToken.of(type));
}

Fixed version (ground truth):
public ObjectMappedTableDataset(String name,Table table,TypeRepresentation typeRep,Schema objectSchema,String keyName,Schema.Type keyType,@Nullable ClassLoader classLoader){
  super(name,table);
  Preconditions.checkArgument(keyType == Schema.Type.STRING || keyType == Schema.Type.BYTES,"String_Node_Str");
  this.table=table;
  this.objectSchema=objectSchema;
  this.tableSchema=getTableSchema(objectSchema,keyName,keyType);
  this.keyName=keyName;
  this.keyType=keyType;
  this.typeRepresentation=typeRep;
  this.typeRepresentation.setClassLoader(classLoader);
  this.putWriter=new ReflectionPutWriter<T>(objectSchema);
}
Program: 7333
Project: 7333
Buggy source:
@Override public void register(DatasetDefinitionRegistry registry){
  DatasetDefinition<Table,? extends DatasetAdmin> tableDef=registry.get("String_Node_Str");
  registry.add(new ObjectMappedTableDefinition(ObjectMappedTable.class.getName(),tableDef));
  registry.add(new ObjectMappedTableDefinition("String_Node_Str",tableDef));
}

Fixed version (ground truth):
@Override public void register(DatasetDefinitionRegistry registry){
  DatasetDefinition<Table,? extends DatasetAdmin> tableDef=registry.get("String_Node_Str");
  registry.add(new ObjectMappedTableDefinition(FULL_NAME,tableDef));
  registry.add(new ObjectMappedTableDefinition(SHORT_NAME,tableDef));
}
Program: 7334
Project: 7334
Buggy source:
@Override public void configure(){
  setName(APP_NAME);
  setDescription("String_Node_Str");
  addStream(new Stream("String_Node_Str"));
  createDataset("String_Node_Str",KeyValueTable.class);
  createDataset("String_Node_Str",KeyValueTable.class);
  addFlow(new PurchaseFlow());
  addMapReduce(new PurchaseHistoryBuilder());
  addWorkflow(new PurchaseHistoryWorkflow());
  addService(new PurchaseHistoryService());
  addService(UserProfileServiceHandler.SERVICE_NAME,new UserProfileServiceHandler());
  addService(new CatalogLookupService());
  scheduleWorkflow(Schedules.createTimeSchedule("String_Node_Str","String_Node_Str","String_Node_Str"),"String_Node_Str");
  try {
    createDataset("String_Node_Str",PurchaseHistoryStore.class,PurchaseHistoryStore.properties());
    createDataset("String_Node_Str",ObjectMappedTable.class,ObjectMappedTableProperties.builder().setType(Purchase.class).build());
  }
 catch (  UnsupportedTypeException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public void configure(){
  setName(APP_NAME);
  setDescription("String_Node_Str");
  addStream(new Stream("String_Node_Str"));
  createDataset("String_Node_Str",KeyValueTable.class);
  createDataset("String_Node_Str",KeyValueTable.class);
  addFlow(new PurchaseFlow());
  addMapReduce(new PurchaseHistoryBuilder());
  addWorkflow(new PurchaseHistoryWorkflow());
  addService(new PurchaseHistoryService());
  addService(UserProfileServiceHandler.SERVICE_NAME,new UserProfileServiceHandler());
  addService(new CatalogLookupService());
  scheduleWorkflow(Schedules.createTimeSchedule("String_Node_Str","String_Node_Str","String_Node_Str"),"String_Node_Str");
  try {
    createDataset("String_Node_Str",PurchaseHistoryStore.class,PurchaseHistoryStore.properties());
    createDataset("String_Node_Str",ObjectMappedTable.class,ObjectMappedTableProperties.builder().setType(Purchase.class).setExploreKeyType(Schema.Type.STRING).build());
  }
 catch (  UnsupportedTypeException e) {
    throw new RuntimeException(e);
  }
}
Program: 7335
Project: 7335
Buggy source:
/** 
 * Creates properties for   {@link ObjectStore} dataset instance.
 * @param type type of objects to be stored in dataset
 * @return {@link DatasetProperties} for the dataset
 * @throws UnsupportedTypeException
 */
public static DatasetProperties objectStoreProperties(Type type,DatasetProperties props) throws UnsupportedTypeException {
  Schema schema=new ReflectionSchemaGenerator().generate(type);
  TypeRepresentation typeRep=new TypeRepresentation(type);
  return DatasetProperties.builder().add("String_Node_Str",GSON.toJson(schema)).add("String_Node_Str",GSON.toJson(typeRep)).addAll(props.getProperties()).build();
}

Fixed version (ground truth):
/** 
 * Creates properties for   {@link ObjectStore} dataset instance.
 * @param type type of objects to be stored in dataset
 * @return {@link DatasetProperties} for the dataset
 * @throws UnsupportedTypeException
 */
public static DatasetProperties objectStoreProperties(Type type,DatasetProperties props) throws UnsupportedTypeException {
  Schema schema=new ReflectionSchemaGenerator().generate(type);
  TypeRepresentation typeRep=new TypeRepresentation(type);
  return DatasetProperties.builder().add("String_Node_Str",schema.toString()).add("String_Node_Str",GSON.toJson(typeRep)).addAll(props.getProperties()).build();
}
Program: 7336
Project: 7336
Buggy source:
private String listDataEntitiesByApp(Store store,DatasetFramework dsFramework,Id.Program programId,Data type) throws Exception {
  Id.Namespace namespace=new Id.Namespace(programId.getNamespaceId());
  ApplicationSpecification appSpec=store.getApplication(new Id.Application(namespace,programId.getApplicationId()));
  if (type == Data.DATASET) {
    Set<String> dataSetsUsed=dataSetsUsedBy(appSpec);
    List<DatasetRecord> result=Lists.newArrayListWithExpectedSize(dataSetsUsed.size());
    for (    String dsName : dataSetsUsed) {
      String typeName=null;
      DatasetSpecification dsSpec=getDatasetSpec(dsFramework,namespace,dsName);
      if (dsSpec != null) {
        typeName=dsSpec.getType();
      }
      result.add(makeDataSetRecord(dsName,typeName));
    }
    return GSON.toJson(result);
  }
  if (type == Data.STREAM) {
    Set<String> streamsUsed=streamsUsedBy(appSpec);
    List<StreamRecord> result=Lists.newArrayListWithExpectedSize(streamsUsed.size());
    for (    String streamName : streamsUsed) {
      result.add(makeStreamRecord(streamName,null));
    }
    return GSON.toJson(result);
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
private String listDataEntitiesByApp(Store store,DatasetFramework dsFramework,Id.Program programId,Data type) throws Exception {
  Id.Namespace namespace=new Id.Namespace(programId.getNamespaceId());
  ApplicationSpecification appSpec=store.getApplication(new Id.Application(namespace,programId.getApplicationId()));
  if (appSpec == null) {
    return "String_Node_Str";
  }
  if (type == Data.DATASET) {
    Set<String> dataSetsUsed=dataSetsUsedBy(appSpec);
    List<DatasetRecord> result=Lists.newArrayListWithExpectedSize(dataSetsUsed.size());
    for (    String dsName : dataSetsUsed) {
      String typeName=null;
      DatasetSpecification dsSpec=getDatasetSpec(dsFramework,namespace,dsName);
      if (dsSpec != null) {
        typeName=dsSpec.getType();
      }
      result.add(makeDataSetRecord(dsName,typeName));
    }
    return GSON.toJson(result);
  }
  if (type == Data.STREAM) {
    Set<String> streamsUsed=streamsUsedBy(appSpec);
    List<StreamRecord> result=Lists.newArrayListWithExpectedSize(streamsUsed.size());
    for (    String streamName : streamsUsed) {
      result.add(makeStreamRecord(streamName,null));
    }
    return GSON.toJson(result);
  }
  return "String_Node_Str";
}
Program: 7337
Project: 7337
Buggy source:
@Override public Object deserialize(Writable writable) throws SerDeException {
  try {
    ObjectWritable objectWritable=(ObjectWritable)writable;
    return deserializer.deserialize(objectWritable.get());
  }
 catch (  Throwable t) {
    LOG.info("String_Node_Str",t);
    throw new SerDeException("String_Node_Str",t);
  }
}

Fixed version (ground truth):
@Override public Object deserialize(Writable writable) throws SerDeException {
  ObjectWritable objectWritable=(ObjectWritable)writable;
  Object obj=objectWritable.get();
  try {
    return deserializer.deserialize(obj);
  }
 catch (  Throwable t) {
    LOG.error("String_Node_Str",obj,t);
    throw new SerDeException("String_Node_Str",t);
  }
}
Program: 7340
Project: 7340
Buggy source:
@Override public <T extends DatasetDefinition>T get(String datasetTypeName){
  T def;
  Id.DatasetType datasetTypeId=Id.DatasetType.from(namespaceId,datasetTypeName);
  if (registry.hasType(datasetTypeName)) {
    def=registry.get(datasetTypeName);
  }
 else {
    DatasetTypeMeta typeMeta=datasets.getTypeMDS().getType(datasetTypeId);
    if (typeMeta == null) {
      datasetTypeId=Id.DatasetType.from(Constants.SYSTEM_NAMESPACE_ID,datasetTypeName);
      typeMeta=datasets.getTypeMDS().getType(datasetTypeId);
      if (typeMeta == null) {
        throw new IllegalArgumentException("String_Node_Str" + datasetTypeName);
      }
    }
    try {
      def=new DatasetDefinitionLoader(locationFactory).load(typeMeta,registry);
    }
 catch (    IOException e) {
      throw Throwables.propagate(e);
    }
  }
  usedTypes.add(datasetTypeId);
  return def;
}

Fixed version (ground truth):
@Override public <T extends DatasetDefinition>T get(String datasetTypeName){
  T def;
  Id.DatasetType datasetTypeId=Id.DatasetType.from(namespaceId,datasetTypeName);
  DatasetTypeMeta typeMeta=datasets.getTypeMDS().getType(datasetTypeId);
  if (typeMeta == null) {
    datasetTypeId=Id.DatasetType.from(Constants.SYSTEM_NAMESPACE_ID,datasetTypeName);
    typeMeta=datasets.getTypeMDS().getType(datasetTypeId);
    if (typeMeta == null) {
      throw new IllegalArgumentException("String_Node_Str" + datasetTypeName);
    }
  }
  if (registry.hasType(datasetTypeName)) {
    def=registry.get(datasetTypeName);
  }
 else {
    try {
      def=new DatasetDefinitionLoader(locationFactory).load(typeMeta,registry);
    }
 catch (    IOException e) {
      throw Throwables.propagate(e);
    }
  }
  usedTypes.add(datasetTypeId);
  return def;
}
Program: 7341
Project: 7341
Buggy source:
private Store getStore(){
  if (store == null) {
    store=storeFactory.create();
  }
  return store;
}

Fixed version (ground truth):
private synchronized Store getStore(){
  if (store == null) {
    store=storeFactory.create();
  }
  return store;
}
Program: 7342
Project: 7342
Buggy source:
@Override public void run(){
  if (activeTasks > 0) {
    long size=pollStream();
    received(new StreamSizeNotification(System.currentTimeMillis(),size),null);
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (activeTasks.get() > 0) {
    long size=pollStream();
    received(new StreamSizeNotification(System.currentTimeMillis(),size),null);
  }
}
Program: 7343
Project: 7343
Buggy source:
private StreamSubscriber(Id.Stream streamId){
  this.streamId=streamId;
  this.scheduleTasks=Maps.newConcurrentMap();
  this.activeTasks=0;
}

Fixed version (ground truth):
private StreamSubscriber(Id.Stream streamId){
  this.streamId=streamId;
  this.scheduleTasks=Maps.newConcurrentMap();
  this.lastNotificationLock=new Object();
  this.activeTasks=new AtomicInteger(0);
}
Program: 7344
Project: 7344
Buggy source:
/** 
 * Add a new scheduling task based on the data received by the stream referenced by   {@code this} object.
 */
public void createScheduleTask(Id.Program programId,SchedulableProgramType programType,StreamSizeSchedule streamSizeSchedule,boolean active,long baseRunSize,long baseRunTs,boolean persist){
  StreamSizeScheduleTask newTask=new StreamSizeScheduleTask(programId,programType,streamSizeSchedule);
synchronized (this) {
    StreamSizeScheduleTask previous=scheduleTasks.putIfAbsent(getScheduleId(programId,programType,streamSizeSchedule.getName()),newTask);
    if (previous == null) {
      if (active) {
        activeTasks++;
      }
      if (baseRunSize == -1 && baseRunTs == -1) {
        long baseTs=System.currentTimeMillis();
        long baseSize=pollStream();
        newTask.startSchedule(baseSize,baseTs,active,persist);
        lastNotification=new StreamSizeNotification(baseTs,baseSize);
        received(lastNotification,null);
      }
 else {
        newTask.startSchedule(baseRunSize,baseRunTs,active,persist);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Add a new scheduling task based on the data received by the stream referenced by   {@code this} object.
 */
public void createScheduleTask(Id.Program programId,SchedulableProgramType programType,StreamSizeSchedule streamSizeSchedule,boolean active,long baseRunSize,long baseRunTs,boolean persist){
  StreamSizeScheduleTask newTask=new StreamSizeScheduleTask(programId,programType,streamSizeSchedule);
  StreamSizeScheduleTask previous=scheduleTasks.putIfAbsent(getScheduleId(programId,programType,streamSizeSchedule.getName()),newTask);
  if (previous != null) {
    return;
  }
  if (baseRunSize == -1 && baseRunTs == -1) {
    long baseTs=System.currentTimeMillis();
    long baseSize=pollStream();
    newTask.startSchedule(baseSize,baseTs,active,persist);
synchronized (lastNotificationLock) {
      lastNotification=new StreamSizeNotification(baseTs,baseSize);
    }
  }
 else {
    newTask.startSchedule(baseRunSize,baseRunTs,active,persist);
  }
  if (active) {
    activeTasks.incrementAndGet();
  }
  if (lastNotification != null) {
    received(lastNotification,null);
  }
}
Program: 7345
Project: 7345
Buggy source:
/** 
 * Delete a scheduling task that is based on the data received by the stream referenced by   {@code this} object.
 */
public void deleteSchedule(Id.Program programId,SchedulableProgramType programType,String scheduleName){
  StreamSizeScheduleTask scheduleTask=scheduleTasks.remove(getScheduleId(programId,programType,scheduleName));
  if (scheduleTask != null && scheduleTask.isRunning()) {
    activeTasks--;
  }
}

Fixed version (ground truth):
/** 
 * Delete a scheduling task that is based on the data received by the stream referenced by   {@code this} object.
 */
public void deleteSchedule(Id.Program programId,SchedulableProgramType programType,String scheduleName){
  StreamSizeScheduleTask scheduleTask=scheduleTasks.remove(getScheduleId(programId,programType,scheduleName));
  if (scheduleTask != null && scheduleTask.isRunning()) {
    activeTasks.decrementAndGet();
  }
}
Program: 7346
Project: 7346
Buggy source:
/** 
 * Suspend a scheduling task that is based on the data received by the stream referenced by   {@code this} object.
 */
public void suspendScheduleTask(Id.Program programId,SchedulableProgramType programType,String scheduleName){
  StreamSizeScheduleTask task=scheduleTasks.get(getScheduleId(programId,programType,scheduleName));
  if (task == null) {
    return;
  }
synchronized (this) {
    if (task.suspend()) {
      activeTasks--;
    }
  }
}

Fixed version (ground truth):
/** 
 * Suspend a scheduling task that is based on the data received by the stream referenced by   {@code this} object.
 */
public void suspendScheduleTask(Id.Program programId,SchedulableProgramType programType,String scheduleName){
  StreamSizeScheduleTask task=scheduleTasks.get(getScheduleId(programId,programType,scheduleName));
  if (task == null) {
    return;
  }
synchronized (this) {
    if (task.suspend()) {
      activeTasks.decrementAndGet();
    }
  }
}
Program: 7347
Project: 7347
Buggy source:
public void received(StreamSizeNotification notification){
  long pastRunSize;
  long pastRunTs;
synchronized (this) {
    if (notification.getSize() < baseSize) {
      baseSize=notification.getSize();
      baseTs=notification.getTimestamp();
      return;
    }
    if (notification.getSize() < baseSize + toBytes(streamSizeSchedule.getDataTriggerMB())) {
      return;
    }
    pastRunSize=baseSize;
    pastRunTs=baseTs;
    baseSize=notification.getSize();
    baseTs=notification.getTimestamp();
    LOG.debug("String_Node_Str",baseSize,baseTs,streamSizeSchedule);
  }
  Arguments args=new BasicArguments(ImmutableMap.of(ProgramOptionConstants.SCHEDULE_NAME,streamSizeSchedule.getName(),ProgramOptionConstants.LOGICAL_START_TIME,Long.toString(baseTs),ProgramOptionConstants.RUN_DATA_SIZE,Long.toString(baseSize),ProgramOptionConstants.PAST_RUN_LOGICAL_START_TIME,Long.toString(pastRunTs),ProgramOptionConstants.PAST_RUN_DATA_SIZE,Long.toString(pastRunSize)));
  while (true) {
    ScheduleTaskRunner taskRunner=new ScheduleTaskRunner(getStore(),programRuntimeService,preferencesStore);
    try {
      LOG.info("String_Node_Str",streamSizeSchedule);
      taskRunner.run(programId,ProgramType.valueOf(programType.name()),args);
      break;
    }
 catch (    TaskExecutionException e) {
      LOG.error("String_Node_Str",streamSizeSchedule.getName(),e);
      if (e.isRefireImmediately()) {
        LOG.info("String_Node_Str",streamSizeSchedule.getName());
      }
 else {
        break;
      }
    }
  }
}

Fixed version (ground truth):
public void received(StreamSizeNotification notification){
  if (!running) {
    return;
  }
  long pastRunSize;
  long pastRunTs;
synchronized (this) {
    if (notification.getSize() < baseSize) {
      baseSize=notification.getSize();
      baseTs=notification.getTimestamp();
      return;
    }
    if (notification.getSize() < baseSize + toBytes(streamSizeSchedule.getDataTriggerMB())) {
      return;
    }
    pastRunSize=baseSize;
    pastRunTs=baseTs;
    baseSize=notification.getSize();
    baseTs=notification.getTimestamp();
    LOG.debug("String_Node_Str",baseSize,baseTs,streamSizeSchedule);
  }
  Arguments args=new BasicArguments(ImmutableMap.of(ProgramOptionConstants.SCHEDULE_NAME,streamSizeSchedule.getName(),ProgramOptionConstants.LOGICAL_START_TIME,Long.toString(baseTs),ProgramOptionConstants.RUN_DATA_SIZE,Long.toString(baseSize),ProgramOptionConstants.PAST_RUN_LOGICAL_START_TIME,Long.toString(pastRunTs),ProgramOptionConstants.PAST_RUN_DATA_SIZE,Long.toString(pastRunSize)));
  while (true) {
    ScheduleTaskRunner taskRunner=new ScheduleTaskRunner(getStore(),programRuntimeService,preferencesStore);
    try {
      LOG.info("String_Node_Str",streamSizeSchedule);
      taskRunner.run(programId,ProgramType.valueOf(programType.name()),args);
      break;
    }
 catch (    TaskExecutionException e) {
      LOG.error("String_Node_Str",streamSizeSchedule.getName(),e);
      if (e.isRefireImmediately()) {
        LOG.info("String_Node_Str",streamSizeSchedule.getName());
      }
 else {
        break;
      }
    }
  }
}
Program: 7348
Project: 7348
Buggy source:
/** 
 * Resume a scheduling task that is based on the data received by the stream referenced by   {@code this} object.
 */
public void resumeScheduleTask(Id.Program programId,SchedulableProgramType programType,String scheduleName){
synchronized (this) {
    StreamSizeScheduleTask task=scheduleTasks.get(getScheduleId(programId,programType,scheduleName));
    if (task == null) {
      return;
    }
    if (task.resume() && ++activeTasks == 1) {
      if (lastNotification != null) {
        long lastNotificationTs=lastNotification.getTimestamp();
        if (lastNotificationTs + TimeUnit.SECONDS.toMillis(pollingDelay) <= System.currentTimeMillis()) {
          long streamSize=pollStream();
          lastNotification=new StreamSizeNotification(System.currentTimeMillis(),streamSize);
        }
      }
    }
    if (lastNotification != null) {
      task.received(lastNotification);
    }
  }
}

Fixed version (ground truth):
/** 
 * Resume a scheduling task that is based on the data received by the stream referenced by   {@code this} object.
 */
public void resumeScheduleTask(Id.Program programId,SchedulableProgramType programType,String scheduleName){
  StreamSizeScheduleTask task=scheduleTasks.get(getScheduleId(programId,programType,scheduleName));
  if (task == null || !task.resume()) {
    return;
  }
  if (activeTasks.incrementAndGet() == 1) {
synchronized (lastNotificationLock) {
      if (lastNotification == null || (lastNotification.getTimestamp() + TimeUnit.SECONDS.toMillis(pollingDelay) <= System.currentTimeMillis())) {
        long streamSize=pollStream();
        lastNotification=new StreamSizeNotification(System.currentTimeMillis(),streamSize);
      }
    }
  }
  task.received(lastNotification);
}
Program: 7349
Project: 7349
Buggy source:
/** 
 * @return a runnable that uses the {@link StreamAdmin} to poll the stream size, and creates a fake notificationwith that size, so that this information can be treated as if it came from a real notification.
 */
private Runnable createPollingRunnable(){
  return new Runnable(){
    @Override public void run(){
      if (activeTasks > 0) {
        long size=pollStream();
        received(new StreamSizeNotification(System.currentTimeMillis(),size),null);
      }
    }
  }
;
}

Fixed version (ground truth):
/** 
 * @return a runnable that uses the {@link StreamAdmin} to poll the stream size, and creates a fake notificationwith that size, so that this information can be treated as if it came from a real notification.
 */
private Runnable createPollingRunnable(){
  return new Runnable(){
    @Override public void run(){
      if (activeTasks.get() > 0) {
        long size=pollStream();
        received(new StreamSizeNotification(System.currentTimeMillis(),size),null);
      }
    }
  }
;
}
Program: 7350
Project: 7350
Buggy source:
public static void resetAll() throws Exception {
  metricStore.deleteBefore(System.currentTimeMillis());
}

Fixed version (ground truth):
public static void resetAll() throws Exception {
  metricStore.deleteBefore(System.currentTimeMillis() / 1000);
}