Program: 5376
Project: 5376
Buggy source:
/** 
 * Creates a new instance.
 * @param delegate a {@link Supplier} that gives new instance of the delegating Service.
 * @param retryStrategy strategy to use for retrying
 */
public RetryOnStartFailureService(final Supplier<Service> delegate,final RetryStrategy retryStrategy){
  final Service service=delegate.get();
  this.delegateServiceName=service.getClass().getSimpleName();
  this.startupThread=new Thread("String_Node_Str" + delegateServiceName){
    @Override public void run(){
      int failures=0;
      long startTime=System.currentTimeMillis();
      long delay=0L;
      Service delegateService=service;
      while (delay >= 0 && !isInterrupted()) {
        try {
          currentDelegate=delegateService;
          delegateService.start().get();
          break;
        }
 catch (        InterruptedException e) {
          interrupt();
          break;
        }
catch (        Throwable t) {
          LOG.debug("String_Node_Str",delegateServiceName,t);
          delay=retryStrategy.nextRetry(++failures,startTime);
          if (delay < 0) {
            LOG.error("String_Node_Str",delegateServiceName,failures,System.currentTimeMillis() - startTime);
            notifyFailed(t);
            break;
          }
          try {
            TimeUnit.MILLISECONDS.sleep(delay);
            LOG.debug("String_Node_Str",delegateServiceName);
            delegateService=delegate.get();
          }
 catch (          InterruptedException e) {
            interrupt();
          }
        }
      }
      if (isInterrupted()) {
        LOG.warn("String_Node_Str",delegateServiceName);
      }
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Creates a new instance.
 * @param delegate a {@link Supplier} that gives new instance of the delegating Service.
 * @param retryStrategy strategy to use for retrying
 */
public RetryOnStartFailureService(final Supplier<Service> delegate,final RetryStrategy retryStrategy){
  final Service service=delegate.get();
  this.delegateServiceName=service.getClass().getSimpleName();
  this.startupThread=new Thread("String_Node_Str" + delegateServiceName){
    @Override public void run(){
      int failures=0;
      long startTime=System.currentTimeMillis();
      long delay=0L;
      Service delegateService=service;
      while (delay >= 0 && !isInterrupted() && !stopped) {
        try {
          currentDelegate=delegateService;
          delegateService.start().get();
          break;
        }
 catch (        InterruptedException e) {
          interrupt();
          break;
        }
catch (        Throwable t) {
          LOG.debug("String_Node_Str",delegateServiceName,t);
          delay=retryStrategy.nextRetry(++failures,startTime);
          if (delay < 0) {
            LOG.error("String_Node_Str",delegateServiceName,failures,System.currentTimeMillis() - startTime);
            notifyFailed(t);
            break;
          }
          try {
            TimeUnit.MILLISECONDS.sleep(delay);
            LOG.debug("String_Node_Str",delegateServiceName);
            delegateService=delegate.get();
          }
 catch (          InterruptedException e) {
            interrupt();
          }
        }
      }
      if (isInterrupted()) {
        LOG.warn("String_Node_Str",delegateServiceName);
      }
    }
  }
;
}