nus-yam/ex-repair huggingface dataset:
Program: 7029
Project: 7029
Buggy source:
/** 
 * Construct the Standalone AppFabricServer with service factory and configuration coming from guice injection.
 */
@Inject public StandaloneAppFabricServer(CConfiguration configuration,DiscoveryService discoveryService,SchedulerService schedulerService,NotificationService notificationService,@Named(Constants.AppFabric.SERVER_ADDRESS) InetAddress hostname,@Named(Constants.AppFabric.HANDLERS_BINDING) Set<HttpHandler> handlers,@Nullable MetricsCollectionService metricsCollectionService,ProgramRuntimeService programRuntimeService,AdapterService adapterService,ApplicationLifecycleService applicationLifecycleService,StreamCoordinatorClient streamCoordinatorClient,@Named("String_Node_Str") Set<String> servicesNames,@Named("String_Node_Str") Set<String> handlerHookNames,NamespaceAdmin namespaceAdmin,MetricStore metricStore){
  super(configuration,discoveryService,schedulerService,notificationService,hostname,handlers,metricsCollectionService,programRuntimeService,adapterService,applicationLifecycleService,streamCoordinatorClient,servicesNames,handlerHookNames,namespaceAdmin);
  this.metricStore=metricStore;
}

Fixed version (ground truth):
/** 
 * Construct the Standalone AppFabricServer with service factory and configuration coming from guice injection.
 */
@Inject public StandaloneAppFabricServer(CConfiguration configuration,DiscoveryService discoveryService,SchedulerService schedulerService,NotificationService notificationService,@Named(Constants.AppFabric.SERVER_ADDRESS) InetAddress hostname,@Named(Constants.AppFabric.HANDLERS_BINDING) Set<HttpHandler> handlers,@Nullable MetricsCollectionService metricsCollectionService,ProgramRuntimeService programRuntimeService,AdapterService adapterService,ApplicationLifecycleService applicationLifecycleService,ProgramLifecycleService programLifecycleService,StreamCoordinatorClient streamCoordinatorClient,@Named("String_Node_Str") Set<String> servicesNames,@Named("String_Node_Str") Set<String> handlerHookNames,NamespaceAdmin namespaceAdmin,MetricStore metricStore){
  super(configuration,discoveryService,schedulerService,notificationService,hostname,handlers,metricsCollectionService,programRuntimeService,adapterService,applicationLifecycleService,programLifecycleService,streamCoordinatorClient,servicesNames,handlerHookNames,namespaceAdmin);
  this.metricStore=metricStore;
}
Program: 7030
Project: 7030
Buggy source:
WorkflowDriver(Program program,ProgramOptions options,InetAddress hostname,WorkflowSpecification workflowSpec,ProgramRunnerFactory programRunnerFactory){
  this.program=program;
  this.hostname=hostname;
  this.runtimeArgs=createRuntimeArgs(options.getUserArguments());
  this.workflowSpec=workflowSpec;
  Arguments arguments=options.getArguments();
  this.logicalStartTime=arguments.hasOption(ProgramOptionConstants.LOGICAL_START_TIME) ? Long.parseLong(arguments.getOption(ProgramOptionConstants.LOGICAL_START_TIME)) : System.currentTimeMillis();
  this.workflowProgramRunnerFactory=new ProgramWorkflowRunnerFactory(workflowSpec,programRunnerFactory,program,options);
  lock=new ReentrantLock();
  condition=lock.newCondition();
  loggingContext=new WorkflowLoggingContext(program.getNamespaceId(),program.getApplicationId(),program.getName(),options.getArguments().getOption(ProgramOptionConstants.RUN_ID));
}

Fixed version (ground truth):
WorkflowDriver(Program program,ProgramOptions options,InetAddress hostname,WorkflowSpecification workflowSpec,ProgramRunnerFactory programRunnerFactory){
  this.program=program;
  this.hostname=hostname;
  this.runtimeArgs=createRuntimeArgs(options.getUserArguments());
  this.workflowSpec=workflowSpec;
  Arguments arguments=options.getArguments();
  this.logicalStartTime=arguments.hasOption(ProgramOptionConstants.LOGICAL_START_TIME) ? Long.parseLong(arguments.getOption(ProgramOptionConstants.LOGICAL_START_TIME)) : System.currentTimeMillis();
  this.workflowProgramRunnerFactory=new ProgramWorkflowRunnerFactory(workflowSpec,programRunnerFactory,program,options);
  this.lock=new ReentrantLock();
  this.condition=lock.newCondition();
  String adapterSpec=arguments.getOption(ProgramOptionConstants.ADAPTER_SPEC);
  String adapterName=null;
  if (adapterSpec != null) {
    adapterName=GSON.fromJson(adapterSpec,AdapterDefinition.class).getName();
  }
  this.loggingContext=new WorkflowLoggingContext(program.getNamespaceId(),program.getApplicationId(),program.getName(),arguments.getOption(ProgramOptionConstants.RUN_ID),adapterName);
}
Program: 7031
Project: 7031
Buggy source:
private void testPrev(String appId,String entityType,String entityId,String namespace,@Nullable String adapteId) throws Exception {
  String prevUrl=String.format("String_Node_Str",appId,entityType,entityId,getToOffset(25));
  prevUrl=getUrlWithAdapterId(prevUrl,adapteId,"String_Node_Str");
  HttpResponse response=doGet(getVersionedAPIPath(prevUrl,namespace));
  Assert.assertEquals(HttpResponseStatus.OK.getCode(),response.getStatusLine().getStatusCode());
  String out=EntityUtils.toString(response.getEntity());
  List<LogLine> logLines=GSON.fromJson(out,LIST_LOGLINE_TYPE);
  Assert.assertEquals(10,logLines.size());
  int expected=15;
  for (  LogLine logLine : logLines) {
    Assert.assertEquals(expected,logLine.getOffset().getKafkaOffset());
    Assert.assertEquals(expected,logLine.getOffset().getTime());
    String expectedStr=entityId + "String_Node_Str" + expected+ "String_Node_Str";
    String log=logLine.getLog();
    Assert.assertEquals(expectedStr,log.substring(log.length() - expectedStr.length()));
    expected++;
  }
}

