nus-yam/ex-repair huggingface dataset:
Program: 6002
Project: 6002
Buggy source:
@Inject public DatasetModuleNameCompleter(final DatasetModuleClient datasetModuleClient,final CLIConfig cliConfig){
  super(new Supplier<Collection<String>>(){
    @Override public Collection<String> get(){
      try {
        List<DatasetModuleMeta> list=datasetModuleClient.list(cliConfig.getCurrentNamespace());
        return Lists.newArrayList(Iterables.transform(list,new Function<DatasetModuleMeta,String>(){
          @Override public String apply(          DatasetModuleMeta input){
            return input.getName();
          }
        }
));
      }
 catch (      IOException e) {
        return Lists.newArrayList();
      }
catch (      UnauthenticatedException e) {
        return Lists.newArrayList();
      }
    }
  }
);
}

Fixed version (ground truth):
@Inject public DatasetModuleNameCompleter(final DatasetModuleClient datasetModuleClient,final CLIConfig cliConfig){
  super(new Supplier<Collection<String>>(){
    @Override public Collection<String> get(){
      try {
        List<DatasetModuleMeta> list=datasetModuleClient.list(cliConfig.getCurrentNamespace());
        return Lists.newArrayList(Iterables.transform(list,new Function<DatasetModuleMeta,String>(){
          @Override public String apply(          DatasetModuleMeta input){
            return input.getName();
          }
        }
));
      }
 catch (      IOException|UnauthenticatedException|UnauthorizedException e) {
        return new ArrayList<>();
      }
    }
  }
);
}
Program: 6003
Project: 6003
Buggy source:
@Inject public DatasetNameCompleter(final DatasetClient datasetClient,final CLIConfig cliConfig){
  super(new Supplier<Collection<String>>(){
    @Override public Collection<String> get(){
      try {
        List<DatasetSpecificationSummary> list=datasetClient.list(cliConfig.getCurrentNamespace());
        return Lists.newArrayList(Iterables.transform(list,new Function<DatasetSpecificationSummary,String>(){
          @Override public String apply(          DatasetSpecificationSummary input){
            String[] tokens=input.getName().split("String_Node_Str");
            return tokens[tokens.length - 1];
          }
        }
));
      }
 catch (      IOException e) {
        return Lists.newArrayList();
      }
catch (      UnauthenticatedException e) {
        return Lists.newArrayList();
      }
    }
  }
);
}

Fixed version (ground truth):
@Inject public DatasetNameCompleter(final DatasetClient datasetClient,final CLIConfig cliConfig){
  super(new Supplier<Collection<String>>(){
    @Override public Collection<String> get(){
      try {
        List<DatasetSpecificationSummary> list=datasetClient.list(cliConfig.getCurrentNamespace());
        return Lists.newArrayList(Iterables.transform(list,new Function<DatasetSpecificationSummary,String>(){
          @Override public String apply(          DatasetSpecificationSummary input){
            String[] tokens=input.getName().split("String_Node_Str");
            return tokens[tokens.length - 1];
          }
        }
));
      }
 catch (      IOException|UnauthenticatedException|UnauthorizedException e) {
        return new ArrayList<>();
      }
    }
  }
);
}
Program: 6004
Project: 6004
Buggy source:
@Override public Collection<String> get(){
  try {
    List<DatasetSpecificationSummary> list=datasetClient.list(cliConfig.getCurrentNamespace());
    return Lists.newArrayList(Iterables.transform(list,new Function<DatasetSpecificationSummary,String>(){
      @Override public String apply(      DatasetSpecificationSummary input){
        String[] tokens=input.getName().split("String_Node_Str");
        return tokens[tokens.length - 1];
      }
    }
));
  }
 catch (  IOException e) {
    return Lists.newArrayList();
  }
catch (  UnauthenticatedException e) {
    return Lists.newArrayList();
  }
}

Fixed version (ground truth):
@Override public Collection<String> get(){
  try {
    List<DatasetSpecificationSummary> list=datasetClient.list(cliConfig.getCurrentNamespace());
    return Lists.newArrayList(Iterables.transform(list,new Function<DatasetSpecificationSummary,String>(){
      @Override public String apply(      DatasetSpecificationSummary input){
        String[] tokens=input.getName().split("String_Node_Str");
        return tokens[tokens.length - 1];
      }
    }
));
  }
 catch (  IOException|UnauthenticatedException|UnauthorizedException e) {
    return new ArrayList<>();
  }
}
Program: 6005
Project: 6005
Buggy source:
@Inject public DatasetTypeNameCompleter(final DatasetTypeClient datasetTypeClient,final CLIConfig cliConfig){
  super(new Supplier<Collection<String>>(){
    @Override public Collection<String> get(){
      try {
        List<DatasetTypeMeta> list=datasetTypeClient.list(cliConfig.getCurrentNamespace());
        return Lists.newArrayList(Iterables.transform(list,new Function<DatasetTypeMeta,String>(){
          @Override public String apply(          DatasetTypeMeta input){
            return input.getName();
          }
        }
));
      }
 catch (      IOException e) {
        return Lists.newArrayList();
      }
catch (      UnauthenticatedException e) {
        return Lists.newArrayList();
      }
    }
  }
);
}

Fixed version (ground truth):
@Inject public DatasetTypeNameCompleter(final DatasetTypeClient datasetTypeClient,final CLIConfig cliConfig){
  super(new Supplier<Collection<String>>(){
    @Override public Collection<String> get(){
      try {
        List<DatasetTypeMeta> list=datasetTypeClient.list(cliConfig.getCurrentNamespace());
        return Lists.newArrayList(Iterables.transform(list,new Function<DatasetTypeMeta,String>(){
          @Override public String apply(          DatasetTypeMeta input){
            return input.getName();
          }
        }
));
      }
 catch (      IOException|UnauthenticatedException|UnauthorizedException e) {
        return new ArrayList<>();
      }
    }
  }
);
}
Program: 6006
Project: 6006
Buggy source:
@Override public Collection<String> get(){
  try {
    List<DatasetTypeMeta> list=datasetTypeClient.list(cliConfig.getCurrentNamespace());
    return Lists.newArrayList(Iterables.transform(list,new Function<DatasetTypeMeta,String>(){
      @Override public String apply(      DatasetTypeMeta input){
        return input.getName();
      }
    }
));
  }
 catch (  IOException e) {
    return Lists.newArrayList();
  }
catch (  UnauthenticatedException e) {
    return Lists.newArrayList();
  }
}

Fixed version (ground truth):
@Override public Collection<String> get(){
  try {
    List<DatasetTypeMeta> list=datasetTypeClient.list(cliConfig.getCurrentNamespace());
    return Lists.newArrayList(Iterables.transform(list,new Function<DatasetTypeMeta,String>(){
      @Override public String apply(      DatasetTypeMeta input){
        return input.getName();
      }
    }
));
  }
 catch (  IOException|UnauthenticatedException|UnauthorizedException e) {
    return new ArrayList<>();
  }
}
Program: 6007
Project: 6007
Buggy source:
public Collection<String> getEndpoints(Id.Service serviceId,String method){
  Collection<String> httpEndpoints=Lists.newArrayList();
  try {
    for (    ServiceHttpEndpoint endpoint : serviceClient.getEndpoints(serviceId)) {
      if (endpoint.getMethod().equals(method)) {
        httpEndpoints.add(endpoint.getPath());
      }
    }
  }
 catch (  IOException|NotFoundException|UnauthenticatedException ignored) {
  }
  return httpEndpoints;
}

Fixed version (ground truth):
public Collection<String> getEndpoints(Id.Service serviceId,String method){
  Collection<String> httpEndpoints=Lists.newArrayList();
  try {
    for (    ServiceHttpEndpoint endpoint : serviceClient.getEndpoints(serviceId)) {
      if (endpoint.getMethod().equals(method)) {
        httpEndpoints.add(endpoint.getPath());
      }
    }
  }
 catch (  IOException|NotFoundException|UnauthenticatedException|UnauthorizedException ignored) {
  }
  return httpEndpoints;
}
Program: 6008
Project: 6008
Buggy source:
public Collection<String> getMethods(Id.Service serviceId){
  Collection<String> httpMethods=Lists.newArrayList();
  try {
    for (    ServiceHttpEndpoint endpoint : serviceClient.getEndpoints(serviceId)) {
      String method=endpoint.getMethod();
      if (!httpMethods.contains(method)) {
        httpMethods.add(method);
      }
    }
  }
 catch (  IOException|UnauthenticatedException|NotFoundException ignored) {
  }
  return httpMethods;
}

Fixed version (ground truth):
public Collection<String> getMethods(Id.Service serviceId){
  Collection<String> httpMethods=Lists.newArrayList();
  try {
    for (    ServiceHttpEndpoint endpoint : serviceClient.getEndpoints(serviceId)) {
      String method=endpoint.getMethod();
      if (!httpMethods.contains(method)) {
        httpMethods.add(method);
      }
    }
  }
 catch (  IOException|UnauthenticatedException|NotFoundException|UnauthorizedException ignored) {
  }
  return httpMethods;
}
Program: 6009
Project: 6009
Buggy source:
public ProgramIdCompleter(final ApplicationClient appClient,final CLIConfig cliConfig,final ProgramType programType){
  super(new Supplier<Collection<String>>(){
    @Override public Collection<String> get(){
      try {
        List<ProgramRecord> programs=appClient.listAllPrograms(cliConfig.getCurrentNamespace(),programType);
        List<String> programIds=Lists.newArrayList();
        for (        ProgramRecord programRecord : programs) {
          programIds.add(programRecord.getApp() + "String_Node_Str" + programRecord.getName());
        }
        return programIds;
      }
 catch (      IOException e) {
        return Lists.newArrayList();
      }
catch (      UnauthenticatedException e) {
        return Lists.newArrayList();
      }
    }
  }
);
}

Fixed version (ground truth):
public ProgramIdCompleter(final ApplicationClient appClient,final CLIConfig cliConfig,final ProgramType programType){
  super(new Supplier<Collection<String>>(){
    @Override public Collection<String> get(){
      try {
        List<ProgramRecord> programs=appClient.listAllPrograms(cliConfig.getCurrentNamespace(),programType);
        List<String> programIds=new ArrayList<>();
        for (        ProgramRecord programRecord : programs) {
          programIds.add(programRecord.getApp() + "String_Node_Str" + programRecord.getName());
        }
        return programIds;
      }
 catch (      IOException|UnauthenticatedException|UnauthorizedException e) {
        return new ArrayList<>();
      }
    }
  }
);
}
Program: 6010
Project: 6010
Buggy source:
@Override public Collection<String> get(){
  try {
    List<ProgramRecord> programs=appClient.listAllPrograms(cliConfig.getCurrentNamespace(),programType);
    List<String> programIds=Lists.newArrayList();
    for (    ProgramRecord programRecord : programs) {
      programIds.add(programRecord.getApp() + "String_Node_Str" + programRecord.getName());
    }
    return programIds;
  }
 catch (  IOException e) {
    return Lists.newArrayList();
  }
catch (  UnauthenticatedException e) {
    return Lists.newArrayList();
  }
}

Fixed version (ground truth):
@Override public Collection<String> get(){
  try {
    List<ProgramRecord> programs=appClient.listAllPrograms(cliConfig.getCurrentNamespace(),programType);
    List<String> programIds=new ArrayList<>();
    for (    ProgramRecord programRecord : programs) {
      programIds.add(programRecord.getApp() + "String_Node_Str" + programRecord.getName());
    }
    return programIds;
  }
 catch (  IOException|UnauthenticatedException|UnauthorizedException e) {
    return new ArrayList<>();
  }
}
Program: 6011
Project: 6011
Buggy source:
/** 
 * Ensures that the logged-in user has a   {@link Action privilege} on the specified dataset instance.
 * @param artifactId the {@link co.cask.cdap.proto.id.ArtifactId} to check for privileges
 * @throws UnauthorizedException if the logged in user has no {@link Action privileges} on the specified dataset
 */
private void ensureAccess(co.cask.cdap.proto.id.ArtifactId artifactId) throws Exception {
  Principal principal=authenticationContext.getPrincipal();
  Predicate<EntityId> filter=authorizationEnforcer.createFilter(principal);
  if (!Principal.SYSTEM.equals(principal) && !filter.apply(artifactId)) {
    throw new UnauthorizedException(principal,artifactId);
  }
}

Fixed version (ground truth):
/** 
 * Ensures that the logged-in user has a   {@link Action privilege} on the specified dataset instance.
 * @param artifactId the {@link co.cask.cdap.proto.id.ArtifactId} to check for privileges
 * @throws UnauthorizedException if the logged in user has no {@link Action privileges} on the specified dataset
 */
private void ensureAccess(co.cask.cdap.proto.id.ArtifactId artifactId) throws Exception {
  Principal principal=authenticationContext.getPrincipal();
  Predicate<EntityId> filter=authorizationEnforcer.createFilter(principal);
  if (Principal.SYSTEM.equals(principal) || NamespaceId.SYSTEM.equals(artifactId.getParent())) {
    return;
  }
  if (!filter.apply(artifactId)) {
    throw new UnauthorizedException(principal,artifactId);
  }
}
Program: 6013
Project: 6013
Buggy source:
@VisibleForTesting static Injector createInjector(CConfiguration cConf,Configuration hConf){
  return Guice.createInjector(new ConfigModule(cConf,hConf),new ZKClientModule(),new LocationRuntimeModule().getDistributedModules(),new NamespaceClientRuntimeModule().getDistributedModules(),new DiscoveryRuntimeModule().getDistributedModules(),new DataFabricModules().getDistributedModules(),new DataSetsModules().getDistributedModules(),new ExploreClientModule(),new ViewAdminModules().getDistributedModules(),new StreamAdminModules().getDistributedModules(),new NotificationFeedClientModule(),new KafkaClientModule(),new AuditModule().getDistributedModules(),new AuthorizationModule(),new AuthorizationEnforcementModule().getDistributedModules(),new SecureStoreModules().getDistributedModules(),new AuthenticationContextModules().getMasterModule(),new AbstractModule(){
    @Override protected void configure(){
      bind(UGIProvider.class).to(RemoteUGIProvider.class).in(Scopes.SINGLETON);
      bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Scopes.SINGLETON);
    }
  }
);
}

Fixed version (ground truth):
@VisibleForTesting static Injector createInjector(CConfiguration cConf,Configuration hConf){
  return Guice.createInjector(new ConfigModule(cConf,hConf),new ZKClientModule(),new LocationRuntimeModule().getDistributedModules(),new NamespaceClientRuntimeModule().getDistributedModules(),new DiscoveryRuntimeModule().getDistributedModules(),new DataFabricModules().getDistributedModules(),new DataSetsModules().getDistributedModules(),new ExploreClientModule(),new ViewAdminModules().getDistributedModules(),new StreamAdminModules().getDistributedModules(),new NotificationFeedClientModule(),new KafkaClientModule(),new AuditModule().getDistributedModules(),new AuthorizationEnforcementModule().getDistributedModules(),new SecureStoreModules().getDistributedModules(),new AuthenticationContextModules().getMasterModule(),new AbstractModule(){
    @Override protected void configure(){
      bind(UGIProvider.class).to(RemoteUGIProvider.class).in(Scopes.SINGLETON);
      bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Scopes.SINGLETON);
      bind(PrivilegesManager.class).to(RemotePrivilegesManager.class);
    }
  }
);
}
Program: 6014
Project: 6014
Buggy source:
@Override protected void configure(){
  bind(UGIProvider.class).to(RemoteUGIProvider.class).in(Scopes.SINGLETON);
  bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Scopes.SINGLETON);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(UGIProvider.class).to(RemoteUGIProvider.class).in(Scopes.SINGLETON);
  bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Scopes.SINGLETON);
  bind(PrivilegesManager.class).to(RemotePrivilegesManager.class);
}
Program: 6015
Project: 6015
Buggy source:
private boolean updateWriter(long length) throws IOException {
  bodySize+=length;
  if (bodySize >= bufferThreshold) {
    ContentWriter fileContentWriter;
    try {
      fileContentWriter=impersonator.doAs(streamId.getParent(),new Callable<ContentWriter>(){
        @Override public ContentWriter call() throws Exception {
          return fileContentWriterFactory.create(ImmutableMap.<String,String>of());
        }
      }
);
    }
 catch (    Exception e) {
      Throwables.propagateIfPossible(e,IOException.class);
      throw new IOException(e);
    }
    fileContentWriter.appendAll(bufferedContentWriter.iterator(),true);
    bufferedContentWriter.cancel();
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean updateWriter(long length) throws IOException {
  bodySize+=length;
  if (bodySize >= bufferThreshold) {
    try {
      fileContentWriter=impersonator.doAs(streamId.getParent(),new Callable<ContentWriter>(){
        @Override public ContentWriter call() throws Exception {
          return fileContentWriterFactory.create(ImmutableMap.<String,String>of());
        }
      }
);
    }
 catch (    Exception e) {
      Throwables.propagateIfPossible(e,IOException.class);
      throw new IOException(e);
    }
    fileContentWriter.appendAll(bufferedContentWriter.iterator(),true);
    bufferedContentWriter.cancel();
    return true;
  }
  return false;
}
Program: 6017
Project: 6017
Buggy source:
private static CConfiguration createCConf() throws Exception {
  LocationFactory locationFactory=new LocalLocationFactory(TEMPORARY_FOLDER.newFolder());
  String secureStoreLocation=locationFactory.create("String_Node_Str").toURI().getPath();
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.Security.Store.FILE_PATH,secureStoreLocation);
  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.SUPERUSERS,"String_Node_Str");
  Location authorizerJar=AppJarHelper.createDeploymentJar(locationFactory,InMemoryAuthorizer.class);
  cConf.set(Constants.Security.Authorization.EXTENSION_JAR_PATH,authorizerJar.toURI().getPath());
  return cConf;
}

Fixed version (ground truth):
private static CConfiguration createCConf() throws Exception {
  LocationFactory locationFactory=new LocalLocationFactory(TEMPORARY_FOLDER.newFolder());
  String secureStoreLocation=locationFactory.create("String_Node_Str").toURI().getPath();
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.Security.Store.FILE_PATH,secureStoreLocation);
  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.SUPERUSERS,"String_Node_Str");
  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: 6018
Project: 6018
Buggy source:
@BeforeClass public static void setup() throws Exception {
  CConfiguration cConf=createCConf();
  final Injector injector=AppFabricTestHelper.getInjector(cConf);
  appFabricServer=injector.getInstance(AppFabricServer.class);
  appFabricServer.startAndWait();
  authorizationEnforcementService=injector.getInstance(AuthorizationEnforcementService.class);
  authorizationEnforcementService.startAndWait();
  remoteSystemOperationsService=injector.getInstance(RemoteSystemOperationsService.class);
  remoteSystemOperationsService.startAndWait();
  authorizer=injector.getInstance(AuthorizerInstantiator.class).get();
  SecurityRequestContext.setUserId(ALICE.getName());
  secureStoreService=injector.getInstance(SecureStoreService.class);
  authorizer.grant(NamespaceId.DEFAULT,ALICE,Collections.singleton(Action.READ));
  Tasks.waitFor(true,new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      return injector.getInstance(NamespaceAdmin.class).exists(Id.Namespace.DEFAULT);
    }
  }
,5,TimeUnit.SECONDS);
  authorizer.revoke(NamespaceId.DEFAULT,ALICE,Collections.singleton(Action.READ));
}

Fixed version (ground truth):
@BeforeClass public static void setup() throws Exception {
  CConfiguration cConf=createCConf();
  SConfiguration sConf=SConfiguration.create();
  sConf.set(Constants.Security.Store.FILE_PASSWORD,"String_Node_Str");
  final Injector injector=Guice.createInjector(new AppFabricTestModule(createCConf(),sConf));
  injector.getInstance(TransactionManager.class).startAndWait();
  injector.getInstance(DatasetOpExecutor.class).startAndWait();
  injector.getInstance(DatasetService.class).startAndWait();
  appFabricServer=injector.getInstance(AppFabricServer.class);
  appFabricServer.startAndWait();
  authorizationEnforcementService=injector.getInstance(AuthorizationEnforcementService.class);
  authorizationEnforcementService.startAndWait();
  remoteSystemOperationsService=injector.getInstance(RemoteSystemOperationsService.class);
  remoteSystemOperationsService.startAndWait();
  secureStoreService=injector.getInstance(SecureStoreService.class);
  authorizer=injector.getInstance(AuthorizerInstantiator.class).get();
  SecurityRequestContext.setUserId(ALICE.getName());
  secureStoreService=injector.getInstance(SecureStoreService.class);
  authorizer.grant(NamespaceId.DEFAULT,ALICE,Collections.singleton(Action.READ));
  Tasks.waitFor(true,new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      return injector.getInstance(NamespaceAdmin.class).exists(Id.Namespace.DEFAULT);
    }
  }
,5,TimeUnit.SECONDS);
  authorizer.revoke(NamespaceId.DEFAULT,ALICE,Collections.singleton(Action.READ));
}
Program: 6019
Project: 6019
Buggy source:
@BeforeClass public static void beforeClass() throws Throwable {
  CConfiguration conf=CConfiguration.create();
  conf.set(Constants.AppFabric.SERVER_ADDRESS,hostname);
  conf.set(Constants.CFG_LOCAL_DATA_DIR,tmpFolder.newFolder("String_Node_Str").getAbsolutePath());
  conf.set(Constants.AppFabric.OUTPUT_DIR,System.getProperty("String_Node_Str"));
  conf.set(Constants.AppFabric.TEMP_DIR,System.getProperty("String_Node_Str"));
  conf.setBoolean(Constants.Dangerous.UNRECOVERABLE_RESET,true);
  injector=Guice.createInjector(new AppFabricTestModule(conf));
  txManager=injector.getInstance(TransactionManager.class);
  txManager.startAndWait();
  dsOpService=injector.getInstance(DatasetOpExecutor.class);
  dsOpService.startAndWait();
  remoteSysOpService=injector.getInstance(RemoteSystemOperationsService.class);
  remoteSysOpService.startAndWait();
  datasetService=injector.getInstance(DatasetService.class);
  datasetService.startAndWait();
  appFabricServer=injector.getInstance(AppFabricServer.class);
  appFabricServer.startAndWait();
  DiscoveryServiceClient discoveryClient=injector.getInstance(DiscoveryServiceClient.class);
  ServiceDiscovered appFabricHttpDiscovered=discoveryClient.discover(Constants.Service.APP_FABRIC_HTTP);
  EndpointStrategy endpointStrategy=new RandomEndpointStrategy(appFabricHttpDiscovered);
  port=endpointStrategy.pick(1,TimeUnit.SECONDS).getSocketAddress().getPort();
  txClient=injector.getInstance(TransactionSystemClient.class);
  metricsCollectionService=injector.getInstance(MetricsCollectionService.class);
  metricsCollectionService.startAndWait();
  metricsService=injector.getInstance(MetricsQueryService.class);
  metricsService.startAndWait();
  streamService=injector.getInstance(StreamService.class);
  streamService.startAndWait();
  serviceStore=injector.getInstance(ServiceStore.class);
  serviceStore.startAndWait();
  metadataService=injector.getInstance(MetadataService.class);
  metadataService.startAndWait();
  locationFactory=getInjector().getInstance(LocationFactory.class);
  streamClient=new StreamClient(getClientConfig(discoveryClient,Constants.Service.STREAMS));
  streamViewClient=new StreamViewClient(getClientConfig(discoveryClient,Constants.Service.STREAMS));
  datasetClient=new DatasetClient(getClientConfig(discoveryClient,Constants.Service.DATASET_MANAGER));
  createNamespaces();
}

Fixed version (ground truth):
@BeforeClass public static void beforeClass() throws Throwable {
  initializeAndStartServices(createBasicCConf(),null);
}
Program: 6020
Project: 6020
Buggy source:
public AppFabricTestModule(CConfiguration configuration){
  this.cConf=configuration;
  File localDataDir=new File(cConf.get(Constants.CFG_LOCAL_DATA_DIR));
  hConf=new Configuration();
  hConf.addResource("String_Node_Str");
  hConf.reloadConfiguration();
  hConf.set("String_Node_Str",new File(localDataDir,cConf.get(Constants.AppFabric.TEMP_DIR)).getAbsolutePath());
  hConf.set(Constants.CFG_LOCAL_DATA_DIR,localDataDir.getAbsolutePath());
  hConf.set(Constants.AppFabric.OUTPUT_DIR,cConf.get(Constants.AppFabric.OUTPUT_DIR));
}

