Program: 6036
Project: 6036
Buggy source:
protected static void initializeAndStartService(CConfiguration cConf) throws Exception {
  injector=Guice.createInjector(new ConfigModule(cConf),new DiscoveryRuntimeModule().getInMemoryModules(),new NonCustomLocationUnitTestModule().getModule(),new NamespaceClientRuntimeModule().getInMemoryModules(),new SystemDatasetRuntimeModule().getInMemoryModules(),new TransactionInMemoryModule(),new AuthorizationTestModule(),new AuthorizationEnforcementModule().getInMemoryModules(),new AuthenticationContextModules().getMasterModule(),new AbstractModule(){
    @Override protected void configure(){
      bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Singleton.class);
      install(new FactoryModuleBuilder().implement(DatasetDefinitionRegistry.class,DefaultDatasetDefinitionRegistry.class).build(DatasetDefinitionRegistryFactory.class));
      bind(RemoteDatasetFramework.class);
    }
  }
);
  AuthorizationEnforcer authEnforcer=injector.getInstance(AuthorizationEnforcer.class);
  authEnforcementService=injector.getInstance(AuthorizationEnforcementService.class);
  authEnforcementService.startAndWait();
  AuthorizerInstantiator authorizerInstantiator=injector.getInstance(AuthorizerInstantiator.class);
  AuthenticationContext authenticationContext=injector.getInstance(AuthenticationContext.class);
  DiscoveryService discoveryService=injector.getInstance(DiscoveryService.class);
  discoveryServiceClient=injector.getInstance(DiscoveryServiceClient.class);
  dsFramework=injector.getInstance(RemoteDatasetFramework.class);
  txManager=injector.getInstance(TransactionManager.class);
  txManager.startAndWait();
  TransactionSystemClient txSystemClient=injector.getInstance(TransactionSystemClient.class);
  TransactionSystemClientService txSystemClientService=new DelegatingTransactionSystemClientService(txSystemClient);
  NamespacedLocationFactory namespacedLocationFactory=injector.getInstance(NamespacedLocationFactory.class);
  SystemDatasetInstantiatorFactory datasetInstantiatorFactory=new SystemDatasetInstantiatorFactory(locationFactory,dsFramework,cConf);
  Impersonator impersonator=new Impersonator(cConf,null,null);
  DatasetAdminService datasetAdminService=new DatasetAdminService(dsFramework,cConf,locationFactory,datasetInstantiatorFactory,new NoOpMetadataStore(),impersonator);
  ImmutableSet<HttpHandler> handlers=ImmutableSet.<HttpHandler>of(new DatasetAdminOpHTTPHandler(datasetAdminService));
  MetricsCollectionService metricsCollectionService=injector.getInstance(MetricsCollectionService.class);
  opExecutorService=new DatasetOpExecutorService(cConf,discoveryService,metricsCollectionService,handlers);
  opExecutorService.startAndWait();
  Map<String,DatasetModule> defaultModules=injector.getInstance(Key.get(new TypeLiteral<Map<String,DatasetModule>>(){
  }
,Names.named("String_Node_Str")));
  ImmutableMap<String,DatasetModule> modules=ImmutableMap.<String,DatasetModule>builder().putAll(defaultModules).putAll(DatasetMetaTableUtil.getModules()).build();
  registryFactory=injector.getInstance(DatasetDefinitionRegistryFactory.class);
  inMemoryDatasetFramework=new InMemoryDatasetFramework(registryFactory,modules);
  ExploreFacade exploreFacade=new ExploreFacade(new DiscoveryExploreClient(cConf,discoveryServiceClient),cConf);
  namespaceAdmin=injector.getInstance(NamespaceAdmin.class);
  namespaceAdmin.create(NamespaceMeta.DEFAULT);
  NamespaceQueryAdmin namespaceQueryAdmin=injector.getInstance(NamespaceQueryAdmin.class);
  TransactionExecutorFactory txExecutorFactory=new DynamicTransactionExecutorFactory(txSystemClient);
  DatasetTypeManager typeManager=new DatasetTypeManager(cConf,locationFactory,txSystemClientService,txExecutorFactory,inMemoryDatasetFramework,defaultModules,impersonator);
  DatasetOpExecutor opExecutor=new InMemoryDatasetOpExecutor(dsFramework);
  DatasetInstanceManager instanceManager=new DatasetInstanceManager(txSystemClientService,txExecutorFactory,inMemoryDatasetFramework);
  instanceService=new DatasetInstanceService(typeManager,instanceManager,opExecutor,exploreFacade,namespaceQueryAdmin,authEnforcer,authorizerInstantiator,authenticationContext);
  DatasetTypeService typeService=new DatasetTypeService(typeManager,namespaceAdmin,namespacedLocationFactory,authEnforcer,authorizerInstantiator,authenticationContext,cConf,impersonator);
  service=new DatasetService(cConf,discoveryService,discoveryServiceClient,typeManager,metricsCollectionService,opExecutor,new HashSet<DatasetMetricsReporter>(),typeService,instanceService);
  service.startAndWait();
  waitForService(Constants.Service.DATASET_EXECUTOR);
  waitForService(Constants.Service.DATASET_MANAGER);
  Locations.mkdirsIfNotExists(namespacedLocationFactory.get(Id.Namespace.DEFAULT));
}

