nus-yam/ex-repair huggingface dataset:
Program: 5931
Project: 5931
Buggy source:
@Path("String_Node_Str") @POST public void grant(HttpRequest httpRequest,HttpResponder httpResponder) throws Exception {
  ensureSecurityEnabled();
  GrantRequest request=parseBody(httpRequest,GrantRequest.class);
  verifyAuthRequest(request);
  Set<Action> actions=request.getActions() == null ? EnumSet.allOf(Action.class) : request.getActions();
  authorizationEnforcer.enforce(request.getEntity(),authenticationContext.getPrincipal(),Action.ADMIN);
  authorizer.grant(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 grant(HttpRequest httpRequest,HttpResponder httpResponder) throws Exception {
  ensureSecurityEnabled();
  GrantRequest request=parseBody(httpRequest,GrantRequest.class);
  verifyAuthRequest(request);
  Set<Action> actions=request.getActions() == null ? EnumSet.allOf(Action.class) : request.getActions();
  authorizationEnforcer.enforce(request.getEntity(),authenticationContext.getPrincipal(),Action.ADMIN);
  privilegesManager.grant(request.getEntity(),request.getPrincipal(),actions);
  httpResponder.sendStatus(HttpResponseStatus.OK);
  createLogEntry(httpRequest,request,HttpResponseStatus.OK);
}
Program: 5932
Project: 5932
Buggy source:
@Inject LocalApplicationManager(CConfiguration configuration,PipelineFactory pipelineFactory,NamespacedLocationFactory namespacedLocationFactory,Store store,StreamConsumerFactory streamConsumerFactory,QueueAdmin queueAdmin,DatasetFramework datasetFramework,@Named("String_Node_Str") DatasetFramework inMemoryDatasetFramework,StreamAdmin streamAdmin,Scheduler scheduler,@Assisted ProgramTerminator programTerminator,MetricStore metricStore,UsageRegistry usageRegistry,ArtifactRepository artifactRepository,MetadataStore metadataStore,AuthorizerInstantiator authorizerInstantiator,Impersonator impersonator){
  this.configuration=configuration;
  this.namespacedLocationFactory=namespacedLocationFactory;
  this.pipelineFactory=pipelineFactory;
  this.store=store;
  this.streamConsumerFactory=streamConsumerFactory;
  this.queueAdmin=queueAdmin;
  this.programTerminator=programTerminator;
  this.datasetFramework=datasetFramework;
  this.inMemoryDatasetFramework=inMemoryDatasetFramework;
  this.streamAdmin=streamAdmin;
  this.scheduler=scheduler;
  this.metricStore=metricStore;
  this.usageRegistry=usageRegistry;
  this.artifactRepository=artifactRepository;
  this.metadataStore=metadataStore;
  this.authorizer=authorizerInstantiator.get();
  this.impersonator=impersonator;
}

Fixed version (ground truth):
@Inject LocalApplicationManager(CConfiguration configuration,PipelineFactory pipelineFactory,Store store,StreamConsumerFactory streamConsumerFactory,QueueAdmin queueAdmin,DatasetFramework datasetFramework,@Named("String_Node_Str") DatasetFramework inMemoryDatasetFramework,StreamAdmin streamAdmin,Scheduler scheduler,@Assisted ProgramTerminator programTerminator,MetricStore metricStore,UsageRegistry usageRegistry,ArtifactRepository artifactRepository,MetadataStore metadataStore,PrivilegesManager privilegesManager,Impersonator impersonator,AuthenticationContext authenticationContext){
  this.configuration=configuration;
  this.pipelineFactory=pipelineFactory;
  this.store=store;
  this.streamConsumerFactory=streamConsumerFactory;
  this.queueAdmin=queueAdmin;
  this.programTerminator=programTerminator;
  this.datasetFramework=datasetFramework;
  this.inMemoryDatasetFramework=inMemoryDatasetFramework;
  this.streamAdmin=streamAdmin;
  this.scheduler=scheduler;
  this.metricStore=metricStore;
  this.usageRegistry=usageRegistry;
  this.artifactRepository=artifactRepository;
  this.metadataStore=metadataStore;
  this.privilegesManager=privilegesManager;
  this.impersonator=impersonator;
  this.authenticationContext=authenticationContext;
}
Program: 5933
Project: 5933
Buggy source:
@Override public ListenableFuture<O> deploy(I input) throws Exception {
  Pipeline<O> pipeline=pipelineFactory.getPipeline();
  pipeline.addLast(new LocalArtifactLoaderStage(configuration,store,artifactRepository,impersonator));
  pipeline.addLast(new ApplicationVerificationStage(store,datasetFramework));
  pipeline.addLast(new DeployDatasetModulesStage(configuration,datasetFramework,inMemoryDatasetFramework));
  pipeline.addLast(new CreateDatasetInstancesStage(configuration,datasetFramework));
  pipeline.addLast(new CreateStreamsStage(streamAdmin));
  pipeline.addLast(new DeletedProgramHandlerStage(store,programTerminator,streamConsumerFactory,queueAdmin,metricStore,metadataStore,authorizer,impersonator));
  pipeline.addLast(new ProgramGenerationStage(configuration,namespacedLocationFactory,authorizer));
  pipeline.addLast(new ApplicationRegistrationStage(store,usageRegistry));
  pipeline.addLast(new CreateSchedulesStage(scheduler));
  pipeline.addLast(new SystemMetadataWriterStage(metadataStore));
  pipeline.setFinally(new DeploymentCleanupStage());
  return pipeline.execute(input);
}

Fixed version (ground truth):
@Override public ListenableFuture<O> deploy(I input) throws Exception {
  Pipeline<O> pipeline=pipelineFactory.getPipeline();
  pipeline.addLast(new LocalArtifactLoaderStage(configuration,store,artifactRepository,impersonator));
  pipeline.addLast(new ApplicationVerificationStage(store,datasetFramework));
  pipeline.addLast(new DeployDatasetModulesStage(configuration,datasetFramework,inMemoryDatasetFramework));
  pipeline.addLast(new CreateDatasetInstancesStage(configuration,datasetFramework));
  pipeline.addLast(new CreateStreamsStage(streamAdmin));
  pipeline.addLast(new DeletedProgramHandlerStage(store,programTerminator,streamConsumerFactory,queueAdmin,metricStore,metadataStore,privilegesManager,impersonator));
  pipeline.addLast(new ProgramGenerationStage(privilegesManager,authenticationContext));
  pipeline.addLast(new ApplicationRegistrationStage(store,usageRegistry));
  pipeline.addLast(new CreateSchedulesStage(scheduler));
  pipeline.addLast(new SystemMetadataWriterStage(metadataStore));
  pipeline.setFinally(new DeploymentCleanupStage());
  return pipeline.execute(input);
}
Program: 5934
Project: 5934
Buggy source:
public DeletedProgramHandlerStage(Store store,ProgramTerminator programTerminator,StreamConsumerFactory streamConsumerFactory,QueueAdmin queueAdmin,MetricStore metricStore,MetadataStore metadataStore,Authorizer authorizer,Impersonator impersonator){
  super(TypeToken.of(ApplicationDeployable.class));
  this.store=store;
  this.programTerminator=programTerminator;
  this.streamConsumerFactory=streamConsumerFactory;
  this.queueAdmin=queueAdmin;
  this.metricStore=metricStore;
  this.metadataStore=metadataStore;
  this.authorizer=authorizer;
  this.impersonator=impersonator;
}

Fixed version (ground truth):
public DeletedProgramHandlerStage(Store store,ProgramTerminator programTerminator,StreamConsumerFactory streamConsumerFactory,QueueAdmin queueAdmin,MetricStore metricStore,MetadataStore metadataStore,PrivilegesManager privilegesManager,Impersonator impersonator){
  super(TypeToken.of(ApplicationDeployable.class));
  this.store=store;
  this.programTerminator=programTerminator;
  this.streamConsumerFactory=streamConsumerFactory;
  this.queueAdmin=queueAdmin;
  this.metricStore=metricStore;
  this.metadataStore=metadataStore;
  this.privilegesManager=privilegesManager;
  this.impersonator=impersonator;
}
Program: 5936
Project: 5936
Buggy source:
@Override public void process(final ApplicationDeployable input) throws Exception {
  List<ProgramDescriptor> programDescriptors=new ArrayList<>();
  final ApplicationSpecification appSpec=input.getSpecification();
  Iterable<ProgramSpecification> specifications=Iterables.concat(appSpec.getMapReduce().values(),appSpec.getFlows().values(),appSpec.getWorkflows().values(),appSpec.getServices().values(),appSpec.getSpark().values(),appSpec.getWorkers().values());
  for (  final ProgramSpecification spec : specifications) {
    ProgramType type=ProgramTypes.fromSpecification(spec);
    ProgramId programId=input.getApplicationId().program(type,spec.getName());
    authorizer.grant(programId,SecurityRequestContext.toPrincipal(),ImmutableSet.of(Action.ALL));
    programDescriptors.add(new ProgramDescriptor(programId,appSpec));
  }
  emit(new ApplicationWithPrograms(input,programDescriptors));
}

Fixed version (ground truth):
@Override public void process(final ApplicationDeployable input) throws Exception {
  List<ProgramDescriptor> programDescriptors=new ArrayList<>();
  final ApplicationSpecification appSpec=input.getSpecification();
  Iterable<ProgramSpecification> specifications=Iterables.concat(appSpec.getMapReduce().values(),appSpec.getFlows().values(),appSpec.getWorkflows().values(),appSpec.getServices().values(),appSpec.getSpark().values(),appSpec.getWorkers().values());
  for (  final ProgramSpecification spec : specifications) {
    ProgramType type=ProgramTypes.fromSpecification(spec);
    ProgramId programId=input.getApplicationId().program(type,spec.getName());
    privilegesManager.grant(programId,authenticationContext.getPrincipal(),ImmutableSet.of(Action.ALL));
    programDescriptors.add(new ProgramDescriptor(programId,appSpec));
  }
  emit(new ApplicationWithPrograms(input,programDescriptors));
}
Program: 5937
Project: 5937
Buggy source:
public ProgramGenerationStage(CConfiguration configuration,NamespacedLocationFactory namespacedLocationFactory,Authorizer authorizer){
  super(TypeToken.of(ApplicationDeployable.class));
  this.configuration=configuration;
  this.namespacedLocationFactory=namespacedLocationFactory;
  this.authorizer=authorizer;
}

Fixed version (ground truth):
public ProgramGenerationStage(PrivilegesManager privilegesManager,AuthenticationContext authenticationContext){
  super(TypeToken.of(ApplicationDeployable.class));
  this.privilegesManager=privilegesManager;
  this.authenticationContext=authenticationContext;
}
Program: 5938
Project: 5938
Buggy source:
private void validateCustomMapping(NamespaceMeta metadata) throws Exception {
  for (  NamespaceMeta existingNamespaceMeta : list()) {
    NamespaceConfig existingConfig=existingNamespaceMeta.getConfig();
    if (!Strings.isNullOrEmpty(metadata.getConfig().getHbaseNamespace()) && metadata.getConfig().getHbaseNamespace().equals(existingConfig.getHbaseNamespace())) {
      throw new NamespaceAlreadyExistsException(existingNamespaceMeta.getNamespaceId().toId(),String.format("String_Node_Str" + "String_Node_Str",existingNamespaceMeta.getName(),existingConfig.getHbaseNamespace()));
    }
    if (!Strings.isNullOrEmpty(metadata.getConfig().getHiveDatabase()) && metadata.getConfig().getHiveDatabase().equals(existingConfig.getHiveDatabase())) {
      throw new NamespaceAlreadyExistsException(existingNamespaceMeta.getNamespaceId().toId(),String.format("String_Node_Str" + "String_Node_Str",existingNamespaceMeta.getName(),existingConfig.getHiveDatabase()));
    }
    if (!Strings.isNullOrEmpty(metadata.getConfig().getRootDirectory())) {
      validatePath(metadata);
      if (hasSubDirRelationship(existingConfig.getRootDirectory(),metadata.getConfig().getRootDirectory())) {
        throw new NamespaceAlreadyExistsException(existingNamespaceMeta.getNamespaceId().toId(),String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",metadata.getName(),metadata.getConfig().getRootDirectory(),existingNamespaceMeta.getName(),existingConfig.getRootDirectory()));
      }
    }
  }
}

Fixed version (ground truth):
private void validateCustomMapping(NamespaceMeta metadata) throws Exception {
  for (  NamespaceMeta existingNamespaceMeta : list()) {
    NamespaceConfig existingConfig=existingNamespaceMeta.getConfig();
    if (!Strings.isNullOrEmpty(metadata.getConfig().getHbaseNamespace()) && metadata.getConfig().getHbaseNamespace().equals(existingConfig.getHbaseNamespace())) {
      throw new NamespaceAlreadyExistsException(existingNamespaceMeta.getNamespaceId().toId(),String.format("String_Node_Str" + "String_Node_Str",existingNamespaceMeta.getName(),existingConfig.getHbaseNamespace()));
    }
    if (!Strings.isNullOrEmpty(metadata.getConfig().getHiveDatabase()) && metadata.getConfig().getHiveDatabase().equals(existingConfig.getHiveDatabase())) {
      throw new NamespaceAlreadyExistsException(existingNamespaceMeta.getNamespaceId().toId(),String.format("String_Node_Str" + "String_Node_Str",existingNamespaceMeta.getName(),existingConfig.getHiveDatabase()));
    }
    if (!Strings.isNullOrEmpty(metadata.getConfig().getRootDirectory())) {
      validatePath(metadata.getName(),metadata.getConfig().getRootDirectory());
      if (hasSubDirRelationship(existingConfig.getRootDirectory(),metadata.getConfig().getRootDirectory())) {
        throw new NamespaceAlreadyExistsException(existingNamespaceMeta.getNamespaceId().toId(),String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",metadata.getName(),metadata.getConfig().getRootDirectory(),existingNamespaceMeta.getName(),existingConfig.getRootDirectory()));
      }
    }
  }
}
Program: 5939
Project: 5939
Buggy source:
private void validatePath(NamespaceMeta namespaceMeta) throws IOException {
  File customLocation=new File(namespaceMeta.getConfig().getRootDirectory());
  if (!customLocation.isAbsolute()) {
    throw new IOException(String.format("String_Node_Str",namespaceMeta.getName(),customLocation));
  }
}

Fixed version (ground truth):
private void validatePath(String namespace,String rootDir) throws IOException {
  File customLocation=new File(rootDir);
  if (!customLocation.isAbsolute()) {
    throw new IOException(String.format("String_Node_Str",namespace,customLocation));
  }
}
Program: 5940
Project: 5940
Buggy source:
@Inject DefaultNamespaceAdmin(Store store,NamespaceStore nsStore,PreferencesStore preferencesStore,DashboardStore dashboardStore,DatasetFramework dsFramework,ProgramRuntimeService runtimeService,QueueAdmin queueAdmin,StreamAdmin streamAdmin,MetricStore metricStore,Scheduler scheduler,ApplicationLifecycleService applicationLifecycleService,ArtifactRepository artifactRepository,AuthorizerInstantiator authorizerInstantiator,CConfiguration cConf,StorageProviderNamespaceAdmin storageProviderNamespaceAdmin,Impersonator impersonator,AuthorizationEnforcer authorizationEnforcer,AuthenticationContext authenticationContext){
  super(nsStore,authorizationEnforcer,authenticationContext);
  this.queueAdmin=queueAdmin;
  this.streamAdmin=streamAdmin;
  this.store=store;
  this.preferencesStore=preferencesStore;
  this.dashboardStore=dashboardStore;
  this.dsFramework=dsFramework;
  this.runtimeService=runtimeService;
  this.scheduler=scheduler;
  this.metricStore=metricStore;
  this.applicationLifecycleService=applicationLifecycleService;
  this.artifactRepository=artifactRepository;
  this.authorizer=authorizerInstantiator.get();
  this.authorizationEnforcer=authorizationEnforcer;
  this.instanceId=createInstanceId(cConf);
  this.storageProviderNamespaceAdmin=storageProviderNamespaceAdmin;
  this.impersonator=impersonator;
  this.cConf=cConf;
}

Fixed version (ground truth):
@Inject DefaultNamespaceAdmin(Store store,NamespaceStore nsStore,PreferencesStore preferencesStore,DashboardStore dashboardStore,DatasetFramework dsFramework,ProgramRuntimeService runtimeService,QueueAdmin queueAdmin,StreamAdmin streamAdmin,MetricStore metricStore,Scheduler scheduler,ApplicationLifecycleService applicationLifecycleService,ArtifactRepository artifactRepository,PrivilegesManager privilegesManager,CConfiguration cConf,StorageProviderNamespaceAdmin storageProviderNamespaceAdmin,Impersonator impersonator,AuthorizationEnforcer authorizationEnforcer,AuthenticationContext authenticationContext){
  super(nsStore,authorizationEnforcer,authenticationContext);
  this.queueAdmin=queueAdmin;
  this.streamAdmin=streamAdmin;
  this.store=store;
  this.preferencesStore=preferencesStore;
  this.dashboardStore=dashboardStore;
  this.dsFramework=dsFramework;
  this.runtimeService=runtimeService;
  this.scheduler=scheduler;
  this.metricStore=metricStore;
  this.applicationLifecycleService=applicationLifecycleService;
  this.artifactRepository=artifactRepository;
  this.privilegesManager=privilegesManager;
  this.authorizationEnforcer=authorizationEnforcer;
  this.instanceId=createInstanceId(cConf);
  this.storageProviderNamespaceAdmin=storageProviderNamespaceAdmin;
  this.impersonator=impersonator;
  this.cConf=cConf;
}
Program: 5943
Project: 5943
Buggy source:
@Override public void process(final ApplicationDeployable input) throws Exception {
  List<ProgramDescriptor> programDescriptors=new ArrayList<>();
  final ApplicationSpecification appSpec=input.getSpecification();
  Iterable<ProgramSpecification> specifications=Iterables.concat(appSpec.getMapReduce().values(),appSpec.getFlows().values(),appSpec.getWorkflows().values(),appSpec.getServices().values(),appSpec.getSpark().values(),appSpec.getWorkers().values());
  for (  final ProgramSpecification spec : specifications) {
    ProgramType type=ProgramTypes.fromSpecification(spec);
    ProgramId programId=input.getApplicationId().program(type,spec.getName());
    privilegesManager.grant(programId,authenticationContext.getPrincipal(),ImmutableSet.of(Action.ALL));
    programDescriptors.add(new ProgramDescriptor(programId,appSpec));
  }
  emit(new ApplicationWithPrograms(input,programDescriptors));
}

Fixed version (ground truth):
@Override public void process(final ApplicationDeployable input) throws Exception {
  List<ProgramDescriptor> programDescriptors=new ArrayList<>();
  final ApplicationSpecification appSpec=input.getSpecification();
  Iterable<ProgramSpecification> specifications=Iterables.concat(appSpec.getMapReduce().values(),appSpec.getFlows().values(),appSpec.getWorkflows().values(),appSpec.getServices().values(),appSpec.getSpark().values(),appSpec.getWorkers().values());
  for (  ProgramSpecification spec : specifications) {
    ProgramType type=ProgramTypes.fromSpecification(spec);
    ProgramId programId=input.getApplicationId().program(type,spec.getName());
    privilegesManager.grant(programId,authenticationContext.getPrincipal(),EnumSet.allOf(Action.class));
    programDescriptors.add(new ProgramDescriptor(programId,appSpec));
  }
  emit(new ApplicationWithPrograms(input,programDescriptors));
}
Program: 5947
Project: 5947
Buggy source:
private ApplicationWithPrograms deployApp(NamespaceId namespaceId,@Nullable String appName,@Nullable String configStr,ProgramTerminator programTerminator,ArtifactDetail artifactDetail) throws Exception {
  authorizationEnforcer.enforce(namespaceId,authenticationContext.getPrincipal(),Action.WRITE);
  ApplicationClass appClass=Iterables.getFirst(artifactDetail.getMeta().getClasses().getApps(),null);
  if (appClass == null) {
    throw new InvalidArtifactException(String.format("String_Node_Str",artifactDetail.getDescriptor().getArtifactId(),namespaceId));
  }
  AppDeploymentInfo deploymentInfo=new AppDeploymentInfo(artifactDetail.getDescriptor(),namespaceId,appClass.getClassName(),appName,configStr);
  Manager<AppDeploymentInfo,ApplicationWithPrograms> manager=managerFactory.create(programTerminator);
  ApplicationWithPrograms applicationWithPrograms=manager.deploy(deploymentInfo).get();
  privilegesManager.grant(applicationWithPrograms.getApplicationId(),authenticationContext.getPrincipal(),ImmutableSet.of(Action.ALL));
  return applicationWithPrograms;
}

Fixed version (ground truth):
private ApplicationWithPrograms deployApp(NamespaceId namespaceId,@Nullable String appName,@Nullable String configStr,ProgramTerminator programTerminator,ArtifactDetail artifactDetail) throws Exception {
  authorizationEnforcer.enforce(namespaceId,authenticationContext.getPrincipal(),Action.WRITE);
  ApplicationClass appClass=Iterables.getFirst(artifactDetail.getMeta().getClasses().getApps(),null);
  if (appClass == null) {
    throw new InvalidArtifactException(String.format("String_Node_Str",artifactDetail.getDescriptor().getArtifactId(),namespaceId));
  }
  AppDeploymentInfo deploymentInfo=new AppDeploymentInfo(artifactDetail.getDescriptor(),namespaceId,appClass.getClassName(),appName,configStr);
  Manager<AppDeploymentInfo,ApplicationWithPrograms> manager=managerFactory.create(programTerminator);
  ApplicationWithPrograms applicationWithPrograms=manager.deploy(deploymentInfo).get();
  privilegesManager.grant(applicationWithPrograms.getApplicationId(),authenticationContext.getPrincipal(),EnumSet.allOf(Action.class));
  return applicationWithPrograms;
}
Program: 5948
Project: 5948
Buggy source:
/** 
 * Puts the user provided data in the secure store, if the user has write access to the namespace. Grants the user all access to the newly created entity.
 * @param secureKeyId The Id for the key that needs to be stored.
 * @param secureKeyCreateRequest The request containing the data to be stored in the secure store.
 * @throws BadRequestException If the request does not contain the value to be stored.
 * @throws UnauthorizedException If the user does not have write permissions on the namespace.
 * @throws NamespaceNotFoundException If the specified namespace does not exist.
 * @throws AlreadyExistsException If the key already exists in the namespace. Updating is not supported.
 * @throws IOException If there was a problem storing the key to underlying provider.
 */
@Override public synchronized void put(SecureKeyId secureKeyId,SecureKeyCreateRequest secureKeyCreateRequest) throws Exception {
  Principal principal=authenticationContext.getPrincipal();
  NamespaceId namespaceId=new NamespaceId(secureKeyId.getNamespace());
  authorizationEnforcer.enforce(namespaceId,principal,Action.WRITE);
  String description=secureKeyCreateRequest.getDescription();
  String value=secureKeyCreateRequest.getData();
  if (Strings.isNullOrEmpty(value)) {
    throw new BadRequestException("String_Node_Str" + "String_Node_Str");
  }
  secureStoreManager.putSecureData(secureKeyId.getNamespace(),secureKeyId.getName(),value,description,secureKeyCreateRequest.getProperties());
  authorizer.grant(secureKeyId,principal,ImmutableSet.of(Action.ALL));
}

Fixed version (ground truth):
/** 
 * Puts the user provided data in the secure store, if the user has write access to the namespace. Grants the user all access to the newly created entity.
 * @param secureKeyId The Id for the key that needs to be stored.
 * @param secureKeyCreateRequest The request containing the data to be stored in the secure store.
 * @throws BadRequestException If the request does not contain the value to be stored.
 * @throws UnauthorizedException If the user does not have write permissions on the namespace.
 * @throws NamespaceNotFoundException If the specified namespace does not exist.
 * @throws AlreadyExistsException If the key already exists in the namespace. Updating is not supported.
 * @throws IOException If there was a problem storing the key to underlying provider.
 */
@Override public synchronized void put(SecureKeyId secureKeyId,SecureKeyCreateRequest secureKeyCreateRequest) throws Exception {
  Principal principal=authenticationContext.getPrincipal();
  NamespaceId namespaceId=new NamespaceId(secureKeyId.getNamespace());
  authorizationEnforcer.enforce(namespaceId,principal,Action.WRITE);
  String description=secureKeyCreateRequest.getDescription();
  String value=secureKeyCreateRequest.getData();
  if (Strings.isNullOrEmpty(value)) {
    throw new BadRequestException("String_Node_Str" + "String_Node_Str");
  }
  secureStoreManager.putSecureData(secureKeyId.getNamespace(),secureKeyId.getName(),value,description,secureKeyCreateRequest.getProperties());
  authorizer.grant(secureKeyId,principal,EnumSet.allOf(Action.class));
}
Program: 5949
Project: 5949
Buggy source:
@Test public void testAuthorizationForPrivileges() throws Exception {
  Principal bob=new Principal("String_Node_Str",Principal.PrincipalType.USER);
  Principal alice=new Principal("String_Node_Str",Principal.PrincipalType.USER);
  String oldUser=getCurrentUser();
  setCurrentUser(alice.getName());
  try {
    try {
      client.grant(ns1,bob,ImmutableSet.of(Action.ALL));
      Assert.fail(String.format("String_Node_Str" + "String_Node_Str",ns1));
    }
 catch (    UnauthorizedException expected) {
    }
    setCurrentUser(oldUser);
    client.grant(ns1,alice,ImmutableSet.of(Action.ADMIN));
    setCurrentUser(alice.getName());
    client.grant(ns1,bob,ImmutableSet.of(Action.ALL));
    setCurrentUser(oldUser);
    client.revoke(ns1);
    setCurrentUser(alice.getName());
    try {
      client.revoke(ns1,bob,ImmutableSet.of(Action.ALL));
      Assert.fail(String.format("String_Node_Str" + "String_Node_Str",ns1));
    }
 catch (    UnauthorizedException expected) {
    }
    setCurrentUser(oldUser);
    client.grant(ns1,alice,ImmutableSet.of(Action.ALL));
    setCurrentUser(alice.getName());
    client.revoke(ns1,bob,ImmutableSet.of(Action.ALL));
  }
  finally {
    setCurrentUser(oldUser);
  }
}

Fixed version (ground truth):
@Test public void testAuthorizationForPrivileges() throws Exception {
  Principal bob=new Principal("String_Node_Str",Principal.PrincipalType.USER);
  Principal alice=new Principal("String_Node_Str",Principal.PrincipalType.USER);
  String oldUser=getCurrentUser();
  setCurrentUser(alice.getName());
  try {
    try {
      client.grant(ns1,bob,EnumSet.allOf(Action.class));
      Assert.fail(String.format("String_Node_Str" + "String_Node_Str",ns1));
    }
 catch (    UnauthorizedException expected) {
    }
    setCurrentUser(oldUser);
    client.grant(ns1,alice,ImmutableSet.of(Action.ADMIN));
    setCurrentUser(alice.getName());
    client.grant(ns1,bob,EnumSet.allOf(Action.class));
    setCurrentUser(oldUser);
    client.revoke(ns1);
    setCurrentUser(alice.getName());
    try {
      client.revoke(ns1,bob,EnumSet.allOf(Action.class));
      Assert.fail(String.format("String_Node_Str" + "String_Node_Str",ns1));
    }
 catch (    UnauthorizedException expected) {
    }
    setCurrentUser(oldUser);
    client.grant(ns1,alice,EnumSet.allOf(Action.class));
    setCurrentUser(alice.getName());
    client.revoke(ns1,bob,EnumSet.allOf(Action.class));
  }
  finally {
    setCurrentUser(oldUser);
  }
}
Program: 5951
Project: 5951
Buggy source:
@Test public void testPrivilegesManager() throws Exception {
  privilegesManager.grant(NS,ALICE,Collections.singleton(Action.ALL));
  privilegesManager.grant(APP,ALICE,Collections.singleton(Action.ADMIN));
  privilegesManager.grant(PROGRAM,ALICE,Collections.singleton(Action.EXECUTE));
  authorizer.enforce(NS,ALICE,Action.ALL);
  authorizer.enforce(APP,ALICE,Action.ADMIN);
  authorizer.enforce(PROGRAM,ALICE,Action.EXECUTE);
  try {
    authorizer.enforce(APP,ALICE,Action.ALL);
    Assert.fail("String_Node_Str");
  }
 catch (  UnauthorizedException e) {
  }
  privilegesManager.revoke(PROGRAM);
  privilegesManager.revoke(APP,ALICE,EnumSet.allOf(Action.class));
  privilegesManager.revoke(NS,ALICE,Collections.singleton(Action.ALL));
  Set<Privilege> privileges=authorizer.listPrivileges(ALICE);
  Assert.assertTrue(String.format("String_Node_Str",privileges),privileges.isEmpty());
}

Fixed version (ground truth):
@Test public void testPrivilegesManager() throws Exception {
  privilegesManager.grant(NS,ALICE,EnumSet.allOf(Action.class));
  privilegesManager.grant(APP,ALICE,Collections.singleton(Action.ADMIN));
  privilegesManager.grant(PROGRAM,ALICE,Collections.singleton(Action.EXECUTE));
  authorizer.enforce(NS,ALICE,EnumSet.allOf(Action.class));
  authorizer.enforce(APP,ALICE,Action.ADMIN);
  authorizer.enforce(PROGRAM,ALICE,Action.EXECUTE);
  try {
    authorizer.enforce(APP,ALICE,EnumSet.allOf(Action.class));
    Assert.fail("String_Node_Str");
  }
 catch (  UnauthorizedException e) {
  }
  privilegesManager.revoke(PROGRAM);
  privilegesManager.revoke(APP,ALICE,EnumSet.allOf(Action.class));
  privilegesManager.revoke(NS,ALICE,EnumSet.allOf(Action.class));
  Set<Privilege> privileges=authorizer.listPrivileges(ALICE);
  Assert.assertTrue(String.format("String_Node_Str",privileges),privileges.isEmpty());
}
Program: 5955
Project: 5955
Buggy source:
@Test public void testListStreams() throws Exception {
  StreamAdmin streamAdmin=getStreamAdmin();
  NamespaceId nsId=new NamespaceId(FOO_NAMESPACE);
  grantAndAssertSuccess(nsId,USER,EnumSet.allOf(Action.class));
  StreamId s1=nsId.stream("String_Node_Str");
  StreamId s2=nsId.stream("String_Node_Str");
  List<StreamSpecification> specifications=streamAdmin.listStreams(nsId);
  Assert.assertTrue(specifications.isEmpty());
  streamAdmin.create(s1.toId());
  streamAdmin.create(s2.toId());
  specifications=streamAdmin.listStreams(nsId);
  Assert.assertEquals(2,specifications.size());
  revokeAndAssertSuccess(s1,USER,EnumSet.allOf(Action.class));
  specifications=streamAdmin.listStreams(nsId);
  Assert.assertEquals(2,specifications.size());
  Assert.assertEquals(s2.getStream(),specifications.get(0).getName());
  revokeAndAssertSuccess(s2,USER,EnumSet.allOf(Action.class));
  specifications=streamAdmin.listStreams(nsId);
  Assert.assertEquals(2,specifications.size());
  revokeAndAssertSuccess(nsId,USER,EnumSet.allOf(Action.class));
  specifications=streamAdmin.listStreams(nsId);
  Assert.assertTrue(specifications.isEmpty());
  grantAndAssertSuccess(s1,USER,ImmutableSet.of(Action.ALL));
  grantAndAssertSuccess(s2,USER,ImmutableSet.of(Action.ALL));
  streamAdmin.drop(s1.toId());
  streamAdmin.drop(s2.toId());
}

Fixed version (ground truth):
@Test public void testListStreams() throws Exception {
  StreamAdmin streamAdmin=getStreamAdmin();
  NamespaceId nsId=new NamespaceId(FOO_NAMESPACE);
  grantAndAssertSuccess(nsId,USER,EnumSet.allOf(Action.class));
  StreamId s1=nsId.stream("String_Node_Str");
  StreamId s2=nsId.stream("String_Node_Str");
  List<StreamSpecification> specifications=streamAdmin.listStreams(nsId);
  Assert.assertTrue(specifications.isEmpty());
  streamAdmin.create(s1.toId());
  streamAdmin.create(s2.toId());
  specifications=streamAdmin.listStreams(nsId);
  Assert.assertEquals(2,specifications.size());
  revokeAndAssertSuccess(s1,USER,EnumSet.allOf(Action.class));
  specifications=streamAdmin.listStreams(nsId);
  Assert.assertEquals(2,specifications.size());
  Set<String> streamNames=ImmutableSet.of(s1.getStream(),s2.getStream());
  Assert.assertTrue(streamNames.contains(specifications.get(0).getName()));
  Assert.assertTrue(streamNames.contains(specifications.get(1).getName()));
  revokeAndAssertSuccess(s2,USER,EnumSet.allOf(Action.class));
  specifications=streamAdmin.listStreams(nsId);
  Assert.assertEquals(2,specifications.size());
  Assert.assertTrue(streamNames.contains(specifications.get(0).getName()));
  Assert.assertTrue(streamNames.contains(specifications.get(1).getName()));
  revokeAndAssertSuccess(nsId,USER,EnumSet.allOf(Action.class));
  specifications=streamAdmin.listStreams(nsId);
  Assert.assertTrue(specifications.isEmpty());
  grantAndAssertSuccess(s1,USER,EnumSet.allOf(Action.class));
  grantAndAssertSuccess(s2,USER,EnumSet.allOf(Action.class));
  streamAdmin.drop(s1.toId());
  streamAdmin.drop(s2.toId());
}
Program: 5957
Project: 5957
Buggy source:
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);
  }
}

Fixed version (ground truth):
private void grantAllPrivilegesOnModule(DatasetModuleId moduleId,Principal principal,@Nullable DatasetModuleMeta moduleMeta) throws Exception {
  privilegesManager.grant(moduleId,principal,EnumSet.allOf(Action.class));
  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,EnumSet.allOf(Action.class));
  }
}
Program: 5958
Project: 5958
Buggy source:
@VisibleForTesting static ClassLoader createParent(){
  ClassLoader baseClassLoader=AuthorizerClassLoader.class.getClassLoader();
  Set<String> authorizerResources;
  try {
    authorizerResources=ClassPathResources.getResourcesWithDependencies(baseClassLoader,Authorizer.class);
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str" + "String_Node_Str",e);
    authorizerResources=ImmutableSet.of();
  }
  Set<String> apiResources;
  try {
    apiResources=ClassPathResources.getResourcesWithDependencies(baseClassLoader,Application.class);
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str" + "String_Node_Str",e);
    apiResources=ImmutableSet.of();
  }
  final Set<String> finalAuthorizerResources=Sets.union(authorizerResources,apiResources);
  return new FilterClassLoader(baseClassLoader,new FilterClassLoader.Filter(){
    @Override public boolean acceptResource(    String resource){
      return finalAuthorizerResources.contains(resource);
    }
    @Override public boolean acceptPackage(    String packageName){
      return true;
    }
  }
);
}