Fixed version (ground truth):
private void testPrev(String appId,String entityType,String entityId,String namespace,@Nullable String adapterId) throws Exception {
  String prevUrl=String.format("String_Node_Str",appId,entityType,entityId,getToOffset(25));
  prevUrl=getUrlWithAdapterId(prevUrl,adapterId,"String_Node_Str");
  HttpResponse response=doGet(getVersionedAPIPath(prevUrl,namespace));
  Assert.assertEquals(HttpResponseStatus.OK.getCode(),response.getStatusLine().getStatusCode());
  String out=EntityUtils.toString(response.getEntity());
  List<LogLine> logLines=GSON.fromJson(out,LIST_LOGLINE_TYPE);
  Assert.assertEquals(10,logLines.size());
  int expected=15;
  for (  LogLine logLine : logLines) {
    Assert.assertEquals(expected,logLine.getOffset().getKafkaOffset());
    Assert.assertEquals(expected,logLine.getOffset().getTime());
    String expectedStr=entityId + "String_Node_Str" + expected+ "String_Node_Str";
    String log=logLine.getLog();
    Assert.assertEquals(expectedStr,log.substring(log.length() - expectedStr.length()));
    expected++;
  }
}
Program: 7032
Project: 7032
Buggy source:
@Test public void testMapReduceLogs() throws Exception {
  testLogs("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
  testLogsFilter("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
  try {
    testLogsFilter("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
    Assert.fail();
  }
 catch (  AssertionError e) {
  }
  testLogsRunId("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
}

Fixed version (ground truth):
@Test public void testMapReduceLogs() throws Exception {
  testLogs("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
  testLogsFilter("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
  testLogsRunId("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
  try {
    testLogsFilter("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,null);
  }
 catch (  AssertionError e) {
    return;
  }
  Assert.fail();
}
Program: 7033
Project: 7033
Buggy source:
@Test public void testAdapterLogsPrev() throws Exception {
  testPrev("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  testPrevNoMax("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  try {
    testPrevNoMax("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,"String_Node_Str");
    Assert.fail();
  }
 catch (  AssertionError e) {
  }
  testPrevFilter("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  testPrevNoFrom("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testAdapterLogsPrev() throws Exception {
  testPrev("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  testPrevNoMax("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  testPrevFilter("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  testPrevNoFrom("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  try {
    testPrevNoMax("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,"String_Node_Str");
  }
 catch (  AssertionError e) {
    return;
  }
  Assert.fail();
}
Program: 7034
Project: 7034
Buggy source:
@Test public void testAdapterLogsNext() throws Exception {
  testNext("String_Node_Str","String_Node_Str","String_Node_Str",true,MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  try {
    testNext("String_Node_Str","String_Node_Str","String_Node_Str",true,Constants.DEFAULT_NAMESPACE,"String_Node_Str");
    Assert.fail();
  }
 catch (  AssertionError e) {
  }
  testNextNoMax("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  testNextFilter("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  testNextNoFrom("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testAdapterLogsNext() throws Exception {
  testNext("String_Node_Str","String_Node_Str","String_Node_Str",true,MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  testNextNoMax("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  testNextFilter("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  testNextNoFrom("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  try {
    testNext("String_Node_Str","String_Node_Str","String_Node_Str",true,Constants.DEFAULT_NAMESPACE,"String_Node_Str");
  }
 catch (  AssertionError e) {
    return;
  }
  Assert.fail();
}
Program: 7035
Project: 7035
Buggy source:
@Test public void testFlowLogs() throws Exception {
  testLogs("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,null);
  try {
    testLogs("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
    Assert.fail();
  }
 catch (  AssertionError e) {
  }
  testLogsFilter("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,null);
  testLogsRunId("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,null);
}

Fixed version (ground truth):
@Test public void testFlowLogs() throws Exception {
  testLogs("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,null);
  testLogsFilter("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,null);
  testLogsRunId("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,null);
  try {
    testLogs("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
  }
 catch (  AssertionError e) {
    return;
  }
  Assert.fail();
}
Program: 7036
Project: 7036
Buggy source:
@Test public void testMapReducePrev() throws Exception {
  testPrev("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
  testPrevNoMax("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
  try {
    testPrevNoMax("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,null);
    Assert.fail();
  }
 catch (  AssertionError e) {
  }
  testPrevFilter("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
  testPrevNoFrom("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
  testPrevRunId("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
}

Fixed version (ground truth):
@Test public void testMapReducePrev() throws Exception {
  testPrev("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
  testPrevNoMax("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
  testPrevFilter("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
  testPrevNoFrom("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
  testPrevRunId("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,null);
  try {
    testPrevNoMax("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,null);
  }
 catch (  AssertionError e) {
    return;
  }
  Assert.fail();
}
Program: 7037
Project: 7037
Buggy source:
@Test public void testAdapterLogs() throws Exception {
  testLogs("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  testLogs("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,null);
  try {
    testLogs("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,"String_Node_Str");
    Assert.fail();
  }
 catch (  AssertionError e) {
  }
  testLogsFilter("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testAdapterLogs() throws Exception {
  testLogs("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  testLogs("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,null);
  testLogsFilter("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  testLogsRunId("String_Node_Str","String_Node_Str","String_Node_Str",MockLogReader.TEST_NAMESPACE,"String_Node_Str");
  try {
    testLogs("String_Node_Str","String_Node_Str","String_Node_Str",Constants.DEFAULT_NAMESPACE,"String_Node_Str");
  }
 catch (  AssertionError e) {
    return;
  }
  Assert.fail();
}
Program: 7038
Project: 7038
Buggy source:
public static LoggingContext getLoggingContext(String namespaceId,String applicationId,String entityId,ProgramType programType,@Nullable String runId,@Nullable String adapterName){
switch (programType) {
case FLOW:
    return new FlowletLoggingContext(namespaceId,applicationId,entityId,"String_Node_Str",runId,null);
case WORKFLOW:
  return new WorkflowLoggingContext(namespaceId,applicationId,entityId,runId);
case MAPREDUCE:
return new MapReduceLoggingContext(namespaceId,applicationId,entityId,runId,adapterName);
case SPARK:
return new SparkLoggingContext(namespaceId,applicationId,entityId,runId);
case SERVICE:
return new UserServiceLoggingContext(namespaceId,applicationId,entityId,"String_Node_Str",runId,null);
case WORKER:
return new WorkerLoggingContext(namespaceId,applicationId,entityId,runId,null,adapterName);
default :
throw new IllegalArgumentException(String.format("String_Node_Str",programType));
}
}

Fixed version (ground truth):
public static LoggingContext getLoggingContext(String namespaceId,String applicationId,String entityId,ProgramType programType,@Nullable String runId,@Nullable String adapterName){
switch (programType) {
case FLOW:
    return new FlowletLoggingContext(namespaceId,applicationId,entityId,"String_Node_Str",runId,null);
case WORKFLOW:
  return new WorkflowLoggingContext(namespaceId,applicationId,entityId,runId,adapterName);
case MAPREDUCE:
return new MapReduceLoggingContext(namespaceId,applicationId,entityId,runId,adapterName);
case SPARK:
return new SparkLoggingContext(namespaceId,applicationId,entityId,runId);
case SERVICE:
return new UserServiceLoggingContext(namespaceId,applicationId,entityId,"String_Node_Str",runId,null);
case WORKER:
return new WorkerLoggingContext(namespaceId,applicationId,entityId,runId,null,adapterName);
default :
throw new IllegalArgumentException(String.format("String_Node_Str",programType));
}
}
Program: 7039
Project: 7039
Buggy source:
/** 
 * Constructs ApplicationLoggingContext.
 * @param namespaceId   namespace id
 * @param applicationId application id
 * @param workflowId    workflow id
 * @param runId         run id of the application
 */
public WorkflowLoggingContext(String namespaceId,String applicationId,String workflowId,String runId){
  super(namespaceId,applicationId,runId);
  setSystemTag(TAG_WORKFLOW_ID,workflowId);
}

Fixed version (ground truth):
/** 
 * Constructs ApplicationLoggingContext.
 * @param namespaceId   namespace id
 * @param applicationId application id
 * @param workflowId    workflow id
 * @param runId         run id of the application
 */
public WorkflowLoggingContext(String namespaceId,String applicationId,String workflowId,String runId,@Nullable String adapterId){
  super(namespaceId,applicationId,runId);
  setSystemTag(TAG_WORKFLOW_ID,workflowId);
  if (adapterId != null) {
    setAdapterId(adapterId);
  }
}
Program: 7041
Project: 7041
Buggy source:
/** 
 * Creates an adapter.
 * @param adapterName name of the adapter to create
 * @param adapterSpec properties of the adapter to create
 * @throws ApplicationTemplateNotFoundException if the desired adapter type was not found
 * @throws BadRequestException if the provided {@link AdapterConfig} was bad
 * @throws IOException if a network error occurred
 * @throws UnauthorizedException if the request is not authorized successfully in the gateway server
 */
public void create(String adapterName,AdapterConfig adapterSpec) throws ApplicationTemplateNotFoundException, BadRequestException, IOException, UnauthorizedException {
  URL url=config.resolveNamespacedURLV3(String.format("String_Node_Str",adapterName));
  HttpRequest request=HttpRequest.put(url).withBody(GSON.toJson(adapterSpec)).build();
  HttpResponse response=restClient.execute(request,config.getAccessToken(),HttpURLConnection.HTTP_NOT_FOUND,HttpURLConnection.HTTP_BAD_REQUEST);
  if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
    throw new ApplicationTemplateNotFoundException(Id.ApplicationTemplate.from(adapterSpec.getTemplate()));
  }
 else   if (response.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST) {
    throw new BadRequestException(response.getResponseMessage());
  }
}

Fixed version (ground truth):
/** 
 * Creates an adapter.
 * @param adapterName name of the adapter to create
 * @param adapterSpec properties of the adapter to create
 * @throws ApplicationTemplateNotFoundException if the desired adapter type was not found
 * @throws BadRequestException if the provided {@link AdapterConfig} was bad
 * @throws IOException if a network error occurred
 * @throws UnauthorizedException if the request is not authorized successfully in the gateway server
 */
public void create(String adapterName,AdapterConfig adapterSpec) throws ApplicationTemplateNotFoundException, BadRequestException, IOException, UnauthorizedException {
  URL url=config.resolveNamespacedURLV3(String.format("String_Node_Str",adapterName));
  HttpRequest request=HttpRequest.put(url).withBody(GSON.toJson(adapterSpec)).build();
  HttpResponse response=restClient.execute(request,config.getAccessToken(),HttpURLConnection.HTTP_NOT_FOUND,HttpURLConnection.HTTP_BAD_REQUEST);
  if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
    throw new ApplicationTemplateNotFoundException(Id.ApplicationTemplate.from(adapterSpec.getTemplate()));
  }
 else   if (response.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST) {
    throw new BadRequestException(response.getResponseBodyAsString());
  }
}
Program: 7042
Project: 7042
Buggy source:
@Override public void exceptionCaught(ChannelHandlerContext ctx,ExceptionEvent e){
  LOG.error("String_Node_Str",e);
  ChannelFuture future=Channels.future(ctx.getChannel());
  future.addListener(ChannelFutureListener.CLOSE);
  HttpResponse response=new DefaultHttpResponse(HttpVersion.HTTP_1_1,HttpResponseStatus.UNAUTHORIZED);
  Channels.write(ctx,future,response);
}

Fixed version (ground truth):
@Override public void exceptionCaught(ChannelHandlerContext ctx,ExceptionEvent e){
  LOG.error("String_Node_Str",e.getCause());
  ChannelFuture future=Channels.future(ctx.getChannel());
  future.addListener(ChannelFutureListener.CLOSE);
  HttpResponse response=new DefaultHttpResponse(HttpVersion.HTTP_1_1,HttpResponseStatus.UNAUTHORIZED);
  Channels.write(ctx,future,response);
}
Program: 7043
Project: 7043
Buggy source:
/** 
 * Initialize the Source.
 * @param context {@link RealtimeContext}
 */
public void initialize(RealtimeContext context) throws Exception {
  super.initialize(context);
  Map<String,String> runtimeArguments=Maps.newHashMap();
  if (config.getProperties() != null) {
    runtimeArguments.putAll(config.getProperties().getProperties());
  }
  Integer configMessagesToReceive=config.messagesToReceive;
  messagesToReceive=configMessagesToReceive.intValue();
  runtimeArguments.put(Context.INITIAL_CONTEXT_FACTORY,config.initialContextFactory);
  runtimeArguments.put(Context.PROVIDER_URL,config.providerUrl);
  final Hashtable<String,String> envVars=new Hashtable<String,String>();
  Maps.filterEntries(runtimeArguments,new Predicate<Map.Entry<String,String>>(){
    @Override public boolean apply(    @Nullable Map.Entry<String,String> input){
      if (input.getKey() != null && input.getKey().startsWith(JAVA_NAMING_PREFIX)) {
        envVars.put(input.getKey(),input.getValue());
        return true;
      }
      return false;
    }
  }
);
  initializeJMSConnection(envVars,config.destinationName,config.connectionFactoryName);
}

Fixed version (ground truth):
/** 
 * Initialize the Source.
 * @param context {@link RealtimeContext}
 */
public void initialize(RealtimeContext context) throws Exception {
  super.initialize(context);
  Map<String,String> runtimeArguments=Maps.newHashMap();
  if (config.getProperties() != null) {
    runtimeArguments.putAll(config.getProperties().getProperties());
  }
  Integer configMessagesToReceive=config.messagesToReceive;
  messagesToReceive=configMessagesToReceive.intValue();
  final Hashtable<String,String> envVars=new Hashtable<String,String>();
  for (  Map.Entry<String,String> entry : runtimeArguments.entrySet()) {
    if (entry.getKey() != null && entry.getKey().startsWith(JAVA_NAMING_PREFIX)) {
      envVars.put(entry.getKey(),entry.getValue());
    }
  }
  envVars.put(Context.INITIAL_CONTEXT_FACTORY,config.initialContextFactory);
  envVars.put(Context.PROVIDER_URL,config.providerUrl);
  initializeJMSConnection(envVars,config.destinationName,config.connectionFactoryName);
}
Program: 7044
Project: 7044
Buggy source:
@Override public void configurePipeline(PipelineConfigurer pipelineConfigurer){
  pipelineConfigurer.usePluginClass("String_Node_Str",Context.INITIAL_CONTEXT_FACTORY,String.format("String_Node_Str","String_Node_Str","String_Node_Str",Context.INITIAL_CONTEXT_FACTORY),PluginProperties.builder().build());
}

Fixed version (ground truth):
@Override public void configurePipeline(PipelineConfigurer pipelineConfigurer){
  pipelineConfigurer.usePluginClass("String_Node_Str",Context.INITIAL_CONTEXT_FACTORY,"String_Node_Str",PluginProperties.builder().build());
}
Program: 7046
Project: 7046
Buggy source:
private void moveAppArchiveUnderAppDirectory(Location origArchiveLocation,String appName) throws IOException {
  Location oldArchiveDir=Locations.getParent(origArchiveLocation);
  Preconditions.checkState(oldArchiveDir != null,"String_Node_Str");
  String archiveParentDirName=oldArchiveDir.getName();
  Location appFabricOutputLocation=Locations.getParent(oldArchiveDir);
  Preconditions.checkState(appFabricOutputLocation != null,"String_Node_Str");
  Location applicationArchiveDir=appFabricOutputLocation.append(appName);
  Locations.mkdirsIfNotExists(applicationArchiveDir);
  Location newArchiveLocation=applicationArchiveDir.append(archiveParentDirName);
  if (newArchiveLocation.exists()) {
    newArchiveLocation.delete(true);
  }
  if (oldArchiveDir.renameTo(newArchiveLocation) == null) {
    throw new IOException(String.format("String_Node_Str",oldArchiveDir.toURI(),newArchiveLocation.toURI()));
  }
}

Fixed version (ground truth):
private Location moveAppArchiveUnderAppDirectory(Location origArchiveLocation,String appName) throws IOException {
  Location oldArchiveDir=Locations.getParent(origArchiveLocation);
  Preconditions.checkState(oldArchiveDir != null,"String_Node_Str");
  String archiveParentDirName=oldArchiveDir.getName();
  Location appFabricOutputLocation=Locations.getParent(oldArchiveDir);
  Preconditions.checkState(appFabricOutputLocation != null,"String_Node_Str");
  Location applicationArchiveDir=appFabricOutputLocation.append(appName);
  Locations.mkdirsIfNotExists(applicationArchiveDir);
  Location newArchiveLocation=applicationArchiveDir.append(archiveParentDirName);
  if (newArchiveLocation.exists()) {
    newArchiveLocation.delete(true);
  }
  if (oldArchiveDir.renameTo(newArchiveLocation) == null) {
    throw new IOException(String.format("String_Node_Str",oldArchiveDir.toURI(),newArchiveLocation.toURI()));
  }
  return newArchiveLocation.append(origArchiveLocation.getName());
}
Program: 7050
Project: 7050
Buggy source:
@Override public void run(){
  try {
    Location configLocation=getConfigLocation(streamId);
    if (!configLocation.exists()) {
      return;
    }
    alterExploreStream(StreamUtils.getStreamIdFromLocation(streamLocation),false);
    configLocation.delete();
    streamMetaStore.removeStream(streamId);
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    Location configLocation=getConfigLocation(streamId);
    if (!configLocation.exists()) {
      return;
    }
    alterExploreStream(StreamUtils.getStreamIdFromLocation(streamLocation),false);
    if (!configLocation.delete()) {
      LOG.debug("String_Node_Str" + streamLocation.toURI().getPath());
    }
    streamMetaStore.removeStream(streamId);
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}
Program: 7051
Project: 7051
Buggy source:
private void doDrop(final Id.Stream streamId,final Location streamLocation) throws Exception {
  streamCoordinatorClient.deleteStream(streamId,new Runnable(){
    @Override public void run(){
      try {
        Location configLocation=getConfigLocation(streamId);
        if (!configLocation.exists()) {
          return;
        }
        alterExploreStream(StreamUtils.getStreamIdFromLocation(streamLocation),false);
        configLocation.delete();
        streamMetaStore.removeStream(streamId);
      }
 catch (      Exception e) {
        throw Throwables.propagate(e);
      }
    }
  }
);
}

Fixed version (ground truth):
private void doDrop(final Id.Stream streamId,final Location streamLocation) throws Exception {
  streamCoordinatorClient.deleteStream(streamId,new Runnable(){
    @Override public void run(){
      try {
        Location configLocation=getConfigLocation(streamId);
        if (!configLocation.exists()) {
          return;
        }
        alterExploreStream(StreamUtils.getStreamIdFromLocation(streamLocation),false);
        if (!configLocation.delete()) {
          LOG.debug("String_Node_Str" + streamLocation.toURI().getPath());
        }
        streamMetaStore.removeStream(streamId);
      }
 catch (      Exception e) {
        throw Throwables.propagate(e);
      }
    }
  }
);
}
Program: 7052
Project: 7052
Buggy source:
/** 
 * Deletes an adapter
 */
@DELETE @Path("String_Node_Str") public void deleteAdapter(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String adapterName){
  try {
    adapterService.removeAdapter(Id.Namespace.from(namespaceId),adapterName);
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  CannotBeDeletedException e) {
    responder.sendString(HttpResponseStatus.FORBIDDEN,e.getMessage());
  }
catch (  NotFoundException e) {
    responder.sendString(HttpResponseStatus.NOT_FOUND,e.getMessage());
  }
catch (  Throwable t) {
    LOG.error("String_Node_Str",namespaceId,adapterName,"String_Node_Str",t);
    responder.sendStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
  }
}

Fixed version (ground truth):
/** 
 * Deletes an adapter
 */
@DELETE @Path("String_Node_Str") public void deleteAdapter(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String adapterName){
  try {
    adapterService.removeAdapter(Id.Namespace.from(namespaceId),adapterName);
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  CannotBeDeletedException e) {
    responder.sendString(HttpResponseStatus.CONFLICT,e.getMessage());
  }
catch (  NotFoundException e) {
    responder.sendString(HttpResponseStatus.NOT_FOUND,e.getMessage());
  }
catch (  Throwable t) {
    LOG.error("String_Node_Str",namespaceId,adapterName,"String_Node_Str",t);
    responder.sendStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
  }
}
Program: 7053
Project: 7053
Buggy source:
/** 
 * DO NOT DOCUMENT THIS API
 */
@DELETE @Path("String_Node_Str") public void deleteDatasets(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespace){
  if (!cConf.getBoolean(Constants.Dangerous.UNRECOVERABLE_RESET,Constants.Dangerous.DEFAULT_UNRECOVERABLE_RESET)) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
    return;
  }
  Id.Namespace namespaceId=Id.Namespace.from(namespace);
  try {
    namespaceAdmin.deleteDatasets(namespaceId);
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  NotFoundException e) {
    responder.sendString(HttpResponseStatus.NOT_FOUND,String.format("String_Node_Str",namespace));
  }
catch (  NamespaceCannotBeDeletedException e) {
    responder.sendString(HttpResponseStatus.FORBIDDEN,e.getMessage());
  }
catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * DO NOT DOCUMENT THIS API
 */
@DELETE @Path("String_Node_Str") public void deleteDatasets(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespace){
  if (!cConf.getBoolean(Constants.Dangerous.UNRECOVERABLE_RESET,Constants.Dangerous.DEFAULT_UNRECOVERABLE_RESET)) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
    return;
  }
  Id.Namespace namespaceId=Id.Namespace.from(namespace);
  try {
    namespaceAdmin.deleteDatasets(namespaceId);
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  NotFoundException e) {
    responder.sendString(HttpResponseStatus.NOT_FOUND,String.format("String_Node_Str",namespace));
  }
catch (  NamespaceCannotBeDeletedException e) {
    responder.sendString(HttpResponseStatus.CONFLICT,e.getMessage());
  }
catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
  }
}
Program: 7054
Project: 7054
Buggy source:
/** 
 * Remove adapter identified by the namespace and name and also deletes the template for the adapter if this was the last adapter associated with it
 * @param namespace namespace id
 * @param adapterName adapter name
 * @throws AdapterNotFoundException if the adapter to be removed is not found.
 * @throws CannotBeDeletedException if the adapter is not stopped.
 */
public synchronized void removeAdapter(Id.Namespace namespace,String adapterName) throws AdapterNotFoundException, CannotBeDeletedException {
  AdapterStatus adapterStatus=getAdapterStatus(namespace,adapterName);
  AdapterSpecification adapterSpec=getAdapter(namespace,adapterName);
  Id.Application applicationId=Id.Application.from(namespace,adapterSpec.getTemplate());
  if (adapterStatus != AdapterStatus.STOPPED) {
    throw new CannotBeDeletedException(Id.Adapter.from(namespace,adapterName));
  }
  store.removeAdapter(namespace,adapterName);
  try {
    deleteApp(applicationId);
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str",adapterSpec.getTemplate(),adapterName);
  }
}

Fixed version (ground truth):
/** 
 * Remove adapter identified by the namespace and name and also deletes the template for the adapter if this was the last adapter associated with it
 * @param namespace namespace id
 * @param adapterName adapter name
 * @throws AdapterNotFoundException if the adapter to be removed is not found.
 * @throws CannotBeDeletedException if the adapter is not stopped.
 */
public synchronized void removeAdapter(Id.Namespace namespace,String adapterName) throws AdapterNotFoundException, CannotBeDeletedException {
  AdapterStatus adapterStatus=getAdapterStatus(namespace,adapterName);
  AdapterSpecification adapterSpec=getAdapter(namespace,adapterName);
  Id.Application applicationId=Id.Application.from(namespace,adapterSpec.getTemplate());
  if (adapterStatus != AdapterStatus.STOPPED) {
    throw new CannotBeDeletedException(Id.Adapter.from(namespace,adapterName),"String_Node_Str" + "String_Node_Str");
  }
  store.removeAdapter(namespace,adapterName);
  try {
    deleteApp(applicationId);
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str",adapterSpec.getTemplate(),adapterName);
  }
}
Program: 7057
Project: 7057
Buggy source:
private void executeAll(Iterator<WorkflowNode> iterator,ApplicationSpecification appSpec,InstantiatorFactory instantiator,ClassLoader classLoader,WorkflowToken token){
  while (iterator.hasNext() && runningThread != null) {
    try {
      blockIfSuspended();
      WorkflowNode node=iterator.next();
      executeNode(appSpec,node,instantiator,classLoader,token);
    }
 catch (    Throwable t) {
      Throwables.propagate(t);
    }
  }
}

Fixed version (ground truth):
private void executeAll(Iterator<WorkflowNode> iterator,ApplicationSpecification appSpec,InstantiatorFactory instantiator,ClassLoader classLoader,WorkflowToken token){
  while (iterator.hasNext() && runningThread != null) {
    try {
      blockIfSuspended();
      WorkflowNode node=iterator.next();
      executeNode(appSpec,node,instantiator,classLoader,token);
    }
 catch (    Throwable t) {
      Throwable rootCause=Throwables.getRootCause(t);
      if (rootCause instanceof InterruptedException) {
        LOG.error("String_Node_Str");
        break;
      }
      Throwables.propagate(t);
    }
  }
}
Program: 7058
Project: 7058
Buggy source:
@Override public void run(){
  LOG.info("String_Node_Str");
  try {
    File file=new File(filePath);
    file.createNewFile();
    File doneFile=new File(doneFilePath);
    while (!doneFile.exists()) {
      TimeUnit.SECONDS.sleep(1);
    }
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
@Override public void run(){
  LOG.info("String_Node_Str" + getContext().getSpecification().getName());
  try {
    File file=new File(getContext().getRuntimeArguments().get(getContext().getSpecification().getName() + "String_Node_Str"));
    file.createNewFile();
    File doneFile=new File(getContext().getRuntimeArguments().get(getContext().getSpecification().getName() + "String_Node_Str"));
    while (!doneFile.exists()) {
      TimeUnit.MILLISECONDS.sleep(50);
    }
  }
 catch (  Exception e) {
  }
}
Program: 7059
Project: 7059
Buggy source:
@Override public void configure(){
  setName("String_Node_Str");
  setDescription("String_Node_Str");
  fork().addAction(new OneAction()).also().addAction(new AnotherAction()).join();
}

Fixed version (ground truth):
@Override public void configure(){
  setName("String_Node_Str");
  setDescription("String_Node_Str");
  addAction(new SimpleAction("String_Node_Str"));
  fork().addAction(new SimpleAction("String_Node_Str")).also().addAction(new SimpleAction("String_Node_Str")).join();
}
Program: 7061
Project: 7061
Buggy source:
/** 
 * DO NOT DOCUMENT THIS API
 */
@DELETE @Path("String_Node_Str") public void delete(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespace){
  if (!cConf.getBoolean(Constants.Dangerous.UNRECOVERABLE_RESET,Constants.Dangerous.DEFAULT_UNRECOVERABLE_RESET)) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
    return;
  }
  Id.Namespace namespaceId=Id.Namespace.from(namespace);
  try {
    namespaceAdmin.deleteNamespace(namespaceId);
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  NotFoundException e) {
    responder.sendString(HttpResponseStatus.NOT_FOUND,String.format("String_Node_Str",namespace));
  }
catch (  NamespaceCannotBeDeletedException e) {
    responder.sendString(HttpResponseStatus.FORBIDDEN,e.getMessage());
  }
catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * DO NOT DOCUMENT THIS API
 */
@DELETE @Path("String_Node_Str") public void delete(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespace){
  if (!cConf.getBoolean(Constants.Dangerous.UNRECOVERABLE_RESET,Constants.Dangerous.DEFAULT_UNRECOVERABLE_RESET)) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
    return;
  }
  Id.Namespace namespaceId=Id.Namespace.from(namespace);
  try {
    namespaceAdmin.deleteNamespace(namespaceId);
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  NotFoundException e) {
    responder.sendString(HttpResponseStatus.NOT_FOUND,String.format("String_Node_Str",namespace));
  }
catch (  NamespaceCannotBeDeletedException e) {
    responder.sendString(HttpResponseStatus.CONFLICT,e.getMessage());
  }
catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
  }
}
Program: 7062
Project: 7062
Buggy source:
/** 
 * Creates a new namespace
 * @param metadata the {@link NamespaceMeta} for the new namespace to be created
 * @throws NamespaceAlreadyExistsException if the specified namespace already exists
 */
public void createNamespace(NamespaceMeta metadata) throws NamespaceCannotBeCreatedException, NamespaceAlreadyExistsException {
  Preconditions.checkArgument(metadata != null,"String_Node_Str");
  Id.Namespace namespace=Id.Namespace.from(metadata.getName());
  if (hasNamespace(Id.Namespace.from(metadata.getName()))) {
    throw new NamespaceAlreadyExistsException(namespace);
  }
  try {
    dsFramework.createNamespace(Id.Namespace.from(metadata.getName()));
  }
 catch (  DatasetManagementException e) {
    throw new NamespaceCannotBeCreatedException(namespace,e);
  }
  store.createNamespace(metadata);
}

Fixed version (ground truth):
/** 
 * Creates a new namespace
 * @param metadata the {@link NamespaceMeta} for the new namespace to be created
 * @throws NamespaceAlreadyExistsException if the specified namespace already exists
 */
public synchronized void createNamespace(NamespaceMeta metadata) throws NamespaceCannotBeCreatedException, NamespaceAlreadyExistsException {
  Preconditions.checkArgument(metadata != null,"String_Node_Str");
  Id.Namespace namespace=Id.Namespace.from(metadata.getName());
  if (hasNamespace(Id.Namespace.from(metadata.getName()))) {
    throw new NamespaceAlreadyExistsException(namespace);
  }
  try {
    dsFramework.createNamespace(Id.Namespace.from(metadata.getName()));
  }
 catch (  DatasetManagementException e) {
    throw new NamespaceCannotBeCreatedException(namespace,e);
  }
  store.createNamespace(metadata);
}
Program: 7064
Project: 7064
Buggy source:
@Override public void deleteDatasets(Id.Namespace namespaceId) throws NamespaceNotFoundException, NamespaceCannotBeDeletedException {
  if (!hasNamespace(namespaceId)) {
    throw new NamespaceNotFoundException(namespaceId);
  }
  if (areProgramsRunning(namespaceId)) {
    throw new NamespaceCannotBeDeletedException(namespaceId,"String_Node_Str" + namespaceId);
  }
  LOG.info("String_Node_Str",namespaceId);
  try {
    dsFramework.deleteAllInstances(namespaceId);
  }
 catch (  DatasetManagementException e) {
    LOG.warn("String_Node_Str",namespaceId,e);
    throw new NamespaceCannotBeDeletedException(namespaceId,e);
  }
catch (  IOException e) {
    LOG.warn("String_Node_Str",namespaceId,e);
    throw new NamespaceCannotBeDeletedException(namespaceId,e);
  }
  LOG.info("String_Node_Str",namespaceId);
}

Fixed version (ground truth):
@Override public synchronized void deleteDatasets(Id.Namespace namespaceId) throws NamespaceNotFoundException, NamespaceCannotBeDeletedException {
  if (!hasNamespace(namespaceId)) {
    throw new NamespaceNotFoundException(namespaceId);
  }
  if (checkProgramsRunning(namespaceId)) {
    throw new NamespaceCannotBeDeletedException(namespaceId,"String_Node_Str" + namespaceId);
  }
  LOG.info("String_Node_Str",namespaceId);
  try {
    dsFramework.deleteAllInstances(namespaceId);
  }
 catch (  DatasetManagementException e) {
    LOG.warn("String_Node_Str",namespaceId,e);
    throw new NamespaceCannotBeDeletedException(namespaceId,e);
  }
catch (  IOException e) {
    LOG.warn("String_Node_Str",namespaceId,e);
    throw new NamespaceCannotBeDeletedException(namespaceId,e);
  }
  LOG.info("String_Node_Str",namespaceId);
}
Program: 7065
Project: 7065
Buggy source:
public void updateProperties(Id.Namespace namespaceId,NamespaceMeta namespaceMeta) throws NamespaceNotFoundException {
  if (store.getNamespace(namespaceId) == null) {
    throw new NamespaceNotFoundException(namespaceId);
  }
  NamespaceMeta metadata=store.getNamespace(namespaceId);
  NamespaceMeta.Builder builder=new NamespaceMeta.Builder(metadata);
  if (namespaceMeta.getDescription() != null) {
    builder.setDescription(namespaceMeta.getDescription());
  }
  if (namespaceMeta.getName() != null) {
    builder.setName(namespaceMeta.getName());
  }
  NamespaceConfig config=namespaceMeta.getConfig();
  if (config != null && config.getSchedulerQueueName() != null && !config.getSchedulerQueueName().isEmpty()) {
    builder.setSchedulerQueueName(config.getSchedulerQueueName());
  }
  store.updateNamespace(builder.build());
}

Fixed version (ground truth):
public synchronized void updateProperties(Id.Namespace namespaceId,NamespaceMeta namespaceMeta) throws NamespaceNotFoundException {
  if (store.getNamespace(namespaceId) == null) {
    throw new NamespaceNotFoundException(namespaceId);
  }
  NamespaceMeta metadata=store.getNamespace(namespaceId);
  NamespaceMeta.Builder builder=new NamespaceMeta.Builder(metadata);
  if (namespaceMeta.getDescription() != null) {
    builder.setDescription(namespaceMeta.getDescription());
  }
  if (namespaceMeta.getName() != null) {
    builder.setName(namespaceMeta.getName());
  }
  NamespaceConfig config=namespaceMeta.getConfig();
  if (config != null && config.getSchedulerQueueName() != null && !config.getSchedulerQueueName().isEmpty()) {
    builder.setSchedulerQueueName(config.getSchedulerQueueName());
  }
  store.updateNamespace(builder.build());
}
Program: 7066
Project: 7066
Buggy source:
@Inject public DefaultNamespaceAdmin(Store store,PreferencesStore preferencesStore,DashboardStore dashboardStore,DatasetFramework dsFramework,ProgramRuntimeService runtimeService,QueueAdmin queueAdmin,StreamAdmin streamAdmin,MetricStore metricStore,Scheduler scheduler){
  this.queueAdmin=queueAdmin;
  this.streamAdmin=streamAdmin;
  this.store=store;
  this.preferencesStore=preferencesStore;
  this.dashboardStore=dashboardStore;
  this.dsFramework=dsFramework;
  this.runtimeService=runtimeService;
  this.scheduler=scheduler;
  this.metricStore=metricStore;
}

Fixed version (ground truth):
@Inject public DefaultNamespaceAdmin(Store store,PreferencesStore preferencesStore,DashboardStore dashboardStore,DatasetFramework dsFramework,ProgramRuntimeService runtimeService,QueueAdmin queueAdmin,StreamAdmin streamAdmin,MetricStore metricStore,Scheduler scheduler,ApplicationLifecycleService applicationLifecycleService,AdapterService adapterService){
  this.queueAdmin=queueAdmin;
  this.streamAdmin=streamAdmin;
  this.store=store;
  this.preferencesStore=preferencesStore;
  this.dashboardStore=dashboardStore;
  this.dsFramework=dsFramework;
  this.runtimeService=runtimeService;
  this.scheduler=scheduler;
  this.metricStore=metricStore;
  this.applicationLifecycleService=applicationLifecycleService;
  this.adapterService=adapterService;
}
Program: 7067
Project: 7067
Buggy source:
@VisibleForTesting void registerTemplates(){
  try {
    Map<String,ApplicationTemplateInfo> newInfoMap=Maps.newHashMap();
    Map<File,ApplicationTemplateInfo> newFileTemplateMap=Maps.newHashMap();
    File baseDir=new File(configuration.get(Constants.AppFabric.APP_TEMPLATE_DIR));
    List<File> files=DirUtils.listFiles(baseDir,"String_Node_Str");
    for (    File file : files) {
      try {
        ApplicationTemplateInfo info=getTemplateInfo(file);
        newInfoMap.put(info.getName(),info);
        newFileTemplateMap.put(info.getFile().getAbsoluteFile(),info);
      }
 catch (      IllegalArgumentException e) {
        LOG.error("String_Node_Str",file.getName(),e);
      }
    }
    appTemplateInfos.set(newInfoMap);
    fileToTemplateMap.set(newFileTemplateMap);
    pluginRepository.inspectPlugins(newInfoMap.values());
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
}

Fixed version (ground truth):
@VisibleForTesting public void registerTemplates(){
  try {
    Map<String,ApplicationTemplateInfo> newInfoMap=Maps.newHashMap();
    Map<File,ApplicationTemplateInfo> newFileTemplateMap=Maps.newHashMap();
    File baseDir=new File(configuration.get(Constants.AppFabric.APP_TEMPLATE_DIR));
    List<File> files=DirUtils.listFiles(baseDir,"String_Node_Str");
    for (    File file : files) {
      try {
        ApplicationTemplateInfo info=getTemplateInfo(file);
        newInfoMap.put(info.getName(),info);
        newFileTemplateMap.put(info.getFile().getAbsoluteFile(),info);
      }
 catch (      IllegalArgumentException e) {
        LOG.error("String_Node_Str",file.getName(),e);
      }
    }
    appTemplateInfos.set(newInfoMap);
    fileToTemplateMap.set(newFileTemplateMap);
    pluginRepository.inspectPlugins(newInfoMap.values());
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
}
Program: 7068
Project: 7068
Buggy source:
@BeforeClass public static void setup() throws Exception {
  CConfiguration conf=getInjector().getInstance(CConfiguration.class);
  locationFactory=getInjector().getInstance(LocationFactory.class);
  adapterDir=new File(conf.get(Constants.AppFabric.APP_TEMPLATE_DIR));
  setupAdapter(DummyBatchTemplate.class);
  setupAdapter(DummyWorkerTemplate.class);
  adapterService=getInjector().getInstance(AdapterService.class);
  adapterService.registerTemplates();
}

Fixed version (ground truth):
@BeforeClass public static void setup() throws Exception {
  setupAdapter(DummyBatchTemplate.class);
  setupAdapter(DummyWorkerTemplate.class);
  adapterService=getInjector().getInstance(AdapterService.class);
  adapterService.registerTemplates();
}
Program: 7070
Project: 7070
Buggy source:
@BeforeClass public static void setup() throws Exception {
  CConfiguration conf=getInjector().getInstance(CConfiguration.class);
  locationFactory=getInjector().getInstance(LocationFactory.class);
  adapterDir=new File(conf.get(Constants.AppFabric.APP_TEMPLATE_DIR));
  setupAdapters();
  adapterService=getInjector().getInstance(AdapterService.class);
  adapterService.registerTemplates();
}

Fixed version (ground truth):
@BeforeClass public static void setup() throws Exception {
  setupAdapters();
  adapterService=getInjector().getInstance(AdapterService.class);
  adapterService.registerTemplates();
}