Program: 4586
Project: 4586
Buggy source:
/** 
 * Configures the AppFabricService pre-start.
 */
@Override protected void startUp() throws Exception {
  LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(),Constants.Logging.COMPONENT_NAME,Constants.Service.APP_FABRIC_HTTP));
  Futures.allAsList(ImmutableList.of(notificationService.start(),applicationLifecycleService.start(),systemArtifactLoader.start(),programRuntimeService.start(),streamCoordinatorClient.start(),programNotificationSubscriberService.start(),runRecordCorrectorService.start(),pluginService.start(),coreSchedulerService.start())).get();
  ImmutableList.Builder<HandlerHook> builder=ImmutableList.builder();
  for (  String hook : handlerHookNames) {
    builder.add(new MetricsReporterHook(metricsCollectionService,hook));
  }
  NettyHttpService.Builder httpServiceBuilder=new CommonNettyHttpServiceBuilder(cConf,Constants.Service.APP_FABRIC_HTTP).setHost(hostname.getCanonicalHostName()).setHandlerHooks(builder.build()).setHttpHandlers(handlers).setConnectionBacklog(cConf.getInt(Constants.AppFabric.BACKLOG_CONNECTIONS,Constants.AppFabric.DEFAULT_BACKLOG)).setExecThreadPoolSize(cConf.getInt(Constants.AppFabric.EXEC_THREADS,Constants.AppFabric.DEFAULT_EXEC_THREADS)).setBossThreadPoolSize(cConf.getInt(Constants.AppFabric.BOSS_THREADS,Constants.AppFabric.DEFAULT_BOSS_THREADS)).setWorkerThreadPoolSize(cConf.getInt(Constants.AppFabric.WORKER_THREADS,Constants.AppFabric.DEFAULT_WORKER_THREADS));
  if (sslEnabled) {
    httpServiceBuilder.setPort(cConf.getInt(Constants.AppFabric.SERVER_SSL_PORT));
    String password=generateRandomPassword();
    KeyStore ks=KeyStores.generatedCertKeyStore(sConf,password);
    SSLHandlerFactory sslHandlerFactory=new SSLHandlerFactory(ks,password);
    httpServiceBuilder.enableSSL(sslHandlerFactory);
  }
 else {
    httpServiceBuilder.setPort(cConf.getInt(Constants.AppFabric.SERVER_PORT));
  }
  cancelHttpService=startHttpService(httpServiceBuilder.build());
  defaultEntityEnsurer.startAndWait();
  if (appVersionUpgradeService != null) {
    appVersionUpgradeService.startAndWait();
  }
}

Fixed version (ground truth):
/** 
 * Configures the AppFabricService pre-start.
 */
@Override protected void startUp() throws Exception {
  LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(),Constants.Logging.COMPONENT_NAME,Constants.Service.APP_FABRIC_HTTP));
  Futures.allAsList(ImmutableList.of(notificationService.start(),provisioningService.start(),applicationLifecycleService.start(),systemArtifactLoader.start(),programRuntimeService.start(),streamCoordinatorClient.start(),programNotificationSubscriberService.start(),runRecordCorrectorService.start(),pluginService.start(),coreSchedulerService.start())).get();
  ImmutableList.Builder<HandlerHook> builder=ImmutableList.builder();
  for (  String hook : handlerHookNames) {
    builder.add(new MetricsReporterHook(metricsCollectionService,hook));
  }
  NettyHttpService.Builder httpServiceBuilder=new CommonNettyHttpServiceBuilder(cConf,Constants.Service.APP_FABRIC_HTTP).setHost(hostname.getCanonicalHostName()).setHandlerHooks(builder.build()).setHttpHandlers(handlers).setConnectionBacklog(cConf.getInt(Constants.AppFabric.BACKLOG_CONNECTIONS,Constants.AppFabric.DEFAULT_BACKLOG)).setExecThreadPoolSize(cConf.getInt(Constants.AppFabric.EXEC_THREADS,Constants.AppFabric.DEFAULT_EXEC_THREADS)).setBossThreadPoolSize(cConf.getInt(Constants.AppFabric.BOSS_THREADS,Constants.AppFabric.DEFAULT_BOSS_THREADS)).setWorkerThreadPoolSize(cConf.getInt(Constants.AppFabric.WORKER_THREADS,Constants.AppFabric.DEFAULT_WORKER_THREADS));
  if (sslEnabled) {
    httpServiceBuilder.setPort(cConf.getInt(Constants.AppFabric.SERVER_SSL_PORT));
    String password=generateRandomPassword();
    KeyStore ks=KeyStores.generatedCertKeyStore(sConf,password);
    SSLHandlerFactory sslHandlerFactory=new SSLHandlerFactory(ks,password);
    httpServiceBuilder.enableSSL(sslHandlerFactory);
  }
 else {
    httpServiceBuilder.setPort(cConf.getInt(Constants.AppFabric.SERVER_PORT));
  }
  cancelHttpService=startHttpService(httpServiceBuilder.build());
  defaultEntityEnsurer.startAndWait();
  if (appVersionUpgradeService != null) {
    appVersionUpgradeService.startAndWait();
  }
}