Fixed version (ground truth):
@VisibleForTesting static ClassLoader createParent(){
  ClassLoader baseClassLoader=AuthorizerClassLoader.class.getClassLoader();
  final Set<String> authorizerResources=traceSecurityDependencies(baseClassLoader);
  final FilterClassLoader.Filter defaultFilter=FilterClassLoader.defaultFilter();
  return new FilterClassLoader(baseClassLoader,new FilterClassLoader.Filter(){
    @Override public boolean acceptResource(    String resource){
      return defaultFilter.acceptResource(resource) || authorizerResources.contains(resource);
    }
    @Override public boolean acceptPackage(    String packageName){
      return true;
    }
  }
);
}
Program: 5959
Project: 5959
Buggy source:
@Override public boolean acceptResource(String resource){
  return finalAuthorizerResources.contains(resource);
}

Fixed version (ground truth):
@Override public boolean acceptResource(String resource){
  return defaultFilter.acceptResource(resource) || authorizerResources.contains(resource);
}
Program: 5960
Project: 5960
Buggy source:
@Test public void testAuthorizerClassLoaderParentUnavailableClasses(){
  assertClassUnavailable(ImmutableList.class);
  assertClassUnavailable(Configuration.class);
  assertClassUnavailable(HTable.class);
  assertClassUnavailable("String_Node_Str");
  assertClassUnavailable(ClassPathResources.class);
  assertClassUnavailable(AuthorizerClassLoader.class);
  assertClassUnavailable("String_Node_Str");
  assertClassUnavailable("String_Node_Str");
}

