nus-yam/ex-repair huggingface dataset:
Program: 5879
Project: 5879
Buggy source:
@Override public void append(List<KafkaLogEvent> events) throws Exception {
  if (events.isEmpty()) {
    return;
  }
  KafkaLogEvent event=events.get(0);
  int partition=event.getPartition();
  Checkpoint maxCheckpoint=partitionCheckpointMap.get(partition);
  maxCheckpoint=maxCheckpoint == null ? new Checkpoint(-1,-1) : maxCheckpoint;
  for (  KafkaLogEvent e : events) {
    if (e.getNextOffset() > maxCheckpoint.getNextOffset()) {
      maxCheckpoint=new Checkpoint(e.getNextOffset(),e.getLogEvent().getTimeStamp());
    }
  }
  partitionCheckpointMap.put(partition,maxCheckpoint);
  avroFileWriter.append(events);
  flush(false);
}

Fixed version (ground truth):
@Override public void append(List<KafkaLogEvent> events) throws Exception {
  if (events.isEmpty()) {
    return;
  }
  KafkaLogEvent event=events.get(0);
  int partition=event.getPartition();
  Checkpoint maxCheckpoint=partitionCheckpointMap.get(partition);
  maxCheckpoint=maxCheckpoint == null ? new Checkpoint(-1,-1) : maxCheckpoint;
  for (  KafkaLogEvent e : events) {
    if (e.getNextOffset() > maxCheckpoint.getNextOffset()) {
      maxCheckpoint=new Checkpoint(e.getNextOffset(),e.getLogEvent().getTimeStamp());
    }
  }
  partitionCheckpointMap.put(partition,maxCheckpoint);
  avroFileWriter.append(events);
}
Program: 5882
Project: 5882
Buggy source:
/** 
 * Constructs an AvroFileWriter object.
 * @param fileMetaDataManager used to store file meta data.
 * @param namespacedLocationFactory the namespaced location factory
 * @param logBaseDir the basedirectory for logs as defined in configuration
 * @param schema schema of the Avro data to be written.
 * @param maxFileSize Avro files greater than maxFileSize will get rotated.
 * @param syncIntervalBytes the approximate number of uncompressed bytes to write in each block.
 * @param inactiveIntervalMs files that have no data written for more than inactiveIntervalMs will be closed.
 */
public AvroFileWriter(FileMetaDataManager fileMetaDataManager,NamespacedLocationFactory namespacedLocationFactory,String logBaseDir,Schema schema,long maxFileSize,int syncIntervalBytes,long inactiveIntervalMs,Impersonator impersonator){
  this.fileMetaDataManager=fileMetaDataManager;
  this.namespacedLocationFactory=namespacedLocationFactory;
  this.logBaseDir=logBaseDir;
  this.schema=schema;
  this.syncIntervalBytes=syncIntervalBytes;
  this.fileMap=Maps.newHashMap();
  this.maxFileSize=maxFileSize;
  this.inactiveIntervalMs=inactiveIntervalMs;
  this.impersonator=impersonator;
}

Fixed version (ground truth):
/** 
 * Constructs an AvroFileWriter object.
 * @param fileMetaDataManager used to store file meta data.
 * @param namespacedLocationFactory the namespaced location factory
 * @param logBaseDir the basedirectory for logs as defined in configuration
 * @param schema schema of the Avro data to be written.
 * @param maxFileSize Avro files greater than maxFileSize will get rotated.
 * @param syncIntervalBytes the approximate number of uncompressed bytes to write in each block.
 * @param maxFileLifetimeMs files that are older than maxFileLifetimeMs will be closed.
 */
public AvroFileWriter(FileMetaDataManager fileMetaDataManager,NamespacedLocationFactory namespacedLocationFactory,String logBaseDir,Schema schema,long maxFileSize,int syncIntervalBytes,long maxFileLifetimeMs,Impersonator impersonator){
  this.fileMetaDataManager=fileMetaDataManager;
  this.namespacedLocationFactory=namespacedLocationFactory;
  this.logBaseDir=logBaseDir;
  this.schema=schema;
  this.syncIntervalBytes=syncIntervalBytes;
  this.fileMap=Maps.newHashMap();
  this.maxFileSize=maxFileSize;
  this.maxFileLifetimeMs=maxFileLifetimeMs;
  this.impersonator=impersonator;
}
Program: 5883
Project: 5883
Buggy source:
public void append(LogWriteEvent event) throws IOException {
  try {
    dataFileWriter.append(event.getGenericRecord());
    lastModifiedTs=System.currentTimeMillis();
  }
 catch (  Exception e) {
    close();
    throw new IOException("String_Node_Str" + location,e);
  }
}

Fixed version (ground truth):
public void append(LogWriteEvent event) throws IOException {
  try {
    dataFileWriter.append(event.getGenericRecord());
  }
 catch (  Exception e) {
    close();
    throw new IOException("String_Node_Str" + location,e);
  }
}
Program: 5884
Project: 5884
Buggy source:
/** 
 * Opens the underlying file for writing. If open throws an exception then underlying file may still need to be deleted.
 * @throws IOException
 */
void open() throws IOException {
  try {
    this.outputStream=new FSDataOutputStream(location.getOutputStream(),null);
    this.dataFileWriter=new DataFileWriter<>(new GenericDatumWriter<GenericRecord>(schema));
    this.dataFileWriter.create(schema,this.outputStream);
    this.dataFileWriter.setSyncInterval(syncIntervalBytes);
    this.lastModifiedTs=System.currentTimeMillis();
  }
 catch (  Exception e) {
    close();
    throw new IOException("String_Node_Str" + location,e);
  }
  this.isOpen=true;
}

Fixed version (ground truth):
/** 
 * Opens the underlying file for writing. If open throws an exception then underlying file may still need to be deleted.
 * @throws IOException
 */
void open() throws IOException {
  try {
    this.outputStream=new FSDataOutputStream(location.getOutputStream(),null);
    this.dataFileWriter=new DataFileWriter<>(new GenericDatumWriter<GenericRecord>(schema));
    this.dataFileWriter.create(schema,this.outputStream);
    this.dataFileWriter.setSyncInterval(syncIntervalBytes);
    this.createTime=System.currentTimeMillis();
  }
 catch (  Exception e) {
    close();
    throw new IOException("String_Node_Str" + location,e);
  }
  this.isOpen=true;
}
Program: 5885
Project: 5885
Buggy source:
private void flush(boolean force) throws Exception {
  long currentTs=System.currentTimeMillis();
  if (!force && currentTs - lastCheckpointTime < flushIntervalMs) {
    return;
  }
  avroFileWriter.flush();
  lastCheckpointTime=currentTs;
}

