Program: 79367
Project: 79367
Buggy source:
private org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse exec(Function<io.cloudsoft.winrm4j.winrm.WinRmTool,io.cloudsoft.winrm4j.winrm.WinRmToolResponse> task){
  Collection<Throwable> exceptions=Lists.newArrayList();
  Stopwatch totalStopwatch=Stopwatch.createStarted();
  for (int i=0; i < execTries; i++) {
    Stopwatch stopwatch=Stopwatch.createStarted();
    Duration connectTimestamp=null;
    Duration execTimestamp=null;
    try {
      WinRmTool tool=connect();
      connectTimestamp=Duration.of(stopwatch);
      WinRmToolResponse result=task.apply(tool);
      execTimestamp=Duration.of(stopwatch);
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + user + "String_Node_Str"+ host+ "String_Node_Str"+ port+ "String_Node_Str"+ (logCredentials ? "String_Node_Str" + password : "String_Node_Str")+ "String_Node_Str"+ Duration.of(execTimestamp).toStringRounded()+ "String_Node_Str"+ Duration.of(connectTimestamp).toStringRounded()+ "String_Node_Str");
      }
      return wrap(result);
    }
 catch (    Exception e) {
      Exceptions.propagateIfFatal(e);
      Duration sleep=Duration.millis(Math.min(Math.pow(2,i) * 1000,execRetryDelay.toMilliseconds()));
      Duration failTimestamp=Duration.of(stopwatch);
      String timeMsg="String_Node_Str" + Duration.of(totalStopwatch).toStringRounded() + "String_Node_Str"+ Duration.of(failTimestamp).toStringRounded()+ (connectTimestamp != null ? "String_Node_Str" + Duration.of(connectTimestamp).toStringRounded() : "String_Node_Str");
      if (i == (execTries + 1)) {
        LOG.info("String_Node_Str" + user + "String_Node_Str"+ host+ "String_Node_Str"+ port+ "String_Node_Str"+ (logCredentials ? "String_Node_Str" + password : "String_Node_Str")+ "String_Node_Str"+ (i + 1)+ "String_Node_Str"+ execTries+ "String_Node_Str"+ timeMsg+ "String_Node_Str",e);
      }
 else       if (i == 0) {
        LOG.warn("String_Node_Str" + user + "String_Node_Str"+ host+ "String_Node_Str"+ port+ "String_Node_Str"+ (logCredentials ? "String_Node_Str" + password : "String_Node_Str")+ "String_Node_Str"+ sleep+ "String_Node_Str"+ (i + 1)+ "String_Node_Str"+ execTries+ "String_Node_Str"+ timeMsg+ "String_Node_Str",e);
        Time.sleep(sleep);
      }
 else {
        LOG.debug("String_Node_Str" + user + "String_Node_Str"+ host+ "String_Node_Str"+ port+ "String_Node_Str"+ (logCredentials ? "String_Node_Str" + password : "String_Node_Str")+ "String_Node_Str"+ sleep+ "String_Node_Str"+ (i + 1)+ "String_Node_Str"+ execTries+ "String_Node_Str"+ timeMsg+ "String_Node_Str",e);
        Time.sleep(sleep);
      }
      exceptions.add(e);
    }
  }
  throw Exceptions.propagate("String_Node_Str",exceptions);
}

Fixed version (ground truth):
private org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse exec(Function<io.cloudsoft.winrm4j.winrm.WinRmTool,io.cloudsoft.winrm4j.winrm.WinRmToolResponse> task){
  Collection<Throwable> exceptions=Lists.newArrayList();
  Stopwatch totalStopwatch=Stopwatch.createStarted();
  for (int i=0; i < execTries; i++) {
    Stopwatch stopwatch=Stopwatch.createStarted();
    Duration connectTimestamp=null;
    Duration execTimestamp=null;
    try {
      WinRmTool tool=connect();
      connectTimestamp=Duration.of(stopwatch);
      WinRmToolResponse result=task.apply(tool);
      execTimestamp=Duration.of(stopwatch);
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + user + "String_Node_Str"+ host+ "String_Node_Str"+ port+ "String_Node_Str"+ (logCredentials ? "String_Node_Str" + password : "String_Node_Str")+ "String_Node_Str"+ Duration.of(execTimestamp).toStringRounded()+ "String_Node_Str"+ Duration.of(connectTimestamp).toStringRounded()+ "String_Node_Str");
      }
      return wrap(result);
    }
 catch (    Exception e) {
      Exceptions.propagateIfFatal(e);
      Duration sleep=Duration.millis(Math.min(Math.pow(2,i) * 1000,execRetryDelay.toMilliseconds()));
      Duration failTimestamp=Duration.of(stopwatch);
      String timeMsg="String_Node_Str" + Duration.of(totalStopwatch).toStringRounded() + "String_Node_Str"+ Duration.of(failTimestamp).toStringRounded()+ (connectTimestamp != null ? "String_Node_Str" + Duration.of(connectTimestamp).toStringRounded() : "String_Node_Str");
      if ((i + 1) == execTries) {
        LOG.info("String_Node_Str" + user + "String_Node_Str"+ host+ "String_Node_Str"+ port+ "String_Node_Str"+ (logCredentials ? "String_Node_Str" + password : "String_Node_Str")+ "String_Node_Str"+ (i + 1)+ "String_Node_Str"+ execTries+ "String_Node_Str"+ timeMsg+ "String_Node_Str",e);
      }
 else       if (i == 0) {
        LOG.warn("String_Node_Str" + user + "String_Node_Str"+ host+ "String_Node_Str"+ port+ "String_Node_Str"+ (logCredentials ? "String_Node_Str" + password : "String_Node_Str")+ "String_Node_Str"+ sleep+ "String_Node_Str"+ (i + 1)+ "String_Node_Str"+ execTries+ "String_Node_Str"+ timeMsg+ "String_Node_Str",e);
        Time.sleep(sleep);
      }
 else {
        LOG.debug("String_Node_Str" + user + "String_Node_Str"+ host+ "String_Node_Str"+ port+ "String_Node_Str"+ (logCredentials ? "String_Node_Str" + password : "String_Node_Str")+ "String_Node_Str"+ sleep+ "String_Node_Str"+ (i + 1)+ "String_Node_Str"+ execTries+ "String_Node_Str"+ timeMsg+ "String_Node_Str",e);
        Time.sleep(sleep);
      }
      exceptions.add(e);
    }
  }
  throw Exceptions.propagate("String_Node_Str",exceptions);
}