Fixed version (ground truth):
@Test public void testAuthorizerClassLoaderParentUnavailableClasses(){
  assertClassUnavailable(ImmutableList.class);
  assertClassUnavailable(HTable.class);
  assertClassUnavailable("String_Node_Str");
  assertClassUnavailable(ClassPathResources.class);
  assertClassUnavailable(AuthorizerClassLoader.class);
  assertClassUnavailable("String_Node_Str");
  assertClassUnavailable("String_Node_Str");
}
Program: 5961
Project: 5961
Buggy source:
@Test public void testAuthorizerClassLoaderParentAvailableClasses() throws ClassNotFoundException {
  parent.loadClass(List.class.getName());
  parent.loadClass(Nullable.class.getName());
  parent.loadClass(Gson.class.getName());
  parent.loadClass(Application.class.getName());
  parent.loadClass(LocationFactory.class.getName());
  parent.loadClass(Logger.class.getName());
  parent.loadClass(Principal.class.getName());
  parent.loadClass(Authorizer.class.getName());
  parent.loadClass(UnauthorizedException.class.getName());
}

Fixed version (ground truth):
@Test public void testAuthorizerClassLoaderParentAvailableClasses() throws ClassNotFoundException {
  parent.loadClass(List.class.getName());
  parent.loadClass(Nullable.class.getName());
  parent.loadClass(Gson.class.getName());
  parent.loadClass(Application.class.getName());
  parent.loadClass(LocationFactory.class.getName());
  parent.loadClass(Logger.class.getName());
  parent.loadClass(Principal.class.getName());
  parent.loadClass(Authorizer.class.getName());
  parent.loadClass(UnauthorizedException.class.getName());
  parent.loadClass(Configuration.class.getName());
  parent.loadClass(UserGroupInformation.class.getName());
}
Program: 5962
Project: 5962
Buggy source:
/** 
 * Creates   {@link ImpersonationInfo} for the specified namespace. If the info is not configured at the namespacelevel is empty, returns the info configured at the cdap level.
 */