Fixed version (ground truth):
public void flush(boolean force) throws IOException {
  try {
    long currentTs=System.currentTimeMillis();
    if (!force && currentTs - lastCheckpointTime < flushIntervalMs) {
      return;
    }
    avroFileWriter.flush();
    lastCheckpointTime=currentTs;
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    throw new IOException(e);
  }
}
Program: 5886
Project: 5886
Buggy source:
/** 
 * List of all the entries in the secure store.
 * @param namespace The namespace that this key belongs to.
 * @return A list of {@link SecureStoreMetadata} objects representing the data stored in the store.
 * @throws IOException If there was a problem reading from the keystore.
 * @throws Exception If the specified namespace does not exist.
 */
List<SecureStoreMetadata> listSecureData(String namespace) throws Exception ;

Fixed version (ground truth):
/** 
 * List of all the entries in the secure store.
 * @param namespace The namespace that this key belongs to.
 * @return A list of {@link SecureStoreMetadata} objects representing the data stored in the store.
 * @throws IOException If there was a problem reading from the keystore.
 * @throws Exception If the specified namespace does not exist.
 */
Map<String,String> listSecureData(String namespace) throws Exception ;
Program: 5887
Project: 5887
Buggy source:
@Override public Module getStandaloneModules(){
  return Modules.combine(new AppFabricServiceModule(StreamHandler.class,StreamFetchHandler.class,StreamViewHttpHandler.class),new ConfigStoreModule().getStandaloneModule(),new SecureStoreModules().getStandaloneModules(),new EntityVerifierModule(),new AuthenticationContextModules().getMasterModule(),new AbstractModule(){
    @Override protected void configure(){
      bind(AppFabricServer.class).to(StandaloneAppFabricServer.class).in(Scopes.SINGLETON);
      bind(SchedulerService.class).to(LocalSchedulerService.class).in(Scopes.SINGLETON);
      bind(Scheduler.class).to(SchedulerService.class);
      bind(MRJobInfoFetcher.class).to(LocalMRJobInfoFetcher.class);
      bind(StorageProviderNamespaceAdmin.class).to(LocalStorageProviderNamespaceAdmin.class);
      bind(UGIProvider.class).to(UnsupportedUGIProvider.class);
      addInMemoryBindings(binder());
      Multibinder<String> servicesNamesBinder=Multibinder.newSetBinder(binder(),String.class,Names.named("String_Node_Str"));
      servicesNamesBinder.addBinding().toInstance(Constants.Service.APP_FABRIC_HTTP);
      servicesNamesBinder.addBinding().toInstance(Constants.Service.STREAMS);
      Multibinder<String> handlerHookNamesBinder=Multibinder.newSetBinder(binder(),String.class,Names.named("String_Node_Str"));
      handlerHookNamesBinder.addBinding().toInstance(Constants.Service.APP_FABRIC_HTTP);
      handlerHookNamesBinder.addBinding().toInstance(Constants.Stream.STREAM_HANDLER);
    }
  }
);
}

Fixed version (ground truth):
@Override public Module getStandaloneModules(){
  return Modules.combine(new AppFabricServiceModule(StreamHandler.class,StreamFetchHandler.class,StreamViewHttpHandler.class),new ConfigStoreModule().getStandaloneModule(),new EntityVerifierModule(),new AuthenticationContextModules().getMasterModule(),new AbstractModule(){
    @Override protected void configure(){
      bind(AppFabricServer.class).to(StandaloneAppFabricServer.class).in(Scopes.SINGLETON);
      bind(SchedulerService.class).to(LocalSchedulerService.class).in(Scopes.SINGLETON);
      bind(Scheduler.class).to(SchedulerService.class);
      bind(MRJobInfoFetcher.class).to(LocalMRJobInfoFetcher.class);
      bind(StorageProviderNamespaceAdmin.class).to(LocalStorageProviderNamespaceAdmin.class);
      bind(UGIProvider.class).to(UnsupportedUGIProvider.class);
      addInMemoryBindings(binder());
      Multibinder<String> servicesNamesBinder=Multibinder.newSetBinder(binder(),String.class,Names.named("String_Node_Str"));
      servicesNamesBinder.addBinding().toInstance(Constants.Service.APP_FABRIC_HTTP);
      servicesNamesBinder.addBinding().toInstance(Constants.Service.STREAMS);
      Multibinder<String> handlerHookNamesBinder=Multibinder.newSetBinder(binder(),String.class,Names.named("String_Node_Str"));
      handlerHookNamesBinder.addBinding().toInstance(Constants.Service.APP_FABRIC_HTTP);
      handlerHookNamesBinder.addBinding().toInstance(Constants.Stream.STREAM_HANDLER);
    }
  }
);
}
Program: 5889
Project: 5889
Buggy source:
@Override public Module getInMemoryModules(){
  return Modules.combine(new AppFabricServiceModule(StreamHandler.class,StreamFetchHandler.class,StreamViewHttpHandler.class),new ConfigStoreModule().getInMemoryModule(),new SecureStoreModules().getInMemoryModules(),new EntityVerifierModule(),new AuthenticationContextModules().getMasterModule(),new AbstractModule(){
    @Override protected void configure(){
      bind(SchedulerService.class).to(LocalSchedulerService.class).in(Scopes.SINGLETON);
      bind(Scheduler.class).to(SchedulerService.class);
      bind(MRJobInfoFetcher.class).to(LocalMRJobInfoFetcher.class);
      bind(StorageProviderNamespaceAdmin.class).to(LocalStorageProviderNamespaceAdmin.class);
      bind(UGIProvider.class).to(UnsupportedUGIProvider.class);
      addInMemoryBindings(binder());
      Multibinder<String> servicesNamesBinder=Multibinder.newSetBinder(binder(),String.class,Names.named("String_Node_Str"));
      servicesNamesBinder.addBinding().toInstance(Constants.Service.APP_FABRIC_HTTP);
      servicesNamesBinder.addBinding().toInstance(Constants.Service.STREAMS);
      Multibinder<String> handlerHookNamesBinder=Multibinder.newSetBinder(binder(),String.class,Names.named("String_Node_Str"));
      handlerHookNamesBinder.addBinding().toInstance(Constants.Service.APP_FABRIC_HTTP);
      handlerHookNamesBinder.addBinding().toInstance(Constants.Stream.STREAM_HANDLER);
    }
  }
);
}

