Program: 59676
Project: 59676
Buggy source:
private void setupBridge(final ClrHandlersInitializer initializer){
  LOG.log(Level.INFO,"String_Node_Str");
  try (final LoggingScope lb=this.loggingScopeFactory.setupBridge()){
    final CLRBufferedLogHandler handler=getCLRBufferedLogHandler();
    if (handler == null) {
      LOG.log(Level.WARNING,"String_Node_Str");
    }
 else {
      handler.setDriverInitialized();
      LOG.log(Level.INFO,"String_Node_Str");
    }
    final String portNumber=httpServer == null ? null : Integer.toString((httpServer.getPort()));
    if (portNumber != null) {
      try {
        final File outputFileName=new File(reefFileNames.getDriverHttpEndpoint());
        BufferedWriter out=new BufferedWriter(new FileWriter(outputFileName));
        out.write(localAddressProvider.getLocalAddress() + "String_Node_Str" + portNumber+ "String_Node_Str");
        out.close();
      }
 catch (      IOException ex) {
        throw new RuntimeException(ex);
      }
    }
    this.evaluatorRequestorBridge=new EvaluatorRequestorBridge(JobDriver.this.evaluatorRequestor,false,loggingScopeFactory);
    final long[] handlers=initializer.getClrHandlers(portNumber,evaluatorRequestorBridge);
    if (handlers != null) {
      if (handlers.length != NativeInterop.N_HANDLERS) {
        throw new RuntimeException(String.format("String_Node_Str",String.valueOf(handlers.length),String.valueOf(NativeInterop.N_HANDLERS)));
      }
      this.allocatedEvaluatorHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.ALLOCATED_EVALUATOR_KEY)];
      this.activeContextHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.ACTIVE_CONTEXT_KEY)];
      this.taskMessageHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.TASK_MESSAGE_KEY)];
      this.failedTaskHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.FAILED_TASK_KEY)];
      this.failedEvaluatorHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.FAILED_EVALUATOR_KEY)];
      this.httpServerEventHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.HTTP_SERVER_KEY)];
      this.completedTaskHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.COMPLETED_TASK_KEY)];
      this.runningTaskHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.RUNNING_TASK_KEY)];
      this.suspendedTaskHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.SUSPENDED_TASK_KEY)];
      this.completedEvaluatorHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.COMPLETED_EVALUATOR_KEY)];
      this.closedContextHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.CLOSED_CONTEXT_KEY)];
      this.failedContextHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.FAILED_CONTEXT_KEY)];
      this.contextMessageHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.CONTEXT_MESSAGE_KEY)];
      this.driverRestartActiveContextHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.DRIVER_RESTART_ACTIVE_CONTEXT_KEY)];
      this.driverRestartRunningTaskHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.DRIVER_RESTART_RUNNING_TASK_KEY)];
      this.driverRestartCompletedHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.DRIVER_RESTART_COMPLETED_KEY)];
      this.driverRestartFailedEvaluatorHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.DRIVER_RESTART_FAILED_EVALUATOR_KEY)];
    }
    try (final LoggingScope lp=this.loggingScopeFactory.getNewLoggingScope("String_Node_Str")){
      final HttpServerEventBridge httpServerEventBridge=new HttpServerEventBridge("String_Node_Str");
      NativeInterop.clrSystemHttpServerHandlerOnNext(this.httpServerEventHandler,httpServerEventBridge,this.interopLogger);
      final String specList=httpServerEventBridge.getUriSpecification();
      LOG.log(Level.INFO,"String_Node_Str",specList);
      if (specList != null) {
        final String[] specs=specList.split("String_Node_Str");
        for (        final String s : specs) {
          final HttpHandler h=new HttpServerBridgeEventHandler();
          h.setUriSpecification(s);
          this.httpServer.addHttpHandler(h);
        }
      }
    }
     this.clrBridgeSetup=true;
  }
   LOG.log(Level.INFO,"String_Node_Str");
}

