Program: 6102
Project: 6102
Buggy source:
@BeforeClass public static void initialize() throws Exception {
  if (startCount++ > 0) {
    return;
  }
  File localDataDir=TMP_FOLDER.newFolder();
  cConf=createCConf(localDataDir);
  org.apache.hadoop.conf.Configuration hConf=new org.apache.hadoop.conf.Configuration();
  hConf.addResource("String_Node_Str");
  hConf.reloadConfiguration();
  hConf.set(Constants.CFG_LOCAL_DATA_DIR,localDataDir.getAbsolutePath());
  hConf.set(Constants.AppFabric.OUTPUT_DIR,cConf.get(Constants.AppFabric.OUTPUT_DIR));
  hConf.set("String_Node_Str",new File(localDataDir,cConf.get(Constants.AppFabric.TEMP_DIR)).getAbsolutePath());
  if (OSDetector.isWindows()) {
    File tmpDir=TMP_FOLDER.newFolder();
    File binDir=new File(tmpDir,"String_Node_Str");
    Assert.assertTrue(binDir.mkdirs());
    copyTempFile("String_Node_Str",tmpDir);
    copyTempFile("String_Node_Str",binDir);
    System.setProperty("String_Node_Str",tmpDir.getAbsolutePath());
    System.load(new File(tmpDir,"String_Node_Str").getAbsolutePath());
  }
  Injector injector=Guice.createInjector(createDataFabricModule(),new TransactionExecutorModule(),new DataSetsModules().getStandaloneModules(),new DataSetServiceModules().getInMemoryModules(),new ConfigModule(cConf,hConf),new IOModule(),new LocationRuntimeModule().getInMemoryModules(),new DiscoveryRuntimeModule().getInMemoryModules(),new AppFabricServiceRuntimeModule().getInMemoryModules(),new ServiceStoreModules().getInMemoryModules(),new InMemoryProgramRunnerModule(LocalStreamWriter.class),new AbstractModule(){
    @Override protected void configure(){
      bind(StreamHandler.class).in(Scopes.SINGLETON);
      bind(StreamFetchHandler.class).in(Scopes.SINGLETON);
      bind(StreamViewHttpHandler.class).in(Scopes.SINGLETON);
      bind(StreamFileJanitorService.class).to(LocalStreamFileJanitorService.class).in(Scopes.SINGLETON);
      bind(StreamWriterSizeCollector.class).to(BasicStreamWriterSizeCollector.class).in(Scopes.SINGLETON);
      bind(StreamCoordinatorClient.class).to(InMemoryStreamCoordinatorClient.class).in(Scopes.SINGLETON);
      bind(MetricsManager.class).toProvider(MetricsManagerProvider.class);
    }
  }
,new MetricsHandlerModule(),new MetricsClientRuntimeModule().getInMemoryModules(),new LoggingModules().getInMemoryModules(),new LogReaderRuntimeModules().getInMemoryModules(),new ExploreRuntimeModule().getInMemoryModules(),new ExploreClientModule(),new NotificationFeedServiceRuntimeModule().getInMemoryModules(),new NotificationServiceRuntimeModule().getInMemoryModules(),new NamespaceStoreModule().getStandaloneModules(),new AuthorizationModule(),new AuthorizationEnforcementModule().getInMemoryModules(),new AbstractModule(){
    @Override @SuppressWarnings("String_Node_Str") protected void configure(){
      install(new FactoryModuleBuilder().implement(ApplicationManager.class,DefaultApplicationManager.class).build(ApplicationManagerFactory.class));
      install(new FactoryModuleBuilder().implement(ArtifactManager.class,DefaultArtifactManager.class).build(ArtifactManagerFactory.class));
      install(new FactoryModuleBuilder().implement(StreamManager.class,DefaultStreamManager.class).build(StreamManagerFactory.class));
      bind(TemporaryFolder.class).toInstance(TMP_FOLDER);
      bind(AuthorizationHandler.class).in(Scopes.SINGLETON);
    }
  }
);
  txService=injector.getInstance(TransactionManager.class);
  txService.startAndWait();
  dsOpService=injector.getInstance(DatasetOpExecutor.class);
  dsOpService.startAndWait();
  datasetService=injector.getInstance(DatasetService.class);
  datasetService.startAndWait();
  metricsQueryService=injector.getInstance(MetricsQueryService.class);
  metricsQueryService.startAndWait();
  metricsCollectionService=injector.getInstance(MetricsCollectionService.class);
  metricsCollectionService.startAndWait();
  schedulerService=injector.getInstance(SchedulerService.class);
  schedulerService.startAndWait();
  if (cConf.getBoolean(Constants.Explore.EXPLORE_ENABLED)) {
    exploreExecutorService=injector.getInstance(ExploreExecutorService.class);
    exploreExecutorService.startAndWait();
    exploreClient=injector.getInstance(ExploreClient.class);
  }
  streamCoordinatorClient=injector.getInstance(StreamCoordinatorClient.class);
  streamCoordinatorClient.startAndWait();
  testManager=injector.getInstance(UnitTestManager.class);
  metricsManager=injector.getInstance(MetricsManager.class);
  authorizerInstantiator=injector.getInstance(AuthorizerInstantiator.class);
  if (cConf.getBoolean(Constants.Security.Authorization.ENABLED)) {
    String user=System.getProperty("String_Node_Str");
    SecurityRequestContext.setUserId(user);
    InstanceId instance=new InstanceId(cConf.get(Constants.INSTANCE_NAME));
    Principal principal=new Principal(user,Principal.PrincipalType.USER);
    authorizerInstantiator.get().grant(instance,principal,ImmutableSet.of(Action.ADMIN));
    authorizerInstantiator.get().grant(NamespaceId.DEFAULT,principal,ImmutableSet.of(Action.ADMIN));
  }
  namespaceAdmin=injector.getInstance(NamespaceAdmin.class);
  namespaceAdmin.create(NamespaceMeta.DEFAULT);
  secureStore=injector.getInstance(SecureStore.class);
  secureStoreManager=injector.getInstance(SecureStoreManager.class);
}