Fixed version (ground truth):
@Override public Module getInMemoryModules(){
  return Modules.combine(new AppFabricServiceModule(StreamHandler.class,StreamFetchHandler.class,StreamViewHttpHandler.class),new ConfigStoreModule().getInMemoryModule(),new EntityVerifierModule(),new AuthenticationContextModules().getMasterModule(),new AbstractModule(){
    @Override protected void configure(){
      bind(SchedulerService.class).to(LocalSchedulerService.class).in(Scopes.SINGLETON);
      bind(Scheduler.class).to(SchedulerService.class);
      bind(MRJobInfoFetcher.class).to(LocalMRJobInfoFetcher.class);
      bind(StorageProviderNamespaceAdmin.class).to(LocalStorageProviderNamespaceAdmin.class);
      bind(UGIProvider.class).to(UnsupportedUGIProvider.class);
      addInMemoryBindings(binder());
      Multibinder<String> servicesNamesBinder=Multibinder.newSetBinder(binder(),String.class,Names.named("String_Node_Str"));
      servicesNamesBinder.addBinding().toInstance(Constants.Service.APP_FABRIC_HTTP);
      servicesNamesBinder.addBinding().toInstance(Constants.Service.STREAMS);
      Multibinder<String> handlerHookNamesBinder=Multibinder.newSetBinder(binder(),String.class,Names.named("String_Node_Str"));
      handlerHookNamesBinder.addBinding().toInstance(Constants.Service.APP_FABRIC_HTTP);
      handlerHookNamesBinder.addBinding().toInstance(Constants.Stream.STREAM_HANDLER);
    }
  }
);
}
Program: 5891
Project: 5891
Buggy source:
@Path("String_Node_Str") @GET public void getMetadata(HttpRequest httpRequest,HttpResponder httpResponder,@PathParam("String_Node_Str") String namespace,@PathParam("String_Node_Str") String name) throws Exception {
  SecureKeyId secureKeyId=new SecureKeyId(namespace,name);
  SecureStoreData secureStoreData=secureStoreService.get(secureKeyId);
  httpResponder.sendJson(HttpResponseStatus.OK,secureStoreData.getMetadata());
}

Fixed version (ground truth):
@Path("String_Node_Str") @GET public void getMetadata(HttpRequest httpRequest,HttpResponder httpResponder,@PathParam("String_Node_Str") String namespace,@PathParam("String_Node_Str") String name) throws Exception {
  SecureStoreData secureStoreData=secureStore.getSecureData(namespace,name);
  httpResponder.sendJson(HttpResponseStatus.OK,secureStoreData.getMetadata());
}
Program: 5892
Project: 5892
Buggy source:
@Path("String_Node_Str") @GET public void get(HttpRequest httpRequest,HttpResponder httpResponder,@PathParam("String_Node_Str") String namespace,@PathParam("String_Node_Str") String name) throws Exception {
  SecureKeyId secureKeyId=new SecureKeyId(namespace,name);
  String data=new String(secureStoreService.get(secureKeyId).get(),StandardCharsets.UTF_8);
  httpResponder.sendString(HttpResponseStatus.OK,data);
}

Fixed version (ground truth):
@Path("String_Node_Str") @GET public void get(HttpRequest httpRequest,HttpResponder httpResponder,@PathParam("String_Node_Str") String namespace,@PathParam("String_Node_Str") String name) throws Exception {
  SecureKeyId secureKeyId=new SecureKeyId(namespace,name);
  httpResponder.sendContent(HttpResponseStatus.OK,ChannelBuffers.wrappedBuffer(secureStore.getSecureData(namespace,name).get()),"String_Node_Str",null);
}
Program: 5893
Project: 5893
Buggy source:
@Path("String_Node_Str") @PUT public void create(HttpRequest httpRequest,HttpResponder httpResponder,@PathParam("String_Node_Str") String namespace,@PathParam("String_Node_Str") String name) throws Exception {
  SecureKeyId secureKeyId=new SecureKeyId(namespace,name);
  SecureKeyCreateRequest secureKeyCreateRequest=parseBody(httpRequest,SecureKeyCreateRequest.class);
  if (secureKeyCreateRequest == null) {
    SecureKeyCreateRequest dummy=new SecureKeyCreateRequest("String_Node_Str","String_Node_Str",ImmutableMap.of("String_Node_Str","String_Node_Str"));
    throw new BadRequestException("String_Node_Str" + "String_Node_Str" + GSON.toJson(dummy));
  }
  secureStoreService.put(secureKeyId,secureKeyCreateRequest);
  httpResponder.sendStatus(HttpResponseStatus.OK);
}

Fixed version (ground truth):
@Path("String_Node_Str") @PUT public void create(HttpRequest httpRequest,HttpResponder httpResponder,@PathParam("String_Node_Str") String namespace,@PathParam("String_Node_Str") String name) throws Exception {
  SecureKeyId secureKeyId=new SecureKeyId(namespace,name);
  SecureKeyCreateRequest secureKeyCreateRequest=parseBody(httpRequest,SecureKeyCreateRequest.class);
  if (secureKeyCreateRequest == null) {
    SecureKeyCreateRequest dummy=new SecureKeyCreateRequest("String_Node_Str","String_Node_Str",ImmutableMap.of("String_Node_Str","String_Node_Str"));
    throw new BadRequestException("String_Node_Str" + "String_Node_Str" + GSON.toJson(dummy));
  }
  secureStoreManager.putSecureData(namespace,name,secureKeyCreateRequest.getData(),secureKeyCreateRequest.getDescription(),secureKeyCreateRequest.getProperties());
  httpResponder.sendStatus(HttpResponseStatus.OK);
}
Program: 5894
Project: 5894
Buggy source:
@Inject SecureStoreHandler(SecureStoreService secureStoreService){
  this.secureStoreService=secureStoreService;
}

Fixed version (ground truth):
@Inject SecureStoreHandler(SecureStore secureStore,SecureStoreManager secureStoreManager){
  this.secureStore=secureStore;
  this.secureStoreManager=secureStoreManager;
}
Program: 5895
Project: 5895
Buggy source:
@Path("String_Node_Str") @GET public void list(HttpRequest httpRequest,HttpResponder httpResponder,@PathParam("String_Node_Str") String namespace) throws Exception {
  NamespaceId namespaceId=new NamespaceId(namespace);
  httpResponder.sendJson(HttpResponseStatus.OK,secureStoreService.list(namespaceId));
}

Fixed version (ground truth):
@Path("String_Node_Str") @GET public void list(HttpRequest httpRequest,HttpResponder httpResponder,@PathParam("String_Node_Str") String namespace) throws Exception {
  httpResponder.sendJson(HttpResponseStatus.OK,secureStore.listSecureData(namespace));
}
Program: 5896
Project: 5896
Buggy source:
@Path("String_Node_Str") @DELETE public void delete(HttpRequest httpRequest,HttpResponder httpResponder,@PathParam("String_Node_Str") String namespace,@PathParam("String_Node_Str") String name) throws Exception {
  SecureKeyId secureKeyId=new SecureKeyId(namespace,name);
  secureStoreService.delete(secureKeyId);
  httpResponder.sendStatus(HttpResponseStatus.OK);
}