Fixed version (ground truth):
private void setupBridge(final ClrHandlersInitializer initializer){
  LOG.log(Level.INFO,"String_Node_Str");
  try (final LoggingScope lb=this.loggingScopeFactory.setupBridge()){
    final CLRBufferedLogHandler handler=getCLRBufferedLogHandler();
    if (handler == null) {
      LOG.log(Level.WARNING,"String_Node_Str");
    }
 else {
      handler.setDriverInitialized();
      LOG.log(Level.INFO,"String_Node_Str");
    }
    final String portNumber=httpServer == null ? null : Integer.toString((httpServer.getPort()));
    if (portNumber != null) {
      try {
        final File outputFileName=new File(reefFileNames.getDriverHttpEndpoint());
        BufferedWriter out=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFileName),StandardCharsets.UTF_8));
        out.write(localAddressProvider.getLocalAddress() + "String_Node_Str" + portNumber+ "String_Node_Str");
        out.close();
      }
 catch (      IOException ex) {
        throw new RuntimeException(ex);
      }
    }
    this.evaluatorRequestorBridge=new EvaluatorRequestorBridge(JobDriver.this.evaluatorRequestor,false,loggingScopeFactory);
    final long[] handlers=initializer.getClrHandlers(portNumber,evaluatorRequestorBridge);
    if (handlers != null) {
      if (handlers.length != NativeInterop.N_HANDLERS) {
        throw new RuntimeException(String.format("String_Node_Str",String.valueOf(handlers.length),String.valueOf(NativeInterop.N_HANDLERS)));
      }
      this.allocatedEvaluatorHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.ALLOCATED_EVALUATOR_KEY)];
      this.activeContextHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.ACTIVE_CONTEXT_KEY)];
      this.taskMessageHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.TASK_MESSAGE_KEY)];
      this.failedTaskHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.FAILED_TASK_KEY)];
      this.failedEvaluatorHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.FAILED_EVALUATOR_KEY)];
      this.httpServerEventHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.HTTP_SERVER_KEY)];
      this.completedTaskHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.COMPLETED_TASK_KEY)];
      this.runningTaskHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.RUNNING_TASK_KEY)];
      this.suspendedTaskHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.SUSPENDED_TASK_KEY)];
      this.completedEvaluatorHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.COMPLETED_EVALUATOR_KEY)];
      this.closedContextHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.CLOSED_CONTEXT_KEY)];
      this.failedContextHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.FAILED_CONTEXT_KEY)];
      this.contextMessageHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.CONTEXT_MESSAGE_KEY)];
      this.driverRestartActiveContextHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.DRIVER_RESTART_ACTIVE_CONTEXT_KEY)];
      this.driverRestartRunningTaskHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.DRIVER_RESTART_RUNNING_TASK_KEY)];
      this.driverRestartCompletedHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.DRIVER_RESTART_COMPLETED_KEY)];
      this.driverRestartFailedEvaluatorHandler=handlers[NativeInterop.HANDLERS.get(NativeInterop.DRIVER_RESTART_FAILED_EVALUATOR_KEY)];
    }
    try (final LoggingScope lp=this.loggingScopeFactory.getNewLoggingScope("String_Node_Str")){
      final HttpServerEventBridge httpServerEventBridge=new HttpServerEventBridge("String_Node_Str");
      NativeInterop.clrSystemHttpServerHandlerOnNext(this.httpServerEventHandler,httpServerEventBridge,this.interopLogger);
      final String specList=httpServerEventBridge.getUriSpecification();
      LOG.log(Level.INFO,"String_Node_Str",specList);
      if (specList != null) {
        final String[] specs=specList.split("String_Node_Str");
        for (        final String s : specs) {
          final HttpHandler h=new HttpServerBridgeEventHandler();
          h.setUriSpecification(s);
          this.httpServer.addHttpHandler(h);
        }
      }
    }
     this.clrBridgeSetup=true;
  }
   LOG.log(Level.INFO,"String_Node_Str");
}