Program: 49457
Project: 49457
Buggy source:
void doShutdown(boolean force){
  long start=Clock.currentTimeMillis();
  logger.log(Level.FINEST,"String_Node_Str" + String.valueOf(active));
  if (!force && isActive()) {
    final int maxWaitSeconds=groupProperties.GRACEFUL_SHUTDOWN_MAX_WAIT.getInteger();
    int waitSeconds=0;
    do {
      try {
        Thread.sleep(500);
      }
 catch (      InterruptedException e) {
      }
    }
 while (concurrentMapManager.partitionManager.hasActiveBackupTask() && ++waitSeconds < maxWaitSeconds);
    if (waitSeconds >= maxWaitSeconds) {
      logger.log(Level.WARNING,"String_Node_Str" + maxWaitSeconds + "String_Node_Str");
    }
  }
  if (isActive()) {
    joined.set(false);
    setActive(false);
    setMasterAddress(null);
    wanReplicationService.shutdown();
    try {
      Runtime.getRuntime().removeShutdownHook(shutdownHookThread);
    }
 catch (    Throwable ignored) {
    }
    if (managementCenterService != null) {
      managementCenterService.shutdown();
    }
    logger.log(Level.FINEST,"String_Node_Str");
    clientHandlerService.shutdown();
    logger.log(Level.FINEST,"String_Node_Str");
    concurrentMapManager.shutdown();
    logger.log(Level.FINEST,"String_Node_Str");
    clusterService.stop();
    if (multicastService != null) {
      logger.log(Level.FINEST,"String_Node_Str");
      multicastService.stop();
    }
    logger.log(Level.FINEST,"String_Node_Str");
    connectionManager.shutdown();
    logger.log(Level.FINEST,"String_Node_Str");
    executorManager.stop();
    textCommandService.stop();
    masterAddress=null;
    if (securityContext != null) {
      securityContext.destroy();
    }
    initializer.destroy();
    int numThreads=threadGroup.activeCount();
    Thread[] threads=new Thread[numThreads * 2];
    numThreads=threadGroup.enumerate(threads,false);
    for (int i=0; i < numThreads; i++) {
      Thread thread=threads[i];
      logger.log(Level.FINEST,"String_Node_Str" + thread.getName());
      thread.interrupt();
    }
    failedConnections.clear();
    serviceThreadPacketQueue.clear();
    systemLogService.shutdown();
    ThreadContext.get().shutdown(this.factory);
    logger.log(Level.INFO,"String_Node_Str" + (Clock.currentTimeMillis() - start) + "String_Node_Str");
  }
}

Fixed version (ground truth):
void doShutdown(boolean force){
  long start=Clock.currentTimeMillis();
  logger.log(Level.FINEST,"String_Node_Str" + String.valueOf(active));
  if (!force && isActive()) {
    final int maxWaitSeconds=groupProperties.GRACEFUL_SHUTDOWN_MAX_WAIT.getInteger();
    int waitSeconds=0;
    do {
      try {
        Thread.sleep(500);
      }
 catch (      InterruptedException e) {
      }
    }
 while (concurrentMapManager.partitionManager.hasActiveBackupTask() && ++waitSeconds < maxWaitSeconds);
    if (waitSeconds >= maxWaitSeconds) {
      logger.log(Level.WARNING,"String_Node_Str" + maxWaitSeconds + "String_Node_Str");
    }
  }
  if (isActive()) {
    joined.set(false);
    setActive(false);
    setMasterAddress(null);
    wanReplicationService.shutdown();
    try {
      Runtime.getRuntime().removeShutdownHook(shutdownHookThread);
    }
 catch (    Throwable ignored) {
    }
    if (managementCenterService != null) {
      managementCenterService.shutdown();
    }
    logger.log(Level.FINEST,"String_Node_Str");
    clientHandlerService.shutdown();
    logger.log(Level.FINEST,"String_Node_Str");
    connectionManager.shutdown();
    if (multicastService != null) {
      logger.log(Level.FINEST,"String_Node_Str");
      multicastService.stop();
    }
    logger.log(Level.FINEST,"String_Node_Str");
    concurrentMapManager.shutdown();
    logger.log(Level.FINEST,"String_Node_Str");
    clusterService.stop();
    logger.log(Level.FINEST,"String_Node_Str");
    executorManager.stop();
    textCommandService.stop();
    masterAddress=null;
    if (securityContext != null) {
      securityContext.destroy();
    }
    initializer.destroy();
    int numThreads=threadGroup.activeCount();
    Thread[] threads=new Thread[numThreads * 2];
    numThreads=threadGroup.enumerate(threads,false);
    for (int i=0; i < numThreads; i++) {
      Thread thread=threads[i];
      logger.log(Level.FINEST,"String_Node_Str" + thread.getName());
      thread.interrupt();
    }
    failedConnections.clear();
    serviceThreadPacketQueue.clear();
    systemLogService.shutdown();
    ThreadContext.get().shutdown(this.factory);
    logger.log(Level.INFO,"String_Node_Str" + (Clock.currentTimeMillis() - start) + "String_Node_Str");
  }
}