Fixed version (ground truth):
@Path("String_Node_Str") @DELETE public void delete(HttpRequest httpRequest,HttpResponder httpResponder,@PathParam("String_Node_Str") String namespace,@PathParam("String_Node_Str") String name) throws Exception {
  secureStoreManager.deleteSecureData(namespace,name);
  httpResponder.sendStatus(HttpResponseStatus.OK);
}
Program: 5897
Project: 5897
Buggy source:
@Override public List<SecureStoreMetadata> listSecureData(String namespace) throws Exception {
  return secureStore.listSecureData(namespace);
}

Fixed version (ground truth):
@Override public Map<String,String> listSecureData(String namespace) throws Exception {
  return secureStore.listSecureData(namespace);
}
Program: 5898
Project: 5898
Buggy source:
@Override public List<SecureStoreMetadata> listSecureData(String namespace) throws Exception {
  return delegate.listSecureData(namespace);
}

Fixed version (ground truth):
@Override public Map<String,String> listSecureData(String namespace) throws Exception {
  return delegate.listSecureData(namespace);
}
Program: 5899
Project: 5899
Buggy source:
@Path("String_Node_Str") @GET public void list(HttpServiceRequest request,HttpServiceResponder responder) throws Exception {
  String name=getContext().listSecureData(namespace).get(0).getName();
  responder.sendString(name);
}

Fixed version (ground truth):
@Path("String_Node_Str") @GET public void list(HttpServiceRequest request,HttpServiceResponder responder) throws Exception {
  String name=(String)getContext().listSecureData(namespace).keySet().toArray()[0];
  responder.sendString(name);
}
Program: 5900
Project: 5900
Buggy source:
@Override public List<SecureStoreMetadata> listSecureData(String namespace) throws Exception {
  return null;
}

Fixed version (ground truth):
@Override public Map<String,String> listSecureData(String namespace) throws Exception {
  return null;
}
Program: 5901
Project: 5901
Buggy source:
@Override public void initialize() throws Exception {
  SparkClientContext context=getContext();
  SparkConf sparkConf=new SparkConf();
  Map<String,String> programProperties=context.getSpecification().getProperties();
  String extraOpts=programProperties.get("String_Node_Str");
  if (extraOpts != null && !extraOpts.isEmpty()) {
    sparkConf.set("String_Node_Str",extraOpts);
    sparkConf.set("String_Node_Str",extraOpts);
  }
  Boolean isUnitTest=Boolean.valueOf(programProperties.get("String_Node_Str"));
  if (isUnitTest) {
    Integer numSources=Integer.valueOf(programProperties.get("String_Node_Str"));
    sparkConf.setMaster(String.format("String_Node_Str",numSources + 1));
    sparkConf.set("String_Node_Str",String.valueOf(numSources + 2));
  }
  context.setSparkConf(sparkConf);
}

Fixed version (ground truth):
@Override public void initialize() throws Exception {
  SparkClientContext context=getContext();
  SparkConf sparkConf=new SparkConf();
  Map<String,String> programProperties=context.getSpecification().getProperties();
  String extraOpts=programProperties.get("String_Node_Str");
  if (extraOpts != null && !extraOpts.isEmpty()) {
    sparkConf.set("String_Node_Str",extraOpts);
    sparkConf.set("String_Node_Str",extraOpts);
  }
  Integer numSources=Integer.valueOf(programProperties.get("String_Node_Str"));
  sparkConf.set("String_Node_Str",String.valueOf(numSources + 2));
  Boolean isUnitTest=Boolean.valueOf(programProperties.get("String_Node_Str"));
  if (isUnitTest) {
    sparkConf.setMaster(String.format("String_Node_Str",numSources + 1));
  }
  context.setSparkConf(sparkConf);
}
Program: 5902
Project: 5902
Buggy source:
@Override protected SparkCollection<Object> getSource(String stageName,PluginFunctionContext pluginFunctionContext) throws Exception {
  StreamingSource<Object> source=sec.getPluginContext().newPluginInstance(stageName);
  StreamingContext context=new DefaultStreamingContext(stageName,sec,streamingContext);
  return new DStreamCollection<>(sec,sparkContext,source.getStream(context));
}

Fixed version (ground truth):
@Override protected SparkCollection<Object> getSource(final String stageName,PluginFunctionContext pluginFunctionContext) throws Exception {
  StreamingSource<Object> source=sec.getPluginContext().newPluginInstance(stageName);
  StreamingContext context=new DefaultStreamingContext(stageName,sec,streamingContext);
  return new DStreamCollection<>(sec,sparkContext,source.getStream(context).transform(new Function<JavaRDD<Object>,JavaRDD<Object>>(){
    @Override public JavaRDD<Object> call(    JavaRDD<Object> input) throws Exception {
      return input.map(new CountingFunction<>(stageName,sec.getMetrics(),"String_Node_Str"));
    }
  }
));
}
Program: 5906
Project: 5906
Buggy source:
SparkCollection<T> window(Windower windower);

Fixed version (ground truth):
SparkCollection<T> window(String stageName,Windower windower);
Program: 5908
Project: 5908
Buggy source:
@Override public <U>SparkCollection<U> compute(String stageName,SparkCompute<T,U> compute) throws Exception {
  SparkExecutionPluginContext sparkPluginContext=new BasicSparkExecutionPluginContext(sec,jsc,datasetContext,stageName);
  compute.initialize(sparkPluginContext);
  long recordsIn=rdd.cache().count();
  StageMetrics stageMetrics=new DefaultStageMetrics(sec.getMetrics(),stageName);
  stageMetrics.gauge("String_Node_Str",recordsIn);
  JavaRDD<U> computedRDD=compute.transform(sparkPluginContext,rdd).cache();
  long recordsOut=computedRDD.count();
  stageMetrics.gauge("String_Node_Str",recordsOut);
  return wrap(computedRDD);
}

Fixed version (ground truth):
@Override public <U>SparkCollection<U> compute(String stageName,SparkCompute<T,U> compute) throws Exception {
  SparkExecutionPluginContext sparkPluginContext=new BasicSparkExecutionPluginContext(sec,jsc,datasetContext,stageName);
  compute.initialize(sparkPluginContext);
  JavaRDD<T> countedInput=rdd.map(new CountingFunction<T>(stageName,sec.getMetrics(),"String_Node_Str")).cache();
  return wrap(compute.transform(sparkPluginContext,countedInput).map(new CountingFunction<U>(stageName,sec.getMetrics(),"String_Node_Str")));
}
Program: 5909
Project: 5909
Buggy source:
@Override public void store(String stageName,SparkSink<T> sink) throws Exception {
  SparkExecutionPluginContext sparkPluginContext=new BasicSparkExecutionPluginContext(sec,jsc,datasetContext,stageName);
  long recordsIn=rdd.cache().count();
  StageMetrics stageMetrics=new DefaultStageMetrics(sec.getMetrics(),stageName);
  stageMetrics.gauge("String_Node_Str",recordsIn);
  sink.run(sparkPluginContext,rdd);
}

Fixed version (ground truth):
@Override public void store(String stageName,SparkSink<T> sink) throws Exception {
  SparkExecutionPluginContext sparkPluginContext=new BasicSparkExecutionPluginContext(sec,jsc,datasetContext,stageName);
  JavaRDD<T> countedRDD=rdd.map(new CountingFunction<T>(stageName,sec.getMetrics(),"String_Node_Str")).cache();
  sink.run(sparkPluginContext,countedRDD);
}
Program: 5910
Project: 5910
Buggy source:
@Override public SparkCollection<T> window(Windower windower){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public SparkCollection<T> window(String stageName,Windower windower){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 5911
Project: 5911
Buggy source:
@Override public <U>SparkCollection<U> compute(final String stageName,final SparkCompute<T,U> compute) throws Exception {
  sec.execute(new TxRunnable(){
    @Override public void run(    DatasetContext datasetContext) throws Exception {
      SparkExecutionPluginContext sparkPluginContext=new BasicSparkExecutionPluginContext(sec,sparkContext,datasetContext,stageName);
      compute.initialize(sparkPluginContext);
    }
  }
);
  return wrap(stream.transform(new Function2<JavaRDD<T>,Time,JavaRDD<U>>(){
    @Override public JavaRDD<U> call(    JavaRDD<T> data,    Time batchTime) throws Exception {
      SparkExecutionPluginContext sparkPluginContext=new SparkStreamingExecutionContext(sec,sparkContext,stageName,batchTime.milliseconds());
      return compute.transform(sparkPluginContext,data);
    }
  }
));
}

Fixed version (ground truth):
@Override public <U>SparkCollection<U> compute(final String stageName,final SparkCompute<T,U> compute) throws Exception {
  sec.execute(new TxRunnable(){
    @Override public void run(    DatasetContext datasetContext) throws Exception {
      SparkExecutionPluginContext sparkPluginContext=new BasicSparkExecutionPluginContext(sec,sparkContext,datasetContext,stageName);
      compute.initialize(sparkPluginContext);
    }
  }
);
  return wrap(stream.transform(new Function2<JavaRDD<T>,Time,JavaRDD<U>>(){
    @Override public JavaRDD<U> call(    JavaRDD<T> data,    Time batchTime) throws Exception {
      SparkExecutionPluginContext sparkPluginContext=new SparkStreamingExecutionContext(sec,sparkContext,stageName,batchTime.milliseconds());
      data=data.map(new CountingFunction<T>(stageName,sec.getMetrics(),"String_Node_Str"));
      return compute.transform(sparkPluginContext,data).map(new CountingFunction<U>(stageName,sec.getMetrics(),"String_Node_Str"));
    }
  }
));
}
Program: 5912
Project: 5912
Buggy source:
@Override public Void call(JavaRDD<T> data,Time batchTime) throws Exception {
  final long logicalStartTime=batchTime.milliseconds();
  MacroEvaluator evaluator=new DefaultMacroEvaluator(sec.getWorkflowToken(),sec.getRuntimeArguments(),logicalStartTime,sec.getSecureStore(),sec.getNamespace());
  final SparkBatchSinkFactory sinkFactory=new SparkBatchSinkFactory();
  final BatchSink<Object,Object,Object> batchSink=sec.getPluginContext().newPluginInstance(stageName,evaluator);
  boolean isPrepared=false;
  boolean isDone=false;
  try {
    sec.execute(new TxRunnable(){
      @Override public void run(      DatasetContext datasetContext) throws Exception {
        SparkBatchSinkContext sinkContext=new SparkBatchSinkContext(sinkFactory,sec,datasetContext,stageName,logicalStartTime);
        batchSink.prepareRun(sinkContext);
      }
    }
);
    isPrepared=true;
    sinkFactory.writeFromRDD(data.flatMapToPair(sinkFunction),sec,stageName,Object.class,Object.class);
    isDone=true;
    sec.execute(new TxRunnable(){
      @Override public void run(      DatasetContext datasetContext) throws Exception {
        SparkBatchSinkContext sinkContext=new SparkBatchSinkContext(sinkFactory,sec,datasetContext,stageName,logicalStartTime);
        batchSink.onRunFinish(true,sinkContext);
      }
    }
);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",stageName,logicalStartTime,e);
  }
 finally {
    if (isPrepared && !isDone) {
      sec.execute(new TxRunnable(){
        @Override public void run(        DatasetContext datasetContext) throws Exception {
          SparkBatchSinkContext sinkContext=new SparkBatchSinkContext(sinkFactory,sec,datasetContext,stageName,logicalStartTime);
          batchSink.onRunFinish(false,sinkContext);
        }
      }
);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public JavaRDD<T> call(JavaRDD<T> in) throws Exception {
  return in.map(new CountingFunction<T>(stageName,sec.getMetrics(),"String_Node_Str"));
}
Program: 5913
Project: 5913
Buggy source:
@Override public SparkCollection<T> window(Windower windower){
  return wrap(stream.window(Durations.seconds(windower.getWidth()),Durations.seconds(windower.getSlideInterval())));
}

Fixed version (ground truth):
@Override public SparkCollection<T> window(final String stageName,Windower windower){
  return wrap(stream.transform(new Function<JavaRDD<T>,JavaRDD<T>>(){
    @Override public JavaRDD<T> call(    JavaRDD<T> in) throws Exception {
      return in.map(new CountingFunction<T>(stageName,sec.getMetrics(),"String_Node_Str"));
    }
  }
).window(Durations.seconds(windower.getWidth()),Durations.seconds(windower.getSlideInterval())).transform(new Function<JavaRDD<T>,JavaRDD<T>>(){
    @Override public JavaRDD<T> call(    JavaRDD<T> in) throws Exception {
      return in.map(new CountingFunction<T>(stageName,sec.getMetrics(),"String_Node_Str"));
    }
  }
));
}
Program: 5914
Project: 5914
Buggy source:
@BeforeClass public static void setup() throws Exception {
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,TMP_FOLDER.newFolder().getAbsolutePath());
  cConf.setBoolean(Constants.Security.ENABLED,true);
  cConf.setBoolean(Constants.Security.KERBEROS_ENABLED,false);
  cConf.setBoolean(Constants.Security.Authorization.ENABLED,true);
  cConf.setBoolean(Constants.Security.Authorization.CACHE_ENABLED,false);
  Location deploymentJar=AppJarHelper.createDeploymentJar(new LocalLocationFactory(TMP_FOLDER.newFolder()),InMemoryAuthorizer.class);
  cConf.set(Constants.Security.Authorization.EXTENSION_JAR_PATH,deploymentJar.toURI().getPath());
  File systemArtifactsDir=TMP_FOLDER.newFolder();
  cConf.set(Constants.AppFabric.SYSTEM_ARTIFACTS_DIR,systemArtifactsDir.getAbsolutePath());
  createSystemArtifact(systemArtifactsDir);
  systemUser=new AuthenticationTestContext().getPrincipal().getName();
  cConf.set(Constants.Security.Authorization.SYSTEM_USER,systemUser);
  Injector injector=AppFabricTestHelper.getInjector(cConf);
  artifactRepository=injector.getInstance(ArtifactRepository.class);
  AuthorizerInstantiator instantiatorService=injector.getInstance(AuthorizerInstantiator.class);
  authorizer=instantiatorService.get();
  authEnforcerService=injector.getInstance(AuthorizationEnforcementService.class);
  authEnforcerService.startAndWait();
  instance=new InstanceId(cConf.get(Constants.INSTANCE_NAME));
  namespaceAdmin=injector.getInstance(NamespaceAdmin.class);
}

Fixed version (ground truth):
@BeforeClass public static void setup() throws Exception {
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,TMP_FOLDER.newFolder().getAbsolutePath());
  cConf.setBoolean(Constants.Security.ENABLED,true);
  cConf.setBoolean(Constants.Security.KERBEROS_ENABLED,false);
  cConf.setBoolean(Constants.Security.Authorization.ENABLED,true);
  cConf.setBoolean(Constants.Security.Authorization.CACHE_ENABLED,false);
  Location deploymentJar=AppJarHelper.createDeploymentJar(new LocalLocationFactory(TMP_FOLDER.newFolder()),InMemoryAuthorizer.class);
  cConf.set(Constants.Security.Authorization.EXTENSION_JAR_PATH,deploymentJar.toURI().getPath());
  File systemArtifactsDir=TMP_FOLDER.newFolder();
  cConf.set(Constants.AppFabric.SYSTEM_ARTIFACTS_DIR,systemArtifactsDir.getAbsolutePath());
  createSystemArtifact(systemArtifactsDir);
  Injector injector=AppFabricTestHelper.getInjector(cConf);
  artifactRepository=injector.getInstance(ArtifactRepository.class);
  AuthorizerInstantiator instantiatorService=injector.getInstance(AuthorizerInstantiator.class);
  authorizer=instantiatorService.get();
  authEnforcerService=injector.getInstance(AuthorizationEnforcementService.class);
  authEnforcerService.startAndWait();
  instance=new InstanceId(cConf.get(Constants.INSTANCE_NAME));
  namespaceAdmin=injector.getInstance(NamespaceAdmin.class);
}
Program: 5916
Project: 5916
Buggy source:
private static CConfiguration createCConf() throws Exception {
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,TEMPORARY_FOLDER.newFolder().getAbsolutePath());
  cConf.setBoolean(Constants.Security.ENABLED,true);
  cConf.setBoolean(Constants.Security.Authorization.ENABLED,true);
  cConf.setBoolean(Constants.Security.KERBEROS_ENABLED,false);
  cConf.setBoolean(Constants.Security.Authorization.CACHE_ENABLED,false);
  cConf.set(Constants.Security.Authorization.SYSTEM_USER,new MasterAuthenticationContext().getPrincipal().getName());
  LocationFactory locationFactory=new LocalLocationFactory(TEMPORARY_FOLDER.newFolder());
  Location authorizerJar=AppJarHelper.createDeploymentJar(locationFactory,InMemoryAuthorizer.class);
  cConf.set(Constants.Security.Authorization.EXTENSION_JAR_PATH,authorizerJar.toURI().getPath());
  cConf.set(Constants.Security.Store.PROVIDER,"String_Node_Str");
  return cConf;
}

Fixed version (ground truth):
private static CConfiguration createCConf() throws Exception {
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,TEMPORARY_FOLDER.newFolder().getAbsolutePath());
  cConf.setBoolean(Constants.Security.ENABLED,true);
  cConf.setBoolean(Constants.Security.Authorization.ENABLED,true);
  cConf.setBoolean(Constants.Security.KERBEROS_ENABLED,false);
  cConf.setBoolean(Constants.Security.Authorization.CACHE_ENABLED,false);
  LocationFactory locationFactory=new LocalLocationFactory(TEMPORARY_FOLDER.newFolder());
  Location authorizerJar=AppJarHelper.createDeploymentJar(locationFactory,InMemoryAuthorizer.class);
  cConf.set(Constants.Security.Authorization.EXTENSION_JAR_PATH,authorizerJar.toURI().getPath());
  cConf.set(Constants.Security.Store.PROVIDER,"String_Node_Str");
  return cConf;
}
Program: 5919
Project: 5919
Buggy source:
@BeforeClass public static void setup() throws IOException, InterruptedException {
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,TEMPORARY_FOLDER.newFolder().getAbsolutePath());
  cConf.setBoolean(Constants.Security.ENABLED,true);
  cConf.setBoolean(Constants.Security.KERBEROS_ENABLED,false);
  cConf.setBoolean(Constants.Security.Authorization.ENABLED,true);
  cConf.setBoolean(Constants.Security.Authorization.CACHE_ENABLED,false);
  cConf.set(Constants.Security.Authorization.SYSTEM_USER,new MasterAuthenticationContext().getPrincipal().getName());
  Manifest manifest=new Manifest();
  manifest.getMainAttributes().put(Attributes.Name.MAIN_CLASS,InMemoryAuthorizer.class.getName());
  LocationFactory locationFactory=new LocalLocationFactory(TEMPORARY_FOLDER.newFolder());
  Location externalAuthJar=AppJarHelper.createDeploymentJar(locationFactory,InMemoryAuthorizer.class,manifest);
  cConf.set(Constants.Security.Authorization.EXTENSION_JAR_PATH,externalAuthJar.toString());
  Injector injector=AppFabricTestHelper.getInjector(cConf);
  discoveryService=injector.getInstance(DiscoveryServiceClient.class);
  appFabricServer=injector.getInstance(AppFabricServer.class);
  appFabricServer.startAndWait();
  waitForService(Constants.Service.APP_FABRIC_HTTP);
  authorizer=injector.getInstance(AuthorizerInstantiator.class).get();
  privilegesFetcher=injector.getInstance(PrivilegesFetcher.class);
  privilegesManager=injector.getInstance(PrivilegesManager.class);
}

Fixed version (ground truth):
@BeforeClass public static void setup() throws IOException, InterruptedException {
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,TEMPORARY_FOLDER.newFolder().getAbsolutePath());
  cConf.setBoolean(Constants.Security.ENABLED,true);
  cConf.setBoolean(Constants.Security.KERBEROS_ENABLED,false);
  cConf.setBoolean(Constants.Security.Authorization.ENABLED,true);
  cConf.setBoolean(Constants.Security.Authorization.CACHE_ENABLED,false);
  Manifest manifest=new Manifest();
  manifest.getMainAttributes().put(Attributes.Name.MAIN_CLASS,InMemoryAuthorizer.class.getName());
  LocationFactory locationFactory=new LocalLocationFactory(TEMPORARY_FOLDER.newFolder());
  Location externalAuthJar=AppJarHelper.createDeploymentJar(locationFactory,InMemoryAuthorizer.class,manifest);
  cConf.set(Constants.Security.Authorization.EXTENSION_JAR_PATH,externalAuthJar.toString());
  Injector injector=AppFabricTestHelper.getInjector(cConf);
  discoveryService=injector.getInstance(DiscoveryServiceClient.class);
  appFabricServer=injector.getInstance(AppFabricServer.class);
  appFabricServer.startAndWait();
  waitForService(Constants.Service.APP_FABRIC_HTTP);
  authorizer=injector.getInstance(AuthorizerInstantiator.class).get();
  privilegesFetcher=injector.getInstance(PrivilegesFetcher.class);
  privilegesManager=injector.getInstance(PrivilegesManager.class);
}
Program: 5920
Project: 5920
Buggy source:
private static CConfiguration createCConf() throws IOException {
  CConfiguration cConf=CConfiguration.create();
  cConf.setBoolean(Constants.Security.ENABLED,true);
  cConf.setBoolean(Constants.Security.Authorization.ENABLED,true);
  cConf.setBoolean(Constants.Security.KERBEROS_ENABLED,false);
  cConf.setBoolean(Constants.Security.Authorization.CACHE_ENABLED,false);
  LocationFactory locationFactory=new LocalLocationFactory(new File(TEMPORARY_FOLDER.newFolder().toURI()));
  Location authorizerJar=AppJarHelper.createDeploymentJar(locationFactory,InMemoryAuthorizer.class);
  cConf.set(Constants.Security.Authorization.EXTENSION_JAR_PATH,authorizerJar.toURI().getPath());
  cConf.set(Constants.Security.Authorization.SYSTEM_USER,new MasterAuthenticationContext().getPrincipal().getName());
  return cConf;
}

Fixed version (ground truth):
private static CConfiguration createCConf() throws IOException {
  CConfiguration cConf=CConfiguration.create();
  cConf.setBoolean(Constants.Security.ENABLED,true);
  cConf.setBoolean(Constants.Security.Authorization.ENABLED,true);
  cConf.setBoolean(Constants.Security.KERBEROS_ENABLED,false);
  cConf.setBoolean(Constants.Security.Authorization.CACHE_ENABLED,false);
  LocationFactory locationFactory=new LocalLocationFactory(new File(TEMPORARY_FOLDER.newFolder().toURI()));
  Location authorizerJar=AppJarHelper.createDeploymentJar(locationFactory,InMemoryAuthorizer.class);
  cConf.set(Constants.Security.Authorization.EXTENSION_JAR_PATH,authorizerJar.toURI().getPath());
  return cConf;
}
Program: 5921
Project: 5921
Buggy source:
private static String[] getAuthConfigs(File tmpDir) throws IOException {
  LocationFactory locationFactory=new LocalLocationFactory(tmpDir);
  Location authExtensionJar=AppJarHelper.createDeploymentJar(locationFactory,InMemoryAuthorizer.class);
  return new String[]{Constants.Security.ENABLED,"String_Node_Str",Constants.Security.AUTH_HANDLER_CLASS,BasicAuthenticationHandler.class.getName(),Constants.Security.Router.BYPASS_AUTHENTICATION_REGEX,"String_Node_Str",Constants.Security.Authorization.ENABLED,"String_Node_Str",Constants.Security.Authorization.CACHE_ENABLED,"String_Node_Str",Constants.Security.Authorization.EXTENSION_JAR_PATH,authExtensionJar.toURI().getPath(),Constants.Security.Authorization.SYSTEM_USER,new MasterAuthenticationContext().getPrincipal().getName(),Constants.Security.Authorization.EXTENSION_CONFIG_PREFIX + "String_Node_Str","String_Node_Str",Constants.Security.KERBEROS_ENABLED,"String_Node_Str",Constants.Explore.EXPLORE_ENABLED,"String_Node_Str"};
}

Fixed version (ground truth):
private static String[] getAuthConfigs(File tmpDir) throws IOException {
  LocationFactory locationFactory=new LocalLocationFactory(tmpDir);
  Location authExtensionJar=AppJarHelper.createDeploymentJar(locationFactory,InMemoryAuthorizer.class);
  return new String[]{Constants.Security.ENABLED,"String_Node_Str",Constants.Security.AUTH_HANDLER_CLASS,BasicAuthenticationHandler.class.getName(),Constants.Security.Router.BYPASS_AUTHENTICATION_REGEX,"String_Node_Str",Constants.Security.Authorization.ENABLED,"String_Node_Str",Constants.Security.Authorization.CACHE_ENABLED,"String_Node_Str",Constants.Security.Authorization.EXTENSION_JAR_PATH,authExtensionJar.toURI().getPath(),Constants.Security.Authorization.EXTENSION_CONFIG_PREFIX + "String_Node_Str","String_Node_Str",Constants.Security.KERBEROS_ENABLED,"String_Node_Str",Constants.Explore.EXPLORE_ENABLED,"String_Node_Str"};
}
Program: 5922
Project: 5922
Buggy source:
/** 
 * Get all artifacts that match artifacts in the given ranges.
 * @namespace namespace
 * @param range the range to match artifacts in
 * @return an unmodifiable list of all artifacts that match the given ranges. If none exist, an empty listis returned
 */
public List<ArtifactDetail> getArtifacts(final ArtifactRange range) throws Exception {
  List<ArtifactDetail> artifacts=artifactStore.getArtifacts(range);
  Principal principal=authenticationContext.getPrincipal();
  final Predicate<EntityId> filter=authorizationEnforcer.createFilter(principal);
  return Lists.newArrayList(Iterables.filter(artifacts,new com.google.common.base.Predicate<ArtifactDetail>(){
    @Override public boolean apply(    ArtifactDetail artifactDetail){
      ArtifactId artifactId=artifactDetail.getDescriptor().getArtifactId();
      return filter.apply(range.getNamespace().toEntityId().artifact(artifactId.getName(),artifactId.getVersion().getVersion()));
    }
  }
));
}

Fixed version (ground truth):
/** 
 * Get all artifacts that match artifacts in the given ranges.
 * @param range the range to match artifacts in
 * @return an unmodifiable list of all artifacts that match the given ranges. If none exist, an empty list is returned
 */
public List<ArtifactDetail> getArtifacts(final ArtifactRange range) throws Exception {
  List<ArtifactDetail> artifacts=artifactStore.getArtifacts(range);
  Principal principal=authenticationContext.getPrincipal();
  final Predicate<EntityId> filter=authorizationEnforcer.createFilter(principal);
  return Lists.newArrayList(Iterables.filter(artifacts,new com.google.common.base.Predicate<ArtifactDetail>(){
    @Override public boolean apply(    ArtifactDetail artifactDetail){
      ArtifactId artifactId=artifactDetail.getDescriptor().getArtifactId();
      return filter.apply(range.getNamespace().toEntityId().artifact(artifactId.getName(),artifactId.getVersion().getVersion()));
    }
  }
));
}
Program: 5928
Project: 5928
Buggy source:
@Override protected void configure(){
  bind(DynamicDatasetCache.class).toProvider(DynamicDatasetCacheProvider.class).in(Scopes.SINGLETON);
  bind(DatasetContext.class).to(DynamicDatasetCache.class).in(Scopes.SINGLETON);
  bind(Admin.class).toProvider(AdminProvider.class);
  bind(Transactional.class).toProvider(TransactionalProvider.class);
  install(new FactoryModuleBuilder().implement(AuthorizationContext.class,DefaultAuthorizationContext.class).build(AuthorizationContextFactory.class));
  bind(AuthorizerInstantiator.class).in(Scopes.SINGLETON);
  expose(AuthorizerInstantiator.class);
  bind(PrivilegesManager.class).to(AuthorizerAsPrivilegesManager.class);
  expose(PrivilegesManager.class);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(DynamicDatasetCache.class).toProvider(DynamicDatasetCacheProvider.class).in(Scopes.SINGLETON);
  bind(DatasetContext.class).to(DynamicDatasetCache.class).in(Scopes.SINGLETON);
  bind(Admin.class).toProvider(AdminProvider.class);
  bind(Transactional.class).toProvider(TransactionalProvider.class);
  install(new FactoryModuleBuilder().implement(AuthorizationContext.class,DefaultAuthorizationContext.class).build(AuthorizationContextFactory.class));
  bind(AuthorizerInstantiator.class).in(Scopes.SINGLETON);
  expose(AuthorizerInstantiator.class);
  bind(PrivilegesManager.class).to(DefaultPrivilegesManager.class);
  expose(PrivilegesManager.class);
}
Program: 5929
Project: 5929
Buggy source:
@Inject AuthorizationHandler(AuthorizerInstantiator authorizerInstantiator,CConfiguration cConf,AuthorizationEnforcer authorizationEnforcer,AuthenticationContext authenticationContext,EntityExistenceVerifier entityExistenceVerifier){
  this.authorizer=authorizerInstantiator.get();
  this.authorizationEnforcer=authorizationEnforcer;
  this.authenticationContext=authenticationContext;
  this.authenticationEnabled=cConf.getBoolean(Constants.Security.ENABLED);
  this.authorizationEnabled=cConf.getBoolean(Constants.Security.Authorization.ENABLED);
  this.entityExistenceVerifier=entityExistenceVerifier;
}

Fixed version (ground truth):
@Inject AuthorizationHandler(PrivilegesManager privilegesManager,AuthorizerInstantiator authorizerInstantiator,CConfiguration cConf,AuthorizationEnforcer authorizationEnforcer,AuthenticationContext authenticationContext,EntityExistenceVerifier entityExistenceVerifier){
  this.privilegesManager=privilegesManager;
  this.authorizer=authorizerInstantiator.get();
  this.authorizationEnforcer=authorizationEnforcer;
  this.authenticationContext=authenticationContext;
  this.authenticationEnabled=cConf.getBoolean(Constants.Security.ENABLED);
  this.authorizationEnabled=cConf.getBoolean(Constants.Security.Authorization.ENABLED);
  this.entityExistenceVerifier=entityExistenceVerifier;
}
Program: 5930
Project: 5930
Buggy source:
@Path("String_Node_Str") @POST public void revoke(HttpRequest httpRequest,HttpResponder httpResponder) throws Exception {
  ensureSecurityEnabled();
  RevokeRequest request=parseBody(httpRequest,RevokeRequest.class);
  verifyAuthRequest(request);
  authorizationEnforcer.enforce(request.getEntity(),authenticationContext.getPrincipal(),Action.ADMIN);
  if (request.getPrincipal() == null && request.getActions() == null) {
    authorizer.revoke(request.getEntity());
  }
 else {
    Set<Action> actions=request.getActions() == null ? EnumSet.allOf(Action.class) : request.getActions();
    authorizer.revoke(request.getEntity(),request.getPrincipal(),actions);
  }
  httpResponder.sendStatus(HttpResponseStatus.OK);
  createLogEntry(httpRequest,request,HttpResponseStatus.OK);
}

Fixed version (ground truth):
@Path("String_Node_Str") @POST public void revoke(HttpRequest httpRequest,HttpResponder httpResponder) throws Exception {
  ensureSecurityEnabled();
  RevokeRequest request=parseBody(httpRequest,RevokeRequest.class);
  verifyAuthRequest(request);
  authorizationEnforcer.enforce(request.getEntity(),authenticationContext.getPrincipal(),Action.ADMIN);
  if (request.getPrincipal() == null && request.getActions() == null) {
    privilegesManager.revoke(request.getEntity());
  }
 else {
    Set<Action> actions=request.getActions() == null ? EnumSet.allOf(Action.class) : request.getActions();
    privilegesManager.revoke(request.getEntity(),request.getPrincipal(),actions);
  }
  httpResponder.sendStatus(HttpResponseStatus.OK);
  createLogEntry(httpRequest,request,HttpResponseStatus.OK);
}