Fixed version (ground truth):
protected static void initializeAndStartService(CConfiguration cConf) throws Exception {
  injector=Guice.createInjector(new ConfigModule(cConf),new DiscoveryRuntimeModule().getInMemoryModules(),new NonCustomLocationUnitTestModule().getModule(),new NamespaceClientRuntimeModule().getInMemoryModules(),new SystemDatasetRuntimeModule().getInMemoryModules(),new TransactionInMemoryModule(),new AuthorizationTestModule(),new AuthorizationEnforcementModule().getInMemoryModules(),new AuthenticationContextModules().getMasterModule(),new AbstractModule(){
    @Override protected void configure(){
      bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Singleton.class);
      install(new FactoryModuleBuilder().implement(DatasetDefinitionRegistry.class,DefaultDatasetDefinitionRegistry.class).build(DatasetDefinitionRegistryFactory.class));
      bind(RemoteDatasetFramework.class);
    }
  }
);
  AuthorizationEnforcer authEnforcer=injector.getInstance(AuthorizationEnforcer.class);
  authEnforcementService=injector.getInstance(AuthorizationEnforcementService.class);
  authEnforcementService.startAndWait();
  AuthenticationContext authenticationContext=injector.getInstance(AuthenticationContext.class);
  DiscoveryService discoveryService=injector.getInstance(DiscoveryService.class);
  discoveryServiceClient=injector.getInstance(DiscoveryServiceClient.class);
  dsFramework=injector.getInstance(RemoteDatasetFramework.class);
  txManager=injector.getInstance(TransactionManager.class);
  txManager.startAndWait();
  TransactionSystemClient txSystemClient=injector.getInstance(TransactionSystemClient.class);
  TransactionSystemClientService txSystemClientService=new DelegatingTransactionSystemClientService(txSystemClient);
  NamespacedLocationFactory namespacedLocationFactory=injector.getInstance(NamespacedLocationFactory.class);
  SystemDatasetInstantiatorFactory datasetInstantiatorFactory=new SystemDatasetInstantiatorFactory(locationFactory,dsFramework,cConf);
  Impersonator impersonator=new Impersonator(cConf,null,null);
  DatasetAdminService datasetAdminService=new DatasetAdminService(dsFramework,cConf,locationFactory,datasetInstantiatorFactory,new NoOpMetadataStore(),impersonator);
  ImmutableSet<HttpHandler> handlers=ImmutableSet.<HttpHandler>of(new DatasetAdminOpHTTPHandler(datasetAdminService));
  MetricsCollectionService metricsCollectionService=injector.getInstance(MetricsCollectionService.class);
  opExecutorService=new DatasetOpExecutorService(cConf,discoveryService,metricsCollectionService,handlers);
  opExecutorService.startAndWait();
  Map<String,DatasetModule> defaultModules=injector.getInstance(Key.get(new TypeLiteral<Map<String,DatasetModule>>(){
  }
,Names.named("String_Node_Str")));
  ImmutableMap<String,DatasetModule> modules=ImmutableMap.<String,DatasetModule>builder().putAll(defaultModules).putAll(DatasetMetaTableUtil.getModules()).build();
  registryFactory=injector.getInstance(DatasetDefinitionRegistryFactory.class);
  inMemoryDatasetFramework=new InMemoryDatasetFramework(registryFactory,modules);
  ExploreFacade exploreFacade=new ExploreFacade(new DiscoveryExploreClient(cConf,discoveryServiceClient),cConf);
  namespaceAdmin=injector.getInstance(NamespaceAdmin.class);
  namespaceAdmin.create(NamespaceMeta.DEFAULT);
  NamespaceQueryAdmin namespaceQueryAdmin=injector.getInstance(NamespaceQueryAdmin.class);
  TransactionExecutorFactory txExecutorFactory=new DynamicTransactionExecutorFactory(txSystemClient);
  DatasetTypeManager typeManager=new DatasetTypeManager(cConf,locationFactory,txSystemClientService,txExecutorFactory,inMemoryDatasetFramework,defaultModules,impersonator);
  DatasetOpExecutor opExecutor=new InMemoryDatasetOpExecutor(dsFramework);
  DatasetInstanceManager instanceManager=new DatasetInstanceManager(txSystemClientService,txExecutorFactory,inMemoryDatasetFramework);
  PrivilegesManager privilegesManager=injector.getInstance(PrivilegesManager.class);
  instanceService=new DatasetInstanceService(typeManager,instanceManager,opExecutor,exploreFacade,namespaceQueryAdmin,authEnforcer,privilegesManager,authenticationContext);
  DatasetTypeService typeService=new DatasetTypeService(typeManager,namespaceAdmin,namespacedLocationFactory,authEnforcer,privilegesManager,authenticationContext,cConf,impersonator);
  service=new DatasetService(cConf,discoveryService,discoveryServiceClient,typeManager,metricsCollectionService,opExecutor,new HashSet<DatasetMetricsReporter>(),typeService,instanceService);
  service.startAndWait();
  waitForService(Constants.Service.DATASET_EXECUTOR);
  waitForService(Constants.Service.DATASET_MANAGER);
  Locations.mkdirsIfNotExists(namespacedLocationFactory.get(Id.Namespace.DEFAULT));
}