Fixed version (ground truth):
@BeforeClass public static void initialize() throws Exception {
  if (nestedStartCount++ > 0) {
    return;
  }
  File localDataDir=TMP_FOLDER.newFolder();
  cConf=createCConf(localDataDir);
  org.apache.hadoop.conf.Configuration hConf=new org.apache.hadoop.conf.Configuration();
  hConf.addResource("String_Node_Str");
  hConf.reloadConfiguration();
  hConf.set(Constants.CFG_LOCAL_DATA_DIR,localDataDir.getAbsolutePath());
  hConf.set(Constants.AppFabric.OUTPUT_DIR,cConf.get(Constants.AppFabric.OUTPUT_DIR));
  hConf.set("String_Node_Str",new File(localDataDir,cConf.get(Constants.AppFabric.TEMP_DIR)).getAbsolutePath());
  if (OSDetector.isWindows()) {
    File tmpDir=TMP_FOLDER.newFolder();
    File binDir=new File(tmpDir,"String_Node_Str");
    Assert.assertTrue(binDir.mkdirs());
    copyTempFile("String_Node_Str",tmpDir);
    copyTempFile("String_Node_Str",binDir);
    System.setProperty("String_Node_Str",tmpDir.getAbsolutePath());
    System.load(new File(tmpDir,"String_Node_Str").getAbsolutePath());
  }
  Injector injector=Guice.createInjector(createDataFabricModule(),new TransactionExecutorModule(),new DataSetsModules().getStandaloneModules(),new DataSetServiceModules().getInMemoryModules(),new ConfigModule(cConf,hConf),new IOModule(),new LocationRuntimeModule().getInMemoryModules(),new DiscoveryRuntimeModule().getInMemoryModules(),new AppFabricServiceRuntimeModule().getInMemoryModules(),new ServiceStoreModules().getInMemoryModules(),new InMemoryProgramRunnerModule(LocalStreamWriter.class),new AbstractModule(){
    @Override protected void configure(){
      bind(StreamHandler.class).in(Scopes.SINGLETON);
      bind(StreamFetchHandler.class).in(Scopes.SINGLETON);
      bind(StreamViewHttpHandler.class).in(Scopes.SINGLETON);
      bind(StreamFileJanitorService.class).to(LocalStreamFileJanitorService.class).in(Scopes.SINGLETON);
      bind(StreamWriterSizeCollector.class).to(BasicStreamWriterSizeCollector.class).in(Scopes.SINGLETON);
      bind(StreamCoordinatorClient.class).to(InMemoryStreamCoordinatorClient.class).in(Scopes.SINGLETON);
      bind(MetricsManager.class).toProvider(MetricsManagerProvider.class);
    }
  }
,new MetricsHandlerModule(),new MetricsClientRuntimeModule().getInMemoryModules(),new LoggingModules().getInMemoryModules(),new LogReaderRuntimeModules().getInMemoryModules(),new ExploreRuntimeModule().getInMemoryModules(),new ExploreClientModule(),new NotificationFeedServiceRuntimeModule().getInMemoryModules(),new NotificationServiceRuntimeModule().getInMemoryModules(),new NamespaceStoreModule().getStandaloneModules(),new AuthorizationModule(),new AuthorizationEnforcementModule().getInMemoryModules(),new AbstractModule(){
    @Override @SuppressWarnings("String_Node_Str") protected void configure(){
      install(new FactoryModuleBuilder().implement(ApplicationManager.class,DefaultApplicationManager.class).build(ApplicationManagerFactory.class));
      install(new FactoryModuleBuilder().implement(ArtifactManager.class,DefaultArtifactManager.class).build(ArtifactManagerFactory.class));
      install(new FactoryModuleBuilder().implement(StreamManager.class,DefaultStreamManager.class).build(StreamManagerFactory.class));
      bind(TemporaryFolder.class).toInstance(TMP_FOLDER);
      bind(AuthorizationHandler.class).in(Scopes.SINGLETON);
    }
  }
);
  txService=injector.getInstance(TransactionManager.class);
  txService.startAndWait();
  dsOpService=injector.getInstance(DatasetOpExecutor.class);
  dsOpService.startAndWait();
  datasetService=injector.getInstance(DatasetService.class);
  datasetService.startAndWait();
  metricsQueryService=injector.getInstance(MetricsQueryService.class);
  metricsQueryService.startAndWait();
  metricsCollectionService=injector.getInstance(MetricsCollectionService.class);
  metricsCollectionService.startAndWait();
  schedulerService=injector.getInstance(SchedulerService.class);
  schedulerService.startAndWait();
  if (cConf.getBoolean(Constants.Explore.EXPLORE_ENABLED)) {
    exploreExecutorService=injector.getInstance(ExploreExecutorService.class);
    exploreExecutorService.startAndWait();
    exploreClient=injector.getInstance(ExploreClient.class);
  }
  streamCoordinatorClient=injector.getInstance(StreamCoordinatorClient.class);
  streamCoordinatorClient.startAndWait();
  testManager=injector.getInstance(UnitTestManager.class);
  metricsManager=injector.getInstance(MetricsManager.class);
  authorizerInstantiator=injector.getInstance(AuthorizerInstantiator.class);
  if (cConf.getBoolean(Constants.Security.Authorization.ENABLED)) {
    String user=System.getProperty("String_Node_Str");
    SecurityRequestContext.setUserId(user);
    InstanceId instance=new InstanceId(cConf.get(Constants.INSTANCE_NAME));
    Principal principal=new Principal(user,Principal.PrincipalType.USER);
    authorizerInstantiator.get().grant(instance,principal,ImmutableSet.of(Action.ADMIN));
    authorizerInstantiator.get().grant(NamespaceId.DEFAULT,principal,ImmutableSet.of(Action.ADMIN));
  }
  namespaceAdmin=injector.getInstance(NamespaceAdmin.class);
  if (firstInit) {
    namespaceAdmin.create(NamespaceMeta.DEFAULT);
  }
  secureStore=injector.getInstance(SecureStore.class);
  secureStoreManager=injector.getInstance(SecureStoreManager.class);
  firstInit=false;
}