Fixed version (ground truth):
public AppFabricTestModule(CConfiguration cConf,@Nullable SConfiguration sConf){
  this.cConf=cConf;
  File localDataDir=new File(cConf.get(Constants.CFG_LOCAL_DATA_DIR));
  hConf=new Configuration();
  hConf.addResource("String_Node_Str");
  hConf.reloadConfiguration();
  hConf.set("String_Node_Str",new File(localDataDir,cConf.get(Constants.AppFabric.TEMP_DIR)).getAbsolutePath());
  hConf.set(Constants.CFG_LOCAL_DATA_DIR,localDataDir.getAbsolutePath());
  hConf.set(Constants.AppFabric.OUTPUT_DIR,cConf.get(Constants.AppFabric.OUTPUT_DIR));
  this.sConf=sConf == null ? SConfiguration.create() : sConf;
}
Program: 6022
Project: 6022
Buggy source:
@Override protected void shutDown() throws Exception {
  LOG.info("String_Node_Str");
  for (  DatasetMetricsReporter metricsReporter : metricReporters) {
    metricsReporter.stop();
  }
  if (opExecutorServiceWatch != null) {
    opExecutorServiceWatch.cancel();
  }
  typeManager.stopAndWait();
  if (cancelDiscovery != null) {
    cancelDiscovery.cancel();
  }
  try {
    TimeUnit.SECONDS.sleep(3);
  }
 catch (  InterruptedException e) {
    LOG.error("String_Node_Str",e);
  }
  httpService.stopAndWait();
  opExecutorClient.stopAndWait();
}

Fixed version (ground truth):
@Override protected void shutDown() throws Exception {
  LOG.info("String_Node_Str");
  for (  DatasetMetricsReporter metricsReporter : metricReporters) {
    metricsReporter.stop();
  }
  if (opExecutorServiceWatch != null) {
    opExecutorServiceWatch.cancel();
  }
  typeService.stopAndWait();
  if (cancelDiscovery != null) {
    cancelDiscovery.cancel();
  }
  try {
    TimeUnit.SECONDS.sleep(3);
  }
 catch (  InterruptedException e) {
    LOG.error("String_Node_Str",e);
  }
  httpService.stopAndWait();
  opExecutorClient.stopAndWait();
}
Program: 6023
Project: 6023
Buggy source:
@Override protected void startUp() throws Exception {
  LOG.info("String_Node_Str");
  typeManager.startAndWait();
  opExecutorClient.startAndWait();
  httpService.startAndWait();
  ServiceDiscovered discover=discoveryServiceClient.discover(Constants.Service.DATASET_EXECUTOR);
  opExecutorDiscovered=SettableFuture.create();
  opExecutorServiceWatch=discover.watchChanges(new ServiceDiscovered.ChangeListener(){
    @Override public void onChange(    ServiceDiscovered serviceDiscovered){
      if (!Iterables.isEmpty(serviceDiscovered)) {
        LOG.info("String_Node_Str",Constants.Service.DATASET_EXECUTOR);
        opExecutorDiscovered.set(serviceDiscovered);
      }
    }
  }
,MoreExecutors.sameThreadExecutor());
  for (  DatasetMetricsReporter metricsReporter : metricReporters) {
    metricsReporter.start();
  }
}

Fixed version (ground truth):
@Override protected void startUp() throws Exception {
  LOG.info("String_Node_Str");
  typeService.startAndWait();
  opExecutorClient.startAndWait();
  httpService.startAndWait();
  ServiceDiscovered discover=discoveryServiceClient.discover(Constants.Service.DATASET_EXECUTOR);
  opExecutorDiscovered=SettableFuture.create();
  opExecutorServiceWatch=discover.watchChanges(new ServiceDiscovered.ChangeListener(){
    @Override public void onChange(    ServiceDiscovered serviceDiscovered){
      if (!Iterables.isEmpty(serviceDiscovered)) {
        LOG.info("String_Node_Str",Constants.Service.DATASET_EXECUTOR);
        opExecutorDiscovered.set(serviceDiscovered);
      }
    }
  }
,MoreExecutors.sameThreadExecutor());
  for (  DatasetMetricsReporter metricsReporter : metricReporters) {
    metricsReporter.start();
  }
}
Program: 6024
Project: 6024
Buggy source:
@Override public boolean apply(DatasetTypeMeta datasetTypeMeta){
  DatasetTypeId datasetTypeId=namespaceId.datasetType(datasetTypeMeta.getName());
  return authFilter.apply(datasetTypeId);
}

Fixed version (ground truth):
@Override public void apply() throws Exception {
  Collection<DatasetModuleMeta> allDatasets=datasetTypeMDS.getModules(Id.Namespace.SYSTEM);
  for (  DatasetModuleMeta ds : allDatasets) {
    if (ds.getJarLocation() == null) {
      LOG.debug("String_Node_Str",ds.toString());
      Id.DatasetModule moduleId=Id.DatasetModule.from(Id.Namespace.SYSTEM,ds.getName());
      datasetTypeMDS.deleteModule(moduleId);
      revokeAllPrivilegesOnModule(moduleId.toEntityId(),ds);
    }
  }
}
Program: 6025
Project: 6025
Buggy source:
@Inject @VisibleForTesting public DatasetTypeService(DatasetTypeManager typeManager,NamespaceQueryAdmin namespaceQueryAdmin,NamespacedLocationFactory namespacedLocationFactory,AuthorizationEnforcer authorizationEnforcer,PrivilegesManager privilegesManager,AuthenticationContext authenticationContext,CConfiguration cConf,Impersonator impersonator){
  this.typeManager=typeManager;
  this.namespaceQueryAdmin=namespaceQueryAdmin;
  this.namespacedLocationFactory=namespacedLocationFactory;
  this.authorizationEnforcer=authorizationEnforcer;
  this.privilegesManager=privilegesManager;
  this.authenticationContext=authenticationContext;
  this.cConf=cConf;
  this.impersonator=impersonator;
}

Fixed version (ground truth):
@Inject @VisibleForTesting public DatasetTypeService(DatasetTypeManager typeManager,NamespaceQueryAdmin namespaceQueryAdmin,NamespacedLocationFactory namespacedLocationFactory,AuthorizationEnforcer authorizationEnforcer,PrivilegesManager privilegesManager,AuthenticationContext authenticationContext,CConfiguration cConf,Impersonator impersonator,TransactionSystemClientService txClientService,@Named("String_Node_Str") DatasetFramework datasetFramework,TransactionExecutorFactory txExecutorFactory,@Named("String_Node_Str") Map<String,DatasetModule> defaultModules){
  this.typeManager=typeManager;
  this.namespaceQueryAdmin=namespaceQueryAdmin;
  this.namespacedLocationFactory=namespacedLocationFactory;
  this.authorizationEnforcer=authorizationEnforcer;
  this.privilegesManager=privilegesManager;
  this.authenticationContext=authenticationContext;
  this.cConf=cConf;
  this.impersonator=impersonator;
  this.txClientService=txClientService;
  this.datasetFramework=datasetFramework;
  this.txExecutorFactory=txExecutorFactory;
  Map<String,String> emptyArgs=Collections.emptyMap();
  this.datasetCache=new MultiThreadDatasetCache(new SystemDatasetInstantiator(datasetFramework,null,null),txClientService,NamespaceId.SYSTEM,emptyArgs,null,ImmutableMap.of(DatasetMetaTableUtil.META_TABLE_NAME,emptyArgs,DatasetMetaTableUtil.INSTANCE_TABLE_NAME,emptyArgs));
  this.defaultModules=new LinkedHashMap<>(defaultModules);
  this.extensionModules=getExtensionModules(cConf);
}
Program: 6026
Project: 6026
Buggy source:
private void grantAllPrivilegesOnModule(DatasetModuleId moduleId,Principal principal) throws Exception {
  Set<Action> allActions=ImmutableSet.of(Action.ALL);
  privilegesManager.grant(moduleId,principal,allActions);
  DatasetModuleMeta moduleMeta=typeManager.getModule(moduleId.toId());
  if (moduleMeta == null) {
    LOG.debug("String_Node_Str",moduleId);
    return;
  }
  for (  String type : moduleMeta.getTypes()) {
    DatasetTypeId datasetTypeId=moduleId.getParent().datasetType(type);
    privilegesManager.grant(datasetTypeId,principal,allActions);
  }
}

Fixed version (ground truth):
private void grantAllPrivilegesOnModule(DatasetModuleId moduleId,Principal principal,@Nullable DatasetModuleMeta moduleMeta) throws Exception {
  Set<Action> allActions=ImmutableSet.of(Action.ALL);
  privilegesManager.grant(moduleId,principal,allActions);
  if (moduleMeta == null) {
    moduleMeta=typeManager.getModule(moduleId.toId());
  }
  if (moduleMeta == null) {
    LOG.debug("String_Node_Str",moduleId);
    return;
  }
  for (  String type : moduleMeta.getTypes()) {
    DatasetTypeId datasetTypeId=moduleId.getParent().datasetType(type);
    privilegesManager.grant(datasetTypeId,principal,allActions);
  }
}
Program: 6027
Project: 6027
Buggy source:
/** 
 * Drops the specified dataset instance.
 * @param instance the {@link Id.DatasetInstance} to drop
 * @throws NamespaceNotFoundException if the namespace was not found
 * @throws DatasetNotFoundException if the dataset instance was not found
 * @throws IOException if there was a problem in checking if the namespace exists over HTTP
 * @throws UnauthorizedException if perimeter security and authorization are enabled, and the current user does nothave  {@link Action#ADMIN} privileges on the #instance
 */
void drop(Id.DatasetInstance instance) throws Exception {
  DatasetId datasetId=instance.toEntityId();
  ensureNamespaceExists(instance.getNamespace());
  DatasetSpecification spec=instanceManager.get(instance);
  if (spec == null) {
    throw new DatasetNotFoundException(instance);
  }
  authorizationEnforcer.enforce(datasetId,authenticationContext.getPrincipal(),Action.ADMIN);
  LOG.info("String_Node_Str",instance.getNamespaceId(),instance.getId());
  dropDataset(instance,spec);
  publishAudit(instance,AuditType.DELETE);
  authorizer.revoke(datasetId);
}

Fixed version (ground truth):
/** 
 * Drops the specified dataset instance.
 * @param instance the {@link Id.DatasetInstance} to drop
 * @throws NamespaceNotFoundException if the namespace was not found
 * @throws DatasetNotFoundException if the dataset instance was not found
 * @throws IOException if there was a problem in checking if the namespace exists over HTTP
 * @throws UnauthorizedException if perimeter security and authorization are enabled, and the current user does nothave  {@link Action#ADMIN} privileges on the #instance
 */
void drop(Id.DatasetInstance instance) throws Exception {
  DatasetId datasetId=instance.toEntityId();
  ensureNamespaceExists(instance.getNamespace());
  DatasetSpecification spec=instanceManager.get(instance);
  if (spec == null) {
    throw new DatasetNotFoundException(instance);
  }
  authorizationEnforcer.enforce(datasetId,authenticationContext.getPrincipal(),Action.ADMIN);
  LOG.info("String_Node_Str",instance.getNamespaceId(),instance.getId());
  dropDataset(instance,spec);
  publishAudit(instance,AuditType.DELETE);
  privilegesManager.revoke(datasetId);
}
Program: 6028
Project: 6028
Buggy source:
@Inject public DatasetInstanceService(DatasetTypeManager typeManager,DatasetInstanceManager instanceManager,DatasetOpExecutor opExecutorClient,ExploreFacade exploreFacade,NamespaceQueryAdmin namespaceQueryAdmin,AuthorizationEnforcer authorizationEnforcer,AuthorizerInstantiator authorizerInstantiator,AuthenticationContext authenticationContext){
  this.opExecutorClient=opExecutorClient;
  this.typeManager=typeManager;
  this.instanceManager=instanceManager;
  this.exploreFacade=exploreFacade;
  this.namespaceQueryAdmin=namespaceQueryAdmin;
  this.metaCache=CacheBuilder.newBuilder().build(new CacheLoader<Id.DatasetInstance,DatasetMeta>(){
    @Override public DatasetMeta load(    Id.DatasetInstance datasetId) throws Exception {
      return getFromMds(datasetId);
    }
  }
);
  this.authorizationEnforcer=authorizationEnforcer;
  this.authorizer=authorizerInstantiator.get();
  this.authenticationContext=authenticationContext;
}

Fixed version (ground truth):
@Inject public DatasetInstanceService(DatasetTypeManager typeManager,DatasetInstanceManager instanceManager,DatasetOpExecutor opExecutorClient,ExploreFacade exploreFacade,NamespaceQueryAdmin namespaceQueryAdmin,AuthorizationEnforcer authorizationEnforcer,PrivilegesManager privilegesManager,AuthenticationContext authenticationContext){
  this.opExecutorClient=opExecutorClient;
  this.typeManager=typeManager;
  this.instanceManager=instanceManager;
  this.exploreFacade=exploreFacade;
  this.namespaceQueryAdmin=namespaceQueryAdmin;
  this.metaCache=CacheBuilder.newBuilder().build(new CacheLoader<Id.DatasetInstance,DatasetMeta>(){
    @Override public DatasetMeta load(    Id.DatasetInstance datasetId) throws Exception {
      return getFromMds(datasetId);
    }
  }
);
  this.authorizationEnforcer=authorizationEnforcer;
  this.privilegesManager=privilegesManager;
  this.authenticationContext=authenticationContext;
}
Program: 6030
Project: 6030
Buggy source:
/** 
 * Finds the   {@link DatasetTypeMeta} for the specified dataset type name.Search order - first in the specified namespace, then in the 'system' namespace from defaultModules
 * @param namespaceId {@link Id.Namespace} for the specified namespace
 * @param typeName the name of the dataset type to search
 * @return {@link DatasetTypeMeta} for the type if found in either the specified namespace or in the system namespace,null otherwise. TODO: This may need to move to a util class eventually
 */
@Nullable private DatasetTypeMeta getTypeInfo(Id.Namespace namespaceId,String typeName) throws Exception {
  Id.DatasetType datasetTypeId=ConversionHelpers.toDatasetTypeId(namespaceId,typeName);
  DatasetTypeMeta typeMeta=typeManager.getTypeInfo(datasetTypeId);
  if (typeMeta == null) {
    Id.DatasetType systemDatasetTypeId=ConversionHelpers.toDatasetTypeId(Id.Namespace.SYSTEM,typeName);
    typeMeta=typeManager.getTypeInfo(systemDatasetTypeId);
  }
 else {
    DatasetTypeId typeId=datasetTypeId.toEntityId();
    Principal principal=authenticationContext.getPrincipal();
    Predicate<EntityId> filter=authorizer.createFilter(principal);
    if (!Principal.SYSTEM.equals(principal) && !filter.apply(typeId)) {
      throw new UnauthorizedException(principal,typeId);
    }
  }
  return typeMeta;
}

Fixed version (ground truth):
/** 
 * Finds the   {@link DatasetTypeMeta} for the specified dataset type name.Search order - first in the specified namespace, then in the 'system' namespace from defaultModules
 * @param namespaceId {@link Id.Namespace} for the specified namespace
 * @param typeName the name of the dataset type to search
 * @return {@link DatasetTypeMeta} for the type if found in either the specified namespace or in the system namespace,null otherwise. TODO: This may need to move to a util class eventually
 */
@Nullable private DatasetTypeMeta getTypeInfo(Id.Namespace namespaceId,String typeName) throws Exception {
  Id.DatasetType datasetTypeId=ConversionHelpers.toDatasetTypeId(namespaceId,typeName);
  DatasetTypeMeta typeMeta=typeManager.getTypeInfo(datasetTypeId);
  if (typeMeta == null) {
    Id.DatasetType systemDatasetTypeId=ConversionHelpers.toDatasetTypeId(Id.Namespace.SYSTEM,typeName);
    typeMeta=typeManager.getTypeInfo(systemDatasetTypeId);
  }
 else {
    DatasetTypeId typeId=datasetTypeId.toEntityId();
    Principal principal=authenticationContext.getPrincipal();
    Predicate<EntityId> filter=authorizationEnforcer.createFilter(principal);
    if (!Principal.SYSTEM.equals(principal) && !filter.apply(typeId)) {
      throw new UnauthorizedException(principal,typeId);
    }
  }
  return typeMeta;
}
Program: 6031
Project: 6031
Buggy source:
/** 
 * Deletes all   {@link DatasetModuleMeta dataset modules} in the specified {@link NamespaceId namespace}.
 */
void deleteAll(NamespaceId namespaceId) throws Exception {
  Principal principal=authenticationContext.getPrincipal();
  authorizationEnforcer.enforce(namespaceId,principal,Action.ADMIN);
  if (NamespaceId.SYSTEM.equals(namespaceId)) {
    throw new UnauthorizedException(String.format("String_Node_Str",namespaceId));
  }
  ensureNamespaceExists(namespaceId);
  Id.Namespace namespace=namespaceId.toId();
  for (  DatasetModuleMeta meta : typeManager.getModules(namespace)) {
    authorizer.revoke(namespaceId.datasetModule(meta.getName()));
  }
  try {
    typeManager.deleteModules(namespace);
  }
 catch (  DatasetModuleConflictException e) {
    throw new ConflictException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * Deletes all   {@link DatasetModuleMeta dataset modules} in the specified {@link NamespaceId namespace}.
 */
void deleteAll(NamespaceId namespaceId) throws Exception {
  Principal principal=authenticationContext.getPrincipal();
  authorizationEnforcer.enforce(namespaceId,principal,Action.ADMIN);
  if (NamespaceId.SYSTEM.equals(namespaceId)) {
    throw new UnauthorizedException(String.format("String_Node_Str",namespaceId));
  }
  ensureNamespaceExists(namespaceId);
  Id.Namespace namespace=namespaceId.toId();
  for (  DatasetModuleMeta meta : typeManager.getModules(namespace)) {
    privilegesManager.revoke(namespaceId.datasetModule(meta.getName()));
  }
  try {
    typeManager.deleteModules(namespace);
  }
 catch (  DatasetModuleConflictException e) {
    throw new ConflictException(e.getMessage(),e);
  }
}
Program: 6032
Project: 6032
Buggy source:
private void revokeAllPrivilegesOnModule(DatasetModuleId moduleId,@Nullable DatasetModuleMeta moduleMeta) throws Exception {
  authorizer.revoke(moduleId);
  moduleMeta=moduleMeta == null ? typeManager.getModule(moduleId.toId()) : moduleMeta;
  if (moduleMeta == null) {
    LOG.debug("String_Node_Str",moduleId);
    return;
  }
  for (  String type : moduleMeta.getTypes()) {
    DatasetTypeId datasetTypeId=moduleId.getParent().datasetType(type);
    authorizer.revoke(datasetTypeId);
  }
}

Fixed version (ground truth):
private void revokeAllPrivilegesOnModule(DatasetModuleId moduleId,@Nullable DatasetModuleMeta moduleMeta) throws Exception {
  privilegesManager.revoke(moduleId);
  moduleMeta=moduleMeta == null ? typeManager.getModule(moduleId.toId()) : moduleMeta;
  if (moduleMeta == null) {
    LOG.debug("String_Node_Str",moduleId);
    return;
  }
  for (  String type : moduleMeta.getTypes()) {
    DatasetTypeId datasetTypeId=moduleId.getParent().datasetType(type);
    privilegesManager.revoke(datasetTypeId);
  }
}
Program: 6033
Project: 6033
Buggy source:
@Inject @VisibleForTesting public DatasetTypeService(DatasetTypeManager typeManager,NamespaceQueryAdmin namespaceQueryAdmin,NamespacedLocationFactory namespacedLocationFactory,AuthorizationEnforcer authorizationEnforcer,AuthorizerInstantiator authorizerInstantiator,AuthenticationContext authenticationContext,CConfiguration cConf,Impersonator impersonator){
  this.typeManager=typeManager;
  this.namespaceQueryAdmin=namespaceQueryAdmin;
  this.namespacedLocationFactory=namespacedLocationFactory;
  this.authorizationEnforcer=authorizationEnforcer;
  this.authorizer=authorizerInstantiator.get();
  this.authenticationContext=authenticationContext;
  this.cConf=cConf;
  this.impersonator=impersonator;
}

Fixed version (ground truth):
@Inject @VisibleForTesting public DatasetTypeService(DatasetTypeManager typeManager,NamespaceQueryAdmin namespaceQueryAdmin,NamespacedLocationFactory namespacedLocationFactory,AuthorizationEnforcer authorizationEnforcer,PrivilegesManager privilegesManager,AuthenticationContext authenticationContext,CConfiguration cConf,Impersonator impersonator){
  this.typeManager=typeManager;
  this.namespaceQueryAdmin=namespaceQueryAdmin;
  this.namespacedLocationFactory=namespacedLocationFactory;
  this.authorizationEnforcer=authorizationEnforcer;
  this.privilegesManager=privilegesManager;
  this.authenticationContext=authenticationContext;
  this.cConf=cConf;
  this.impersonator=impersonator;
}
Program: 6034
Project: 6034
Buggy source:
private void grantAllPrivilegesOnModule(DatasetModuleId moduleId,Principal principal) throws Exception {
  Set<Action> allActions=ImmutableSet.of(Action.ALL);
  authorizer.grant(moduleId,principal,allActions);
  DatasetModuleMeta moduleMeta=typeManager.getModule(moduleId.toId());
  if (moduleMeta == null) {
    LOG.debug("String_Node_Str",moduleId);
    return;
  }
  for (  String type : moduleMeta.getTypes()) {
    DatasetTypeId datasetTypeId=moduleId.getParent().datasetType(type);
    authorizer.grant(datasetTypeId,principal,allActions);
  }
}

Fixed version (ground truth):
private void grantAllPrivilegesOnModule(DatasetModuleId moduleId,Principal principal) throws Exception {
  Set<Action> allActions=ImmutableSet.of(Action.ALL);
  privilegesManager.grant(moduleId,principal,allActions);
  DatasetModuleMeta moduleMeta=typeManager.getModule(moduleId.toId());
  if (moduleMeta == null) {
    LOG.debug("String_Node_Str",moduleId);
    return;
  }
  for (  String type : moduleMeta.getTypes()) {
    DatasetTypeId datasetTypeId=moduleId.getParent().datasetType(type);
    privilegesManager.grant(datasetTypeId,principal,allActions);
  }
}
Program: 6037
Project: 6037
Buggy source:
@VisibleForTesting static Injector createInjector(CConfiguration cConf,Configuration hConf){
  return Guice.createInjector(new ConfigModule(cConf,hConf),new IOModule(),new ZKClientModule(),new KafkaClientModule(),new MetricsClientRuntimeModule().getDistributedModules(),new DiscoveryRuntimeModule().getDistributedModules(),new LocationRuntimeModule().getDistributedModules(),new NamespaceClientRuntimeModule().getDistributedModules(),new DataFabricModules().getDistributedModules(),new DataSetsModules().getDistributedModules(),new DataSetServiceModules().getDistributedModules(),new LoggingModules().getDistributedModules(),new ExploreClientModule(),new NamespaceClientRuntimeModule().getDistributedModules(),new NamespaceStoreModule().getDistributedModules(),new MetadataServiceModule(),new RemoteSystemOperationsServiceModule(),new ViewAdminModules().getDistributedModules(),new StreamAdminModules().getDistributedModules(),new NotificationFeedClientModule(),new AuditModule().getDistributedModules(),new EntityVerifierModule(),new SecureStoreModules().getDistributedModules(),new AuthorizationModule(),new AuthorizationEnforcementModule().getDistributedModules(),new AuthenticationContextModules().getProgramContainerModule(),new AbstractModule(){
    @Override protected void configure(){
      bind(Store.class).to(DefaultStore.class);
      bind(UGIProvider.class).to(RemoteUGIProvider.class).in(Scopes.SINGLETON);
    }
  }
);
}

Fixed version (ground truth):
@VisibleForTesting static Injector createInjector(CConfiguration cConf,Configuration hConf){
  return Guice.createInjector(new ConfigModule(cConf,hConf),new IOModule(),new ZKClientModule(),new KafkaClientModule(),new MetricsClientRuntimeModule().getDistributedModules(),new DiscoveryRuntimeModule().getDistributedModules(),new LocationRuntimeModule().getDistributedModules(),new NamespaceClientRuntimeModule().getDistributedModules(),new DataFabricModules().getDistributedModules(),new DataSetsModules().getDistributedModules(),new DataSetServiceModules().getDistributedModules(),new LoggingModules().getDistributedModules(),new ExploreClientModule(),new NamespaceClientRuntimeModule().getDistributedModules(),new NamespaceStoreModule().getDistributedModules(),new MetadataServiceModule(),new RemoteSystemOperationsServiceModule(),new ViewAdminModules().getDistributedModules(),new StreamAdminModules().getDistributedModules(),new NotificationFeedClientModule(),new AuditModule().getDistributedModules(),new EntityVerifierModule(),new SecureStoreModules().getDistributedModules(),new AuthorizationEnforcementModule().getDistributedModules(),new AuthenticationContextModules().getProgramContainerModule(),new AbstractModule(){
    @Override protected void configure(){
      bind(Store.class).to(DefaultStore.class);
      bind(UGIProvider.class).to(RemoteUGIProvider.class).in(Scopes.SINGLETON);
      bind(PrivilegesManager.class).to(RemotePrivilegesManager.class);
    }
  }
);
}
Program: 6038
Project: 6038
Buggy source:
@Override protected void configure(){
  bind(Store.class).to(DefaultStore.class);
  bind(UGIProvider.class).to(RemoteUGIProvider.class).in(Scopes.SINGLETON);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(Store.class).to(DefaultStore.class);
  bind(UGIProvider.class).to(RemoteUGIProvider.class).in(Scopes.SINGLETON);
  bind(PrivilegesManager.class).to(RemotePrivilegesManager.class);
}