public ImpersonationInfo(NamespaceMeta namespaceMeta,CConfiguration cConf){
  NamespaceConfig namespaceConfig=namespaceMeta.getConfig();
  String configuredPrincipal=namespaceConfig.getPrincipal();
  String configuredKeytabURI=namespaceConfig.getKeytabURI();
  if (configuredPrincipal != null && configuredKeytabURI != null) {
    this.principal=configuredPrincipal;
    this.keytabURI=configuredKeytabURI;
  }
 else   if (configuredPrincipal == null && configuredKeytabURI == null) {
    this.principal=cConf.get(Constants.Security.CFG_CDAP_MASTER_KRB_PRINCIPAL);
    this.keytabURI=cConf.get(Constants.Security.CFG_CDAP_MASTER_KRB_KEYTAB_PATH);
  }
  throw new IllegalStateException(String.format("String_Node_Str" + "String_Node_Str",configuredPrincipal,configuredKeytabURI));
}

Fixed version (ground truth):
/** 
 * Creates   {@link ImpersonationInfo} for the specified namespace. If the info is not configured at the namespacelevel is empty, returns the info configured at the cdap level.
 */
public ImpersonationInfo(NamespaceMeta namespaceMeta,CConfiguration cConf){
  NamespaceConfig namespaceConfig=namespaceMeta.getConfig();
  String configuredPrincipal=namespaceConfig.getPrincipal();
  String configuredKeytabURI=namespaceConfig.getKeytabURI();
  if (configuredPrincipal != null && configuredKeytabURI != null) {
    this.principal=configuredPrincipal;
    this.keytabURI=configuredKeytabURI;
  }
 else   if (configuredPrincipal == null && configuredKeytabURI == null) {
    this.principal=cConf.get(Constants.Security.CFG_CDAP_MASTER_KRB_PRINCIPAL);
    this.keytabURI=cConf.get(Constants.Security.CFG_CDAP_MASTER_KRB_KEYTAB_PATH);
  }
 else {
    throw new IllegalStateException(String.format("String_Node_Str" + "String_Node_Str",configuredPrincipal,configuredKeytabURI));
  }
}
Program: 5964
Project: 5964
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public T get(){
  boolean kmsBacked=KMS_BACKED.equalsIgnoreCase(cConf.get(Constants.Security.Store.PROVIDER));
  boolean fileBacked=FILE_BACKED.equalsIgnoreCase(cConf.get(Constants.Security.Store.PROVIDER));
  boolean validPassword=!Strings.isNullOrEmpty(sConf.get(Constants.Security.Store.FILE_PASSWORD));
  if (fileBacked && validPassword) {
    return (T)injector.getInstance(FileSecureStore.class);
  }
  if (fileBacked) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  if (kmsBacked) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  }
  return (T)injector.getInstance(DummySecureStore.class);
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public T get(){
  boolean fileBacked=SecureStoreUtils.isFileBacked(cConf);
  boolean validPassword=!Strings.isNullOrEmpty(sConf.get(Constants.Security.Store.FILE_PASSWORD));
  if (fileBacked && validPassword) {
    return (T)injector.getInstance(FileSecureStore.class);
  }
  if (fileBacked) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  if (SecureStoreUtils.isKMSBacked(cConf)) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  }
  return (T)injector.getInstance(DummySecureStore.class);
}
Program: 5965
Project: 5965
Buggy source:
/** 
 * Create a namespace in the File System and Hive.
 * @param namespaceMeta {@link NamespaceMeta} for the namespace to create
 * @throws IOException if there are errors while creating the namespace in the File System
 * @throws ExploreException if there are errors while deleting the namespace in Hive
 * @throws SQLException if there are errors while deleting the namespace in Hive
 */
@Override public void create(NamespaceMeta namespaceMeta) throws IOException, ExploreException, SQLException {
  createLocation(namespaceMeta);
  if (cConf.getBoolean(Constants.Explore.EXPLORE_ENABLED)) {
    try {
      exploreFacade.createNamespace(namespaceMeta);
    }
 catch (    ExploreException|SQLException e) {
      deleteLocation(namespaceMeta.getNamespaceId());
      throw e;
    }
  }
}

Fixed version (ground truth):
/** 
 * Create a namespace in the File System and Hive. The hive database is only created for non-default namespaces.
 * @param namespaceMeta {@link NamespaceMeta} for the namespace to create
 * @throws IOException if there are errors while creating the namespace in the File System
 * @throws ExploreException if there are errors while creating the namespace in Hive
 * @throws SQLException if there are errors while creating the namespace in Hive
 */
@Override public void create(NamespaceMeta namespaceMeta) throws IOException, ExploreException, SQLException {
  createLocation(namespaceMeta);
  if (cConf.getBoolean(Constants.Explore.EXPLORE_ENABLED) && !NamespaceId.DEFAULT.equals(namespaceMeta.getNamespaceId())) {
    try {
      exploreFacade.createNamespace(namespaceMeta);
    }
 catch (    ExploreException|SQLException e) {
      deleteLocation(namespaceMeta.getNamespaceId());
      throw e;
    }
  }
}
Program: 5966
Project: 5966
Buggy source:
/** 
 * Deletes the namespace directory on the FileSystem and Hive.
 * @param namespaceId {@link NamespaceId} for the namespace to delete
 * @throws IOException if there are errors while deleting the namespace in the File System
 * @throws ExploreException if there are errors while deleting the namespace in Hive
 * @throws SQLException if there are errors while deleting the namespace in Hive
 */
@Override public void delete(NamespaceId namespaceId) throws IOException, ExploreException, SQLException {
  deleteLocation(namespaceId);
  if (cConf.getBoolean(Constants.Explore.EXPLORE_ENABLED)) {
    exploreFacade.removeNamespace(namespaceId.toId());
  }
}

Fixed version (ground truth):
/** 
 * Deletes the namespace directory on the FileSystem and Hive.
 * @param namespaceId {@link NamespaceId} for the namespace to delete
 * @throws IOException if there are errors while deleting the namespace in the File System
 * @throws ExploreException if there are errors while deleting the namespace in Hive
 * @throws SQLException if there are errors while deleting the namespace in Hive
 */
@Override public void delete(NamespaceId namespaceId) throws IOException, ExploreException, SQLException {
  deleteLocation(namespaceId);
  if (cConf.getBoolean(Constants.Explore.EXPLORE_ENABLED) && !NamespaceId.DEFAULT.equals(namespaceId)) {
    exploreFacade.removeNamespace(namespaceId.toId());
  }
}
Program: 5967
Project: 5967
Buggy source:
@Inject DefaultNamespaceAdmin(Store store,NamespaceStore nsStore,PreferencesStore preferencesStore,DashboardStore dashboardStore,DatasetFramework dsFramework,ProgramRuntimeService runtimeService,QueueAdmin queueAdmin,StreamAdmin streamAdmin,MetricStore metricStore,Scheduler scheduler,ApplicationLifecycleService applicationLifecycleService,ArtifactRepository artifactRepository,AuthorizerInstantiator authorizerInstantiator,CConfiguration cConf,StorageProviderNamespaceAdmin storageProviderNamespaceAdmin,Impersonator impersonator,AuthorizationEnforcer authorizationEnforcer,AuthenticationContext authenticationContext){
  super(nsStore,authorizationEnforcer,authenticationContext);
  this.queueAdmin=queueAdmin;
  this.streamAdmin=streamAdmin;
  this.store=store;
  this.preferencesStore=preferencesStore;
  this.dashboardStore=dashboardStore;
  this.dsFramework=dsFramework;
  this.runtimeService=runtimeService;
  this.scheduler=scheduler;
  this.metricStore=metricStore;
  this.applicationLifecycleService=applicationLifecycleService;
  this.artifactRepository=artifactRepository;
  this.authorizer=authorizerInstantiator.get();
  this.authorizationEnforcer=authorizationEnforcer;
  this.instanceId=createInstanceId(cConf);
  this.storageProviderNamespaceAdmin=storageProviderNamespaceAdmin;
  this.impersonator=impersonator;
}

Fixed version (ground truth):
@Inject DefaultNamespaceAdmin(Store store,NamespaceStore nsStore,PreferencesStore preferencesStore,DashboardStore dashboardStore,DatasetFramework dsFramework,ProgramRuntimeService runtimeService,QueueAdmin queueAdmin,StreamAdmin streamAdmin,MetricStore metricStore,Scheduler scheduler,ApplicationLifecycleService applicationLifecycleService,ArtifactRepository artifactRepository,AuthorizerInstantiator authorizerInstantiator,CConfiguration cConf,StorageProviderNamespaceAdmin storageProviderNamespaceAdmin,Impersonator impersonator,AuthorizationEnforcer authorizationEnforcer,AuthenticationContext authenticationContext){
  super(nsStore,authorizationEnforcer,authenticationContext);
  this.queueAdmin=queueAdmin;
  this.streamAdmin=streamAdmin;
  this.store=store;
  this.preferencesStore=preferencesStore;
  this.dashboardStore=dashboardStore;
  this.dsFramework=dsFramework;
  this.runtimeService=runtimeService;
  this.scheduler=scheduler;
  this.metricStore=metricStore;
  this.applicationLifecycleService=applicationLifecycleService;
  this.artifactRepository=artifactRepository;
  this.authorizer=authorizerInstantiator.get();
  this.authorizationEnforcer=authorizationEnforcer;
  this.instanceId=createInstanceId(cConf);
  this.storageProviderNamespaceAdmin=storageProviderNamespaceAdmin;
  this.impersonator=impersonator;
  this.cConf